diff --git a/changes/changelog.d/1041.enhancement b/changes/changelog.d/1041.enhancement new file mode 100644 index 0000000000000000000000000000000000000000..6c608c160c29407dc4bb68ece1e2d9dc69b4420f --- /dev/null +++ b/changes/changelog.d/1041.enhancement @@ -0,0 +1 @@ +Support autoplay when loading embed frame from Mastodon and third-party websites (#1041) diff --git a/front/src/EmbedFrame.vue b/front/src/EmbedFrame.vue index 609348899e0c8e811920bb32b7bff9cf636b02be..ade4717fa642e66a78494f1640add155b2c8ae0a 100644 --- a/front/src/EmbedFrame.vue +++ b/front/src/EmbedFrame.vue @@ -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) + } } } }