Skip to content
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

how to lazy load youtube video? #34

Open
codeitlikemiley opened this issue Nov 5, 2017 · 1 comment
Open

how to lazy load youtube video? #34

codeitlikemiley opened this issue Nov 5, 2017 · 1 comment

Comments

@codeitlikemiley
Copy link

is there a way i can lazy load this , help would be appreciated thanks

@eelbahri
Copy link

eelbahri commented Nov 8, 2017

You can use "ready" attribute with component, here is how I did :

<div :class="{'spinner': !isLoaded}"></div>
<youtube
class="video"
player-width="100%"
player-height="100%"
:video-id='yourId'
@ready="ready"></youtube>

then with this method :

methods: {
    ready (player) {
        this.player = player
        this.isLoaded = true
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants