-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optionally load player only after clicking on a preview image #18
Comments
Thanks for using this library 😄 Your suggestion sounds nice to me. (I haven't tested this code whether it works well or not.) <template>
<img v-if="!clicked" src="preview-image.png" @click="clicked=true">
<youtube v-else :video-id="videoId"></youtube>
</template>
<script>
export default {
name: 'Wrapper',
data () {
return {
clicked: false
}
},
props: {
videoId: String
}
}
</script> |
Sure thing, but I'd need an extra component for that and as this could be a recurring problem I'd think it would fit great into this library, something like |
OK, I see. 👍 |
I now started implementing the feature here: https://github.com/Sopamo/vue-youtube-embed/tree/add-preview-mode |
I'll close this because of inactivity. |
I'm using vue-youtube-embed in quite a few projects now, thanks for the great work!
I'm currently working on an application for mobile devices where I want to display multiple (10+) videos on one page, but the performance is really bad, especially on low end devices.
I'd suggest adding an option where only an image tag with the preview image is loaded at first and after the user clicks on the image the real player is loaded and plays the video.
If you want I can implement the functionality and submit a pull request.
The text was updated successfully, but these errors were encountered: