[#t775] added support for youtube player query string

This commit is contained in:
ScottDowne 2011-10-25 17:24:42 -04:00
Родитель b0b8ffc2c9
Коммит a03ea26238
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -29,7 +29,8 @@ Popcorn.player( "youtube", {
var flashvars,
params,
attributes,
src;
src,
query;
// expose a callback to this scope, that is called from the global callback youtube calls
onYouTubePlayerReady[ container.id ] = function() {
@ -187,9 +188,7 @@ Popcorn.player( "youtube", {
options.annotations = +options.annotations === 1 || +options.annotations === 3 ? options.annotations : 1;
flashvars = {
playerapiid: container.id,
controls: options.controls,
iv_load_policy: options.annotations
playerapiid: container.id
};
params = {
@ -201,9 +200,10 @@ Popcorn.player( "youtube", {
id: container.id
};
src = /^.*[\/=](.{11})/.exec( media.src )[ 1 ];
src = /^.*(?:\/|v=)(.{11})/.exec( media.src )[ 1 ];
query = /^.*\?(.*)$/.exec( media.src )[ 1 ];
swfobject.embedSWF( "http://www.youtube.com/e/" + src + "?enablejsapi=1&playerapiid=" + container.id + "&version=3",
swfobject.embedSWF( "//www.youtube.com/e/" + src + "?" + query + "&enablejsapi=1&playerapiid=" + container.id + "&version=3",
container.id, media.offsetWidth, media.offsetHeight, "8", null,
flashvars, params, attributes );
};