Skip to content

dynamic url pause intermittently #1767

@jooyoni

Description

@jooyoni

I am implementing a feature where users can watch videos in their selected language. I am using three react-player components to simultaneously play video, background sound, and voice (played in the language chosen by the user). However, I encounter an issue where intermittently the audio playback stops when changing the language while continuously updating the progress bar.

The problem seems to occur during the process of changing the language, where a new URL is set, and the seekTo method is used to move to the previous playback time. Despite attempting to address this by changing the URL upon language switch and using onReady to execute the seekTo method once prepared, the issue persists, albeit with some slight improvement.

I've verified that the 'playing' state remains true throughout this process. To summarize, the URL continuously changes, and upon each change, the seekTo method adjusts the playback time accordingly. However, during this process, the player intermittently stops. Do you have any insights into what might be causing this issue?

Below is the code for the player that changes according to the language.

<ReactPlayer url={voice[subtitleLang]} ref={audioPlayerRef2} onReady={() => { setAudioReady2(true); }} playing={ play && (onAudioBuffer2 || (!onBuffer && !onAudioBuffer)) } onBuffer={() => { setOnAudioBuffer2(true); }} onBufferEnd={() => { setOnAudioBuffer2(false); }} controls loop={false} muted={!useSound} ></ReactPlayer>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions