In chrome desktop browser, only the initial video will go fullscreen all the others after calling next or previous give the following error:
jquery.mb.YTPlayer.js:1347 Uncaught TypeError: videoWrapper.css is not a function
at jQuery.fn.init.fullscreen [as YTPFullscreen] (jquery.mb.YTPlayer.js:1347:19)
at HTMLSpanElement.eval (jquery.mb.YTPlayer.js:2093:22)
at HTMLSpanElement.dispatch (jquery.js:5145:27)
at elemData.handle (jquery.js:4949:28)
<div id="wrapper">
<div class="player-container">
<div id="P1" class="player">
</div>
</div>
<div class="controls">
<button class="command" onclick="jQuery('#P1').YTPPlayPrev()">Prev</button>
<button class="command" onclick="jQuery('#P1').YTPPlayNext()">Next</button>
</div>
<div class="dida">
Loading video info...
</div>
</div>
window.$ = window.jQuery = jQuery;
var myPlayer;
var videos = [
{
videoURL: "59Rkw_Lg-0U",
containment:'#P1',
showControls:true,
startAt:0,
mute:false,
autoPlay:true,
loop:false,
opacity:1,
showYTLogo:true,
coverImage:'images/Animation.gif',
mask:'images/Theater.png',
realfullscreen: true
},
{
videoURL: "916rOYwrEWY",
containment:'#P1',
showControls:true,
startAt:0,
mute:false,
autoPlay:true,
loop:false,
opacity:1,
showYTLogo:true,
coverImage:'images/Animation.gif',
mask:'images/Theater.png',
realfullscreen: true
}
];
jQuery(function () {
jQuery.mbYTPlayer.apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
myPlayer = jQuery("#P1").YTPlaylist(videos, false, function (video) {
/*
if (video.videoData) {
jQuery("#videoID").html(video.videoData.id);
jQuery("#videoTitle").html(video.videoData.title);
}
*/
});
myPlayer.on("YTPData", function (e) {
$(".dida").html(e.prop.title + "<br>" + e.prop.description);
console.log(e.prop);
});
myPlayer.on('YTPFullScreenStart', function () {
myPlayer.YTPRemoveMask();
});
myPlayer.on('YTPFullScreenEnd', function () {
myPlayer.YTPAddMask('images/Theater.png');
});
});
In chrome desktop browser, only the initial video will go fullscreen all the others after calling next or previous give the following error:
jquery.mb.YTPlayer.js:1347 Uncaught TypeError: videoWrapper.css is not a function
at jQuery.fn.init.fullscreen [as YTPFullscreen] (jquery.mb.YTPlayer.js:1347:19)
at HTMLSpanElement.eval (jquery.mb.YTPlayer.js:2093:22)
at HTMLSpanElement.dispatch (jquery.js:5145:27)
at elemData.handle (jquery.js:4949:28)
Here's my code:
HTML:
Javascript:
Thanks, Dirk