vodkabears / Vide

No longer actively maintained.
http://vodkabears.github.io/vide/
MIT License
3.29k stars 524 forks source link

ScrollMagic Pinning Causes Video to be paused #200

Open bradleylancaster opened 7 years ago

bradleylancaster commented 7 years ago

When i pin the video or video container using ScrollMagic the video remains paused.

I don't know how to manually test to try play the video or select the video.

How do i pause() play the video to test this? The video is buried inside the div. Does this plugin have a method of playing and pausing?

Thanks

fernandolujan commented 6 years ago

I know this issue is a bit old but I figured I'd comment on my solution in case somebody else runs into this in the future. Videos contained within a pinned parent element are paused due to the DOM tree modifications made by ScrollMagic on initialization.

Basically, I had to manually play the video in my scene's "enter" event.

scene
  .setPin('[data-scroll-step-label="7"]')
  .on('enter', () => video.play())
  .addTo(controller)