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?
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.
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.