﻿//--FILE DEPENDANCIES --//
//-----jquery ----///
//-----jquery.json.js ------//

//this is the lightmaker brightcove tiny library...

(function ($) {
    $.fn.extend({

        brightcove: function (data) {
            var defaults =
			{
			    BCUrl: "http://api.brightcove.com/services/library",
			    token: "1dwMRUxWKyOkN3nFqHkD7FiddoqKdYQiFXWShhlM0p7r_TdKBS1LSQ..",
			    command: "command=find_video_by_id"
			}

            var options = $.extend(defaults, data);

            return this.each(function () {
                var o = options;

                //this is where the brightcove code will go

                //grab ahold of the img element
                var elem = $(this);
                var VideoPlayerID = elem.attr("src");

                var path = o.BCUrl + "?" + o.command + "&token=" + o.token + "&video_id=" + VideoPlayerID;
                var response = $.get(path, function (resp) {
                //get thumbnail image       
                }
                );


            });

        }
    });
})(jQuery);
