4

Why this code in not working for me ? I want set player in fullscreen mode on click...

jwplayer('player').setup({
    file: 'file.mp4',
    image: 'poster.jpg',
    width: '600px',
    aspectratio: '4:3'
});
$(document).ready(function() {
    $('#player').click(function() {
        jwplayer('player').setFullscreen(true);
    }); 
});
user3695969
  • 43
  • 1
  • 3

2 Answers2

3

Quoting from the JW Player API Reference:

Note there is no API call to set fullscreen, due to phishing-related security restrictions in both Flash and HTML5.

MisterNeutron
  • 3,359
  • 3
  • 17
  • 20
0

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>

Link : https://stackoverflow.com/a/28950999/1877909

If you are using angular, you can use angularFullScreen which only works for html5

Community
  • 1
  • 1
Hitesh
  • 4,098
  • 11
  • 44
  • 82