JWplayer Full screen when user clicks on play

后端 未结 1 1435
名媛妹妹
名媛妹妹 2021-01-06 16:36

How do I make JWplayer full screen as soon as a user clicks on the play button? I couldn\'t find anything relating to this on their support.

相关标签:
1条回答
  • 2021-01-06 17:14

    This will only work in HTML5 mode:

    <!DOCTYPE html>
    <html>
    <head>
        <title>Full Screen</title>
    </head>
    <body>
        <script src="http://p.jwpcdn.com/6/12/jwplayer.js" type="text/javascript"></script>
        <div id="player"></div>
        <script type="text/javascript" language="javascript">
        jwplayer("player").setup({
            file: "http://content.jwplatform.com/videos/C4lp6Dtd-el5vTWpr.mp4",
            image: "http://content.bitsontherun.com/thumbs/i8oQD9zd-640.jpg",
            primary: 'html5',
            width: 640,
            height: 360
        });
        jwplayer().onDisplayClick(function() { jwplayer().setFullscreen(true); });
        </script>
    </body>
    </html>
    
    0 讨论(0)
提交回复
热议问题