Skip to content

When using the video playlist option the fullscreen function gives an error #503

@dvdgiesen

Description

@dvdgiesen

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:

<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>

Javascript:

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');
        });

});

Thanks, Dirk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions