diff --git a/components/video/player.vue b/components/video/player.vue index bf89b05..75047f1 100644 --- a/components/video/player.vue +++ b/components/video/player.vue @@ -219,9 +219,8 @@ export default { // Set frame ID here so that it's the same when Youtube API looks for it // this.frameId = `youtube-bg-${this._uid}` - // this.initializeLitePlayer() - - // this.initializePlayer() + this.detectAutoplay() + .then( statuses => console.log(statuses) ) }, methods: { scrollRow ( timestamp ) { @@ -239,6 +238,21 @@ export default { timestampsScroller.scroll({ left: newScrollPosition, behavior: 'smooth' }) }, + async detectAutoplay () { + + if ( !process.client ) return false + + const { default: canAutoPlay } = await import('can-autoplay') + + const willAutoplay = await canAutoPlay.video() + const willAutoplayMuted = await canAutoPlay.video({ muted: true, inline: true }) + + return { + willAutoplay, + willAutoplayMuted + } + }, + async seekTo (timestampInSeconds) { if (this.playerLoaded === false) {