Jump to content
Search Community

antonio michelon

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by antonio michelon

  1. Apologies for the duplicate post, it won't happen again.

    now the code works in codepen, but when i put it in visual studio code it doesn't work the part of restarting the video, just starting and pausing, i installed the greensock snippets extension, do i need anything else?

  2. hey guys

    I'm starting on Gasp, I'm trying to use the scrollingtrigger to control a video according to the page's scroll, with the examples I found here on the site I managed to make play and pause work, but I still couldn't make the video start from the beginning when I go back to the video, in the code I changed the pause option to restart, but nothing has changed in the behavior of the video, below is the code with the restart.
    grateful for the help!

     

      
      let videoElem = videoDiv.querySelector('video')
      ScrollTrigger.create({
        trigger: videoElem,
        start: 'top 80%',
        end: 'top 20%',
        markers: true,
        onEnter: () => videoElem.play(),
        onEnterBack: () => videoElem.play(),
        onLeave: () => videoElem.restart(),
        onLeaveBack: () => videoElem.restart(),

    See the Pen eYPLmzv by Antonio-Miguel-Michelon (@Antonio-Miguel-Michelon) on CodePen

  3. hey guys

    I'm starting on Gasp, I'm trying to use the scrollingtrigger to control a video according to the page's scroll, with the examples I found here on the site I managed to make play and pause work, but I still couldn't make the video start from the beginning when I go back to the video, in the code I changed the pause option to restart, but nothing has changed in the behavior of the video, below is the code with the restart.
    grateful for the help!

     

      
      let videoElem = videoDiv.querySelector('video')
      ScrollTrigger.create({
        trigger: videoElem,
        start: 'top 80%',
        end: 'top 20%',
        markers: true,
        onEnter: () => videoElem.play(),
        onEnterBack: () => videoElem.play(),
        onLeave: () => videoElem.restart(),
        onLeaveBack: () => videoElem.restart(),

    See the Pen eYPLmzv by Antonio-Miguel-Michelon (@Antonio-Miguel-Michelon) on CodePen

×
×
  • Create New...