wobsoriano/vue-lite-youtube-embed

Autoplay feature?

Opened this issue · 3 comments

Would you mind adding an autoplay feature?

We're considering using your component in a setting where autoplay is preferrable, but due to Chrome's (and most other browsers') new demands to not autoplay on pages where the user hasn't interacted, we'll need a nice-looking non-autoplay look as well. Yours seems to solve this.

Not able to add this feature :( but in the meantime, you can manualy call warmConnections and addIframe methods on your end:

<script setup>
import { ref } from 'vue'
import LiteYouTubeEmbed from 'vue-lite-youtube-embed'
import 'vue-lite-youtube-embed/style.css'

const iframe = ref(null)

onMounted(() => {
  iframe.value.warmConnections()
  iframe.value.addIframe()
})
</script>

<template>
  <LiteYouTubeEmbed
    id="dQw4w9WgXcQ"
    ref="iframe"
    title="Rick Astley - Never Gonna Give You Up (Official Music Video)"
  />
</template>

Hey wobsoriano, I was looking for this feature too, the solution you provided works but when you say "Not able to add this feature" do you mean that its not possible code-side or that you don't have time to implement it?