player.js icon indicating copy to clipboard operation
player.js copied to clipboard

Expose fullscreen method (Feature Request)

Open another-novelty opened this issue 3 years ago • 3 comments

Hello!

Since the player is obviosly able to switch to fullscreen, it would be nice to expose this functionality.

This would make creating our own controls much more easy as well as taking advantage of native functionality, should it be available.

There was a github issue like this, but it is closed without actually adressing it.

another-novelty avatar Feb 10 '22 14:02 another-novelty

+1; It would also be nice to capture this event and cancel it in order to create a implementation yourself, with still using the button in the control bar.

Marcdj-02 avatar Nov 01 '22 21:11 Marcdj-02

I agree, it is frustrating that this has not been addressed yet.

ocripps24 avatar Dec 26 '22 12:12 ocripps24

This is actually exposed (didn't check if this is a new API or not but I'm in 2.20.1). What you have to do is:

  • iframe has allow="fullscreen" (in my case it was allow="autoplay; fullscreen")
  • iframe has attribute allowfullscreen
  • URL has &allowfullscreen=1 (ex: https://player.vimeo.com/video/{{ videoId }}?autoplay=1&loop=1&autopause=0&background=1&muted=1&allowfullscreen=true)

Source: https://www.allowfullscreen.com/vimeo

Then when you run player.requestFullscreen(), it enters fullscreen mode.

JulienPradet avatar Aug 31 '23 10:08 JulienPradet

This was implemented in #562.

bdougherty avatar Apr 03 '24 22:04 bdougherty