Browse Source

stop YouTube players when slide changes. Thanks @rossluebe for patch.

pull/623/head
Joe Germuska 11 years ago
parent
commit
55c32dc85b
  1. 23
      source/js/Core/Media/VMM.ExternalAPI.js

23
source/js/Core/Media/VMM.ExternalAPI.js

@ -1467,23 +1467,26 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
stopPlayers: function() { stopPlayers: function() {
for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { for(var i = 0; i < VMM.master_config.youtube.array.length; i++) {
if (VMM.master_config.youtube.array[i].playing) { if (VMM.master_config.youtube.array[i].playing) {
var the_name = VMM.master_config.youtube.array[i].name; if (typeof VMM.master_config.youtube.array[i].player.the_name !== 'undefined') {
VMM.master_config.youtube.array[i].player[the_name].stopVideo(); VMM.master_config.youtube.array[i].player.the_name.stopVideo();
}
} }
} }
}, },
onStateChange: function(e) { onStateChange: function(e) {
for(var i = 0; i < VMM.master_config.youtube.array.length; i++) { for(var i = 0; i < VMM.master_config.youtube.array.length; i++) {
var the_name = VMM.master_config.youtube.array[i].name; for (var z in VMM.master_config.youtube.array[i].player) {
if (VMM.master_config.youtube.array[i].player[the_name] == e.target) { if (VMM.master_config.youtube.array[i].player[z] == e.target) {
VMM.master_config.youtube.array[i].player.the_name = VMM.master_config.youtube.array[i].player[z];
}
}
if (VMM.master_config.youtube.array[i].player.the_name == e.target) {
if (e.data == YT.PlayerState.PLAYING) { if (e.data == YT.PlayerState.PLAYING) {
VMM.master_config.youtube.array[i].playing = true; VMM.master_config.youtube.array[i].playing = true;
trace(VMM.master_config.youtube.array[i].hd) if (VMM.master_config.youtube.array[i].hd === false) {
if (VMM.master_config.youtube.array[i].hd) { VMM.master_config.youtube.array[i].hd = true;
// SET TO HD VMM.master_config.youtube.array[i].player.the_name.setPlaybackQuality("hd720");
// DOESN'T WORK AS OF NOW
//VMM.master_config.youtube.array[i].player.setPlaybackQuality("hd720");
} }
} }
} }

Loading…
Cancel
Save