mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-02 07:52:34 +00:00
fix: app not reporting playback started on first start
This commit is contained in:
@@ -66,6 +66,9 @@ export const FullScreenVideoPlayer: React.FC = () => {
|
||||
const [showControls, setShowControls] = useState(true);
|
||||
const [isBuffering, setIsBufferingState] = useState(true);
|
||||
const [ignoreSafeArea, setIgnoreSafeArea] = useState(false);
|
||||
const [orientation, setOrientation] = useState(
|
||||
ScreenOrientation.OrientationLock.UNKNOWN
|
||||
);
|
||||
|
||||
// Seconds
|
||||
const [currentTime, setCurrentTime] = useState(0);
|
||||
@@ -162,13 +165,6 @@ export const FullScreenVideoPlayer: React.FC = () => {
|
||||
return () => backHandler.remove();
|
||||
}, [currentlyPlaying, stopPlayback, router]);
|
||||
|
||||
const [orientation, setOrientation] = useState(
|
||||
ScreenOrientation.OrientationLock.UNKNOWN
|
||||
);
|
||||
|
||||
/**
|
||||
* Event listener for orientation
|
||||
*/
|
||||
useEffect(() => {
|
||||
const subscription = ScreenOrientation.addOrientationChangeListener(
|
||||
(event) => {
|
||||
@@ -232,6 +228,7 @@ export const FullScreenVideoPlayer: React.FC = () => {
|
||||
currentlyPlaying.item?.UserData?.PlaybackPositionTicks || 0;
|
||||
max.value = currentlyPlaying.item.RunTimeTicks || 0;
|
||||
setShowControls(true);
|
||||
playVideo();
|
||||
}
|
||||
}, [currentlyPlaying]);
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import {
|
||||
parseM3U8ForSubtitles,
|
||||
SubtitleTrack,
|
||||
} from "@/utils/hls/parseM3U8ForSubtitles";
|
||||
import { useRouter } from "expo-router";
|
||||
|
||||
export type CurrentlyPlayingState = {
|
||||
url: string;
|
||||
@@ -70,6 +71,8 @@ export const PlaybackProvider: React.FC<{ children: ReactNode }> = ({
|
||||
const [api] = useAtom(apiAtom);
|
||||
const [user] = useAtom(userAtom);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const videoRef = useRef<VideoRef | null>(null);
|
||||
|
||||
const [settings] = useSettings();
|
||||
@@ -326,6 +329,7 @@ export const PlaybackProvider: React.FC<{ children: ReactNode }> = ({
|
||||
} else if (command === "Stop") {
|
||||
console.log("Command ~ Stop");
|
||||
stopPlayback();
|
||||
router.canGoBack() && router.back();
|
||||
} else if (command === "Mute") {
|
||||
console.log("Command ~ Mute");
|
||||
setVolume(0);
|
||||
|
||||
Reference in New Issue
Block a user