|
@@ -12,6 +12,7 @@
|
|
|
|
|
|
.player {
|
|
.player {
|
|
position: relative;
|
|
position: relative;
|
|
|
|
+ z-index: 2;
|
|
width: 70vw;
|
|
width: 70vw;
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
}
|
|
}
|
|
@@ -96,13 +97,14 @@
|
|
var playerOpen = function (i, player) {
|
|
var playerOpen = function (i, player) {
|
|
if (!ytp[i])
|
|
if (!ytp[i])
|
|
return;
|
|
return;
|
|
-
|
|
|
|
|
|
+
|
|
// Remove thumb and show iframe
|
|
// Remove thumb and show iframe
|
|
player.find('.thumb').outEffect();
|
|
player.find('.thumb').outEffect();
|
|
player.find('iframe').inEffect({
|
|
player.find('iframe').inEffect({
|
|
complete: function () {
|
|
complete: function () {
|
|
// When fully opened, plat video and change cursor
|
|
// When fully opened, plat video and change cursor
|
|
- ytp[i].playVideo()
|
|
|
|
|
|
+ if (ytp[i].getPlayerState() != YT.PlayerState.PLAYING)
|
|
|
|
+ ytp[i].playVideo()
|
|
player.removeClass('play loading').addClass('stop');
|
|
player.removeClass('play loading').addClass('stop');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -110,7 +112,7 @@
|
|
// Close all the players that might be open.
|
|
// Close all the players that might be open.
|
|
$('.player').each(function (idx) {
|
|
$('.player').each(function (idx) {
|
|
if (i == idx) return;
|
|
if (i == idx) return;
|
|
- playerClose(i, $(this));
|
|
|
|
|
|
+ playerClose(idx, $(this));
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -118,13 +120,14 @@
|
|
var playerClose = function (i, player) {
|
|
var playerClose = function (i, player) {
|
|
if (!ytp[i])
|
|
if (!ytp[i])
|
|
return;
|
|
return;
|
|
-
|
|
|
|
- // Stop the video
|
|
|
|
- ytp[i].stopVideo();
|
|
|
|
|
|
|
|
// Hide iframe and show thumg
|
|
// Hide iframe and show thumg
|
|
player.find('iframe').outEffect()
|
|
player.find('iframe').outEffect()
|
|
player.find('.thumb').inEffect(function() {
|
|
player.find('.thumb').inEffect(function() {
|
|
|
|
+ // Stop the video; if playing
|
|
|
|
+ if (ytp[i].getPlayerState() == YT.PlayerState.PLAYING)
|
|
|
|
+ ytp[i].pauseVideo();
|
|
|
|
+
|
|
player.removeClass('stop loading').addClass('play');
|
|
player.removeClass('stop loading').addClass('play');
|
|
});
|
|
});
|
|
}
|
|
}
|