So I’m trying to make a TikTok style demo where you can scroll through videos by dragging up, and (minimally) a pause and mute button. Here’s my problem (bug?) – When I scroll from one frame to the next, sometimes the audio track of the first video plays over the audio track of the second video.
Steps to reproduce:
- play first video (it’s on Autoplay anyway)
- Tap to pause first video
- Scroll up to play second video
- Tap to pause second video. Notice that audio from first video is playing
- Tap to unpause second video. Notice that audio from second video is playing
- Scroll up to play third video
- Tap to pause third video. Notice that audio from first and second videos are playing
I have tried all three State Management checkboxes in my drag/navigate interaction (Reset Scroll Position/Component State/Video State) but nothing changes.
I would think that when navigating away from one frame to another would stop a video… can anyone suggest a workaround for this behavior?
Thank you all.
Here is a screen recording of what is going wrong. Hope someone can help. Thanks!
Has anybody else noticed this functionality (bug)?
I am also working on a similar project and was facing the same problem until I figured out how to solve it.
You have to mute all the videos except the one that is being shown on each frame.
In this case, the video that is selected (the one with the bearded boy) is not shown on the current frame, so I muted it. On the next frame, I muted the one that was previously displayed and so on.
Hope it works for you.
Thanks for your message, but how do you mute the video once you have already navigated away to another frame?
Can you attach an example of your workaround? Thanks!
Okay I found a workaround – I have to give each video its own name (i.e., “Video1”, “Video2”, “Video3”, etc.) and then the video automatically gets muted when navigating to another frame or section.
I still regard this as a bug (since it does not encourage reusable code in frames/sections) but at least there is a workaround for now.