0

I'm having a trouble with full-screen toggle of videojs HTML5 Player.

Here, I've got two videos on a page (https://yiddishevinkel.com/archives/9555) where the main video looks ok. But the video in sidebar, I'm not able to switch to full screen mode. When i hit the full-screen toggle, It switches to full screen and immediately gets exited from the full screen mode with "Exited fullscreen because fullscreen element was removed from document." warning in Firefox console.

Note that, Issue persist with single instance of video on page and chrome as well.

1 Answers1

1

Without even consulting the fullscreen api documentation, it seems likely from the message you are getting that videojs is replacing an element and you are invoking requestFullScreen on that element or one of its children. An element that does not exist cannot be displayed full screen, therefore the mode exits, a behaviour that is both documented and pretty obvious from the message.

Solution: don't. Wrap it with a div and invoke requestFullScreen on that.

Peter Wone
  • 17,965
  • 12
  • 82
  • 134