andrewvasilchuk / vue-lazy-youtube-video

Vue.js component for lazyloading YouTube videos.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to pause video?

andrewcartwright1 opened this issue · comments

commented

Hey,

I have just migrated to this from: https://github.com/kaorun343/vue-youtube-embed/

Was just wondering if this component had the ability to pause the video? If not, whats your thought's on requesting it as a feature/adding it as a feature :)?

My use case is, I have a slider with images and a youtube video, when i click to the next video/image or previous video/image - I would like to pause the video that I currently have open so that the video does not continue to play in the background.

@andrewcartwright1, So many people are asking for YT.Player access by now, so I'm considering to add a native support for YT.Player instance.

// variant 1
this.$refs.youtube.getPlayer().pauseVideo()

// variant 2
this.$refs.youtube.player.pauseVideo()

@andrewcartwright1, I'll implement that feature this week, but for now that's how you can create your own YT.Player instance.

Also take a look at #20

commented

Thanks for getting back to me @andrewvasilchuk i'll check it out!

@andrewcartwright1, Sorry, I forgot about it – these change are not published yet. I'll publish them in an hour.

Any news on this? I have the exact same use case. Current hacky solution I am using is to increment a slide :key to re-render the video slide using @before-change event.

@pranciskus, @andrewcartwright1, You have to update to the latest version, and then refer to the FAQ.

Fixed in 2.2.0.