Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are a two problems to be solved here.</p> <p>First, you cannot go to full screen inside a 'play' event handler. For security and good user experience, browsers will only let you trigger full screen inside a user-triggered event, like a 'click'. You can't have every web page going to full screen as soon as you visit it, and you can cause a video to start playing automatically, which would violate that rule. So you need to move this to a 'click' handler on the actual play button.</p> <p>The second is a big problem with Video.js 4.0.x, which is that it's <a href="https://github.com/videojs/video.js/issues/165">minified</a> using Google Closure Compiler with <a href="https://developers.google.com/closure/compiler/docs/api-tutorial3">Advanced Optimizations</a>. So many of the public properties and methods are obfuscated, making them difficult/impossible to use. In this case, <code>requestFullScreen</code> is now <code>player1.Pa()</code>. And, as far as I can tell, <code>cancelFullScreen</code> doesn't exist at all.</p> <p>Here are some options for how to handle this:</p> <ol> <li><p>Use the obfuscated method name. I don't recommend this, because a) the name will change with every minor version upgrade (e.g. 4.0.5) and b) it will make your code unreadable, and c) you can't use <code>cancelFullScreen</code>.</p></li> <li><p>Get an un-minified copy video.js and host it yourself. (You can use Uglify or another minifier that won't mess with the method names.) Video.js doesn't provide this file, so you have to clone the git repo and run the build script yourself. And you don't get the advantage of using video.js's CDN for free.</p></li> <li><p>Use an <a href="http://vjs.zencdn.net/c/video.js">older version</a> of video.js and wait until 4.x is ready for prime time.</p></li> <li><p>Don't use video.js at all. Consider <a href="http://jplayer.org/">jPlayer</a> and <a href="http://www.longtailvideo.com/jw-player/">jwPlayer</a> or roll your own.</p></li> </ol> <p>I recommend 2 or 3.</p> <p><strong>Update:</strong> It looks like this particular issue has been <a href="https://github.com/videojs/video.js/pull/555">fixed</a>, but it has not made it into release yet.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload