]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Don't autoplay in embed with waiting/ended live
authorChocobozzz <me@florianbigard.com>
Thu, 11 Aug 2022 08:57:58 +0000 (10:57 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 11 Aug 2022 08:57:58 +0000 (10:57 +0200)
client/src/standalone/videos/shared/player-manager-options.ts

index 2eeb5ecac1efbadc9cb87ac6c20bf07cc7b562c5..9cebdcd106de84ded85bc6578d78f9dfe43abae4 100644 (file)
@@ -6,6 +6,7 @@ import {
   VideoCaption,
   VideoDetails,
   VideoPlaylistElement,
+  VideoState,
   VideoStreamingPlaylistType
 } from '../../../../../shared/models'
 import { P2PMediaLoaderOptions, PeertubePlayerManagerOptions, PlayerMode, VideoJSCaption } from '../../../assets/player'
@@ -108,6 +109,10 @@ export class PlayerManagerOptions {
       const params = new URL(window.location.toString()).searchParams
 
       this.autoplay = getParamToggle(params, 'autoplay', false)
+      // Disable auto play on live videos that are not streamed
+      if (video.state.id === VideoState.LIVE_ENDED || video.state.id === VideoState.WAITING_FOR_LIVE) {
+        this.autoplay = false
+      }
 
       this.controls = getParamToggle(params, 'controls', true)
       this.controlBar = getParamToggle(params, 'controlBar', true)