feat: finish playback speed stuff

This commit is contained in:
Adrian Castro
2024-03-06 12:45:54 +01:00
parent ce38ece1ca
commit 6b5ee9aba0
3 changed files with 12 additions and 12 deletions

View File

@@ -55,7 +55,7 @@ export const PlaybackSpeedSelector = () => {
}}
>
<Text>{speed}</Text>
{speed === currentSpeed.value && (
{speed === currentSpeed && (
<MaterialCommunityIcons
name="check-circle"
size={24}

View File

@@ -228,13 +228,10 @@ export const VideoPlayer = () => {
const onReadyForDisplay = () => {
setIsLoading(false);
setHasStartedPlaying(true);
};
useEffect(() => {
if (videoRef) {
void videoRef.setRateAsync(currentSpeed.value, true);
void videoRef.setRateAsync(currentSpeed, true);
}
}, [currentSpeed.value, videoRef]);
};
useEffect(() => {
const synchronizePlayback = async () => {
@@ -265,7 +262,7 @@ export const VideoPlayer = () => {
shouldPlay={shouldPlay}
resizeMode={resizeMode}
volume={currentVolume.value}
rate={currentSpeed.value}
rate={currentSpeed}
onLoadStart={onVideoLoadStart}
onReadyForDisplay={onReadyForDisplay}
onPlaybackStatusUpdate={setStatus}