Skip to content

Swiping play the previous slide video #315

Answered by igordanchenko
nimaen asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, I was finally able to reproduce. It never occurred to me to click-and-drag the video element itself. I was either using touchpad to swipe left / right, or clicking and dragging the blank space outside the video element. I can see the issue now.

Here's what's going on here:

  1. pointer events fire while the video slide is in view (offset === 0)
  2. slide navigation takes place
  3. the above mentioned effect fires, but the video is not playing yet, so videoRef.current.pause() does not get called
  4. the video starts playing asynchronously when the slide is already offscreen (offset !== 0)

I don't believe your workaround would break anything, so it should be a viable option. The only downside is that …

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@nimaen
Comment options

@nimaen
Comment options

@nimaen
Comment options

@igordanchenko
Comment options

Answer selected by igordanchenko
@nimaen
Comment options

@igordanchenko
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants