Don't autoplay in embed with waiting/ended live
This commit is contained in:
parent
b1053a30f6
commit
aeb112edbe
1 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,7 @@ import {
|
||||||
VideoCaption,
|
VideoCaption,
|
||||||
VideoDetails,
|
VideoDetails,
|
||||||
VideoPlaylistElement,
|
VideoPlaylistElement,
|
||||||
|
VideoState,
|
||||||
VideoStreamingPlaylistType
|
VideoStreamingPlaylistType
|
||||||
} from '../../../../../shared/models'
|
} from '../../../../../shared/models'
|
||||||
import { P2PMediaLoaderOptions, PeertubePlayerManagerOptions, PlayerMode, VideoJSCaption } from '../../../assets/player'
|
import { P2PMediaLoaderOptions, PeertubePlayerManagerOptions, PlayerMode, VideoJSCaption } from '../../../assets/player'
|
||||||
|
@ -108,6 +109,10 @@ export class PlayerManagerOptions {
|
||||||
const params = new URL(window.location.toString()).searchParams
|
const params = new URL(window.location.toString()).searchParams
|
||||||
|
|
||||||
this.autoplay = getParamToggle(params, 'autoplay', false)
|
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.controls = getParamToggle(params, 'controls', true)
|
||||||
this.controlBar = getParamToggle(params, 'controlBar', true)
|
this.controlBar = getParamToggle(params, 'controlBar', true)
|
||||||
|
|
Loading…
Reference in a new issue