Add invidious embed links

This commit is contained in:
Cadence Ember 2020-06-18 01:58:06 +12:00
parent 46fcd06621
commit 1e5c3127c7
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412
2 changed files with 27 additions and 1 deletions

View File

@ -40,6 +40,10 @@ export default Vue.extend({
return `${this.invidiousInstance}/watch?v=${this.id}` return `${this.invidiousInstance}/watch?v=${this.id}`
}, },
getInvidiousEmbedURL() {
return `${this.invidiousInstance}/embed/${this.id}`
},
getYoutubeURL() { getYoutubeURL() {
return `https://www.youtube.com/watch?v=${this.id}` return `https://www.youtube.com/watch?v=${this.id}`
}, },
@ -70,6 +74,14 @@ export default Vue.extend({
copyYoutubeEmbed() { copyYoutubeEmbed() {
this.copy(this.getYoutubeEmbedURL()) this.copy(this.getYoutubeEmbedURL())
} },
openInvidiousEmbed() {
this.open(this.getInvidiousEmbedURL())
},
copyInvidiousEmbed() {
this.copy(this.getInvidiousEmbedURL())
},
} }
}) })

View File

@ -60,6 +60,20 @@
<font-awesome-icon icon="globe"/> <font-awesome-icon icon="globe"/>
Open link Open link
</ft-button> </ft-button>
<ft-button
class="action"
@click="copyInvidiousEmbed()"
>
<font-awesome-icon icon="file-video"/>
Copy embed
</ft-button>
<ft-button
class="action"
@click="openInvidiousEmbed()"
>
<font-awesome-icon icon="file-video"/>
Open embed
</ft-button>
</div> </div>
</div> </div>
</ft-icon-button> </ft-icon-button>