Fix #1041: Support autoplay when loading embed frame from Mastodon and third-party websites

This commit is contained in:
Eliot Berriot 2020-03-11 11:35:48 +01:00
parent 40720328d7
commit a44e7c607b
No known key found for this signature in database
GPG Key ID: 6B501DFD73514E14
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1 @@
Support autoplay when loading embed frame from Mastodon and third-party websites (#1041)

View File

@ -145,6 +145,7 @@ export default {
type: null,
id: null,
tracks: [],
autoplay: false,
url: null,
isLoading: true,
theme: 'dark',
@ -174,6 +175,8 @@ export default {
if (!!params.instance) {
this.baseUrl = params.instance
}
this.autoplay = params.autoplay != undefined || params.auto_play != undefined
this.fetch(this.type, this.id)
},
mounted () {
@ -380,6 +383,9 @@ export default {
},
tracks () {
this.currentIndex = 0
if (this.autoplay) {
this.play(this.currentIndex)
}
}
}
}