0

So, I have such problem, Im using react-native-video to play audios, I have a function onLessonEnd which fires onEnd and is changing source url to next audio, when screen is active it works fine (we go to next audio and it starts), but when screen is off it does not start next audio, !!function is fired and source is changing to next audio!! but its not starting, once I unlock the screen it starts automatically.

<Video
                ignoreSilentSwitch="ignore"
                ref={videoRef}
                source={{
                  uri: videoUrl,
                }}
                style={[st.verticalVideo, style]}
                controls={false}
                resizeMode={"contain"}
                onLoad={onLoadEnd}
                onProgress={onProgress}
                onEnd={onVideoEnd}
                paused={!state.play}
                playInBackground={true}
                playWhenInactive={true}
                preventsDisplaySleepDuringVideoPlayback={
                  currentLessonType === "video" ? true : false
                }
                textTracks={textTracks as TextTrackTypeOwn[]}
                selectedTextTrack={selectedTextTrack}
                rate={videoSpeed}
              />
AlmaG3st
  • 192
  • 9

0 Answers0