feat: playback speed changing

This commit is contained in:
Adrian Castro
2024-03-01 14:47:35 +01:00
parent 9c00fc2f54
commit ae760a4b9b
4 changed files with 94 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ import * as StatusBar from "expo-status-bar";
import { findHighestQuality } from "@movie-web/provider-utils";
import { useBrightness } from "~/hooks/player/useBrightness";
import { usePlaybackSpeed } from "~/hooks/player/usePlaybackSpeed";
import { usePlayer } from "~/hooks/player/usePlayer";
import { useVolume } from "~/hooks/player/useVolume";
import { useAudioTrackStore } from "~/stores/audio";
@@ -41,6 +42,7 @@ export const VideoPlayer = () => {
setShowVolumeOverlay,
handleVolumeChange,
} = useVolume();
const { currentSpeed } = usePlaybackSpeed();
const { dismissFullscreenPlayer } = usePlayer();
const [videoSrc, setVideoSrc] = useState<AVPlaybackSource>();
const [isLoading, setIsLoading] = useState(true);
@@ -257,6 +259,7 @@ export const VideoPlayer = () => {
shouldPlay={shouldPlay}
resizeMode={resizeMode}
volume={currentVolume.value}
rate={currentSpeed.value}
onLoadStart={onVideoLoadStart}
onReadyForDisplay={onReadyForDisplay}
onPlaybackStatusUpdate={setStatus}