import { VideoCaptionService } from '@app/shared/video-caption'
import { MarkdownService } from '@app/shared/renderer'
import {
+ videojs,
CustomizationOptions,
P2PMediaLoaderOptions,
PeertubePlayerManager,
}
showSupportModal () {
+ this.pausePlayer()
+
this.videoSupportModal.show()
}
showShareModal () {
+ this.pausePlayer()
+
this.videoShareModal.show(this.currentTime)
}
}
}
+ onModalOpened () {
+ this.pausePlayer()
+ }
+
onVideoRemoved () {
this.redirectService.redirectToHomepage()
}
segmentsSha256Url: hlsPlaylist.segmentsSha256Url,
redundancyBaseUrls: hlsPlaylist.redundancies.map(r => r.baseUrl),
trackerAnnounce: this.video.trackerUrls,
- videoFiles: this.video.files
+ videoFiles: hlsPlaylist.files
} as P2PMediaLoaderOptions
Object.assign(options, { p2pMediaLoader })
this.zone.runOutsideAngular(async () => {
this.player = await PeertubePlayerManager.initialize(mode, options, player => this.player = player)
+ this.player.focus()
this.player.on('customError', ({ err }: { err: any }) => this.handleError(err))
this.player.on('theaterChange', (_: any, enabled: boolean) => {
this.zone.run(() => this.theaterEnabled = enabled)
})
+
+ this.hooks.runAction('action:video-watch.player.loaded', 'video-watch', { player: this.player })
})
this.setVideoDescriptionHTML()
this.setOpenGraphTags()
this.checkUserRating()
- this.hooks.runAction('action:video-watch.video.loaded', 'video-watch')
+ this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', { videojs })
}
private autoplayNext () {
]
if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys)
}
+
+ private pausePlayer () {
+ if (!this.player) return
+
+ this.player.pause()
+ }
}