forked from Ninjalama/streamyfin_mirror
Stop websocket on page exit for transcoded player
This commit is contained in:
@@ -362,23 +362,10 @@ const Player = () => {
|
||||
}));
|
||||
};
|
||||
|
||||
const backAction = () => {
|
||||
videoRef.current?.pause();
|
||||
return false;
|
||||
};
|
||||
|
||||
useFocusEffect(
|
||||
React.useCallback(() => {
|
||||
const onBackPress = () => {
|
||||
return backAction();
|
||||
};
|
||||
|
||||
BackHandler.addEventListener("hardwareBackPress", onBackPress);
|
||||
play();
|
||||
|
||||
return async () => {
|
||||
videoRef.current?.pause();
|
||||
BackHandler.removeEventListener("hardwareBackPress", onBackPress);
|
||||
stop();
|
||||
};
|
||||
}, [])
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user