- this.currentPlaylistElement = previous
-
- await this.loadVideoAndBuildPlayer(this.currentPlaylistElement.video.uuid)
- }
-
- getCurrentPosition () {
- if (!this.currentPlaylistElement) return -1
-
- return this.currentPlaylistElement.position
- }
-
- async init () {
- try {
- this.userTokens = Tokens.load()
- await this.initCore()
- } catch (e) {
- console.error(e)
- }
- }
-
- private initializeApi () {
- if (!this.enableApi) return
-
- this.api = new PeerTubeEmbedApi(this)
- this.api.initialize()
- }
-
- private loadParams (video: VideoDetails) {
- try {
- const params = new URL(window.location.toString()).searchParams
-
- this.autoplay = this.getParamToggle(params, 'autoplay', false)
- this.controls = this.getParamToggle(params, 'controls', true)
- this.muted = this.getParamToggle(params, 'muted', undefined)
- this.loop = this.getParamToggle(params, 'loop', false)
- this.title = this.getParamToggle(params, 'title', true)
- this.enableApi = this.getParamToggle(params, 'api', this.enableApi)
- this.warningTitle = this.getParamToggle(params, 'warningTitle', true)
- this.peertubeLink = this.getParamToggle(params, 'peertubeLink', true)
-
- this.scope = this.getParamString(params, 'scope', this.scope)
- this.subtitle = this.getParamString(params, 'subtitle')
- this.startTime = this.getParamString(params, 'start')
- this.stopTime = this.getParamString(params, 'stop')