cookpete / react-player

A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion
https://cookpete.github.io/react-player
MIT License
8.94k stars 1.12k forks source link

hello, Are there events about full screen? #1717

Closed rookiewxy closed 1 month ago

rookiewxy commented 6 months ago

Be sure to search for your issue before opening a new one.

Current Behavior

Expected Behavior

Steps to Reproduce

1. 1. 1.

Environment

Other Information

nzhiti commented 4 months ago

Reactplayer is using screenfull library to handle fullscreen.

if (screenfull.isEnabled) { screenfull.on('change', () => { console.log('Am I fullscreen?', screenfull.isFullscreen ? 'Yes' : 'No'); }); }

You can also try to use the full screen browser API : https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event

addEventListener("fullscreenchange", (event) => {});