Piped icon indicating copy to clipboard operation
Piped copied to clipboard

Remain in fullscreen when autoplay is on

Open BazkieBumpercar opened this issue 2 years ago • 4 comments
trafficstars

Describe the feature

I like to make a playlist and then watch it from my bed. But now for every next video in the playlist, I have to get back to the computer and press or click fullscreen again. Is it possible to remember the fullscreen setting for autoplayed/playlist videos?

Why would this be useful to add?

Not need manual interaction every video

Concept(s)

No response

Additional context

No response

Acknowledgements

  • [X] I have searched the existing issues and this is NOT a duplicate or related to another open issue.
  • [X] I have written a short but informative title.
  • [X] I filled out all of the requested information in this form.

BazkieBumpercar avatar Oct 24 '23 23:10 BazkieBumpercar

I second this. In my opinion the player instance should stay in fullscreen mode especially when autoplay is enabled and the next video is loading/the request is done.

edit: after some investigation of the code, I'll share with you my insights/research results, because I'm lacking the time to continue. Due to browser security settings (Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture.) and design of this VueJS app (dynamic component routing and loading https://github.com/TeamPiped/Piped/blob/master/src/App.vue and nesting the https://github.com/TeamPiped/Piped/blob/master/src/components/VideoPlayer.vue (Shaka player https://github.com/shaka-project/shaka-player) within the https://github.com/TeamPiped/Piped/blob/master/src/components/WatchVideo.vue), you would either need a hacky solution to bypass the browser security settings or majorly refactor the WatchVideo.vue and VideoPlayer.vue component to achieve the resolution of this fullscreen router push page reload incident.

edit2: just for documentation purposes, the affected lines are VideoPlayer.vue#L620, controls.js#L638 (shaka player) and controls.js#L591 (shaka player), which causes the browser to throw the image warning. Due to the WatchVideo.vue#L726 this.$router.push(url); (in navigateNext()), the destroy(hotkeys) method (VideoPlayer.vue#L771) is being called in the lifecycle hooks deactivated() VideoPlayer.vue#L230 and unmounted() VideoPlayer.vue#L234 which leads to the recreation of the ui and the player and therefore a component and page reload with the original fullscreen event being lost. In my opinion you could intercept at this place and prevent the ui and player from being destroyed when the app navigates to the next video.

robertgro avatar Oct 31 '23 20:10 robertgro

👍 up

Scorpoon avatar Nov 02 '23 21:11 Scorpoon

edit: after some investigation of the code, I'll share with you my insights/research results, because I'm lacking the time to continue. Due to browser security settings (Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture.) and design of this VueJS app (dynamic component routing and loading https://github.com/TeamPiped/Piped/blob/master/src/App.vue and nesting the https://github.com/TeamPiped/Piped/blob/master/src/components/VideoPlayer.vue (Shaka player https://github.com/shaka-project/shaka-player) within the https://github.com/TeamPiped/Piped/blob/master/src/components/WatchVideo.vue), you would either need a hacky solution to bypass the browser security settings or majorly refactor the WatchVideo.vue and VideoPlayer.vue component to achieve the resolution of this fullscreen router push page reload incident.

edit2: just for documentation purposes, the affected lines are VideoPlayer.vue#L620, controls.js#L638 (shaka player) and controls.js#L591 (shaka player), which causes the browser to throw the image warning. Due to the WatchVideo.vue#L726 this.$router.push(url); (in navigateNext()), the destroy(hotkeys) method (VideoPlayer.vue#L771) is being called in the lifecycle hooks deactivated() VideoPlayer.vue#L230 and unmounted() VideoPlayer.vue#L234 which leads to the recreation of the ui and the player and therefore a component and page reload with the original fullscreen event being lost. In my opinion you could intercept at this place and prevent the ui and player from being destroyed when the app navigates to the next video.

Pushing this for the devs who are interested and have the according time span.

robertgro avatar Nov 15 '23 07:11 robertgro

Thanks for the effort and reporting, @robertgro !

BazkieBumpercar avatar Nov 15 '23 11:11 BazkieBumpercar