andrewvasilchuk / vue-lazy-youtube-video

Vue.js component for lazyloading YouTube videos.
MIT License
102 stars 21 forks source link

Feature request: events #16

Closed caweidmann closed 4 years ago

caweidmann commented 4 years ago

Hi there

Would it be possible to add events to the plugin that one can hook into? I'm thinking of two specifically that can be very useful:

  1. @thumbnailLoaded (or something along those lines) which triggers after the thumbnail has fully loaded in the DOM.
  2. @ready which triggers when the iframe has been injected into the DOM and has loaded. This would be useful for mobile when autoplay doesn't work so one can manually trigger the video to play after the "ready" event.
enkota commented 4 years ago

+1 would like to be able to trigger a Google Analytics event when the video is clicked on! @caweidmann has detailed the events pretty well!

andrewvasilchuk commented 4 years ago

@caweidmann, What about <iframe /> load event: #20. What about thumbnail: you can listen to thumbnail events through thumbnailListeners prop.

andrewvasilchuk commented 4 years ago

@caweidmann, @enkota, Can we close the issue, or should we discuss more type of events developer might need to hook into?

andrewvasilchuk commented 4 years ago

@caweidmann, @enkota, Thanks for creating the issue 🙏 .

caweidmann commented 4 years ago

I haven't looked at thumbnailListeners, but if it's possible to catch a load event there then we can close this from my side.

andrewvasilchuk commented 4 years ago

@caweidmann, Yeah, this is possible. You can take a close look here.