Please provide the following:
- SDK Version: “^47.0.0”,
- Platforms(Android/iOS/web/all):iOS
- Add the appropriate “Tag” based on what Expo library you have a question on.
“expo-av”: “~13.0.2”,
useEffect(() => {
disableFullScreen && [
ref.current.dismissFullscreenPlayer(),
navigate(screenName.homeScreen),
];
}, [disableFullScreen, ref]);
return (
<Video
ref={ref}
onPlaybackStatusUpdate={async (status) => {
if (index == 0) {
if (status.isLoaded && status.didJustFinish) {
setIndex(1);
}
}
if (index > 0) {
setVideoStatus(status);
if (status.isLoaded && status.didJustFinish) {
setDisableFullScreen(true);
if (ref?.current && ref?.current !== undefined) {
}
try {
await ref.current.unloadAsync();
await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.PORTRAIT_UP
);
navigate(screenName.homeScreen);
} catch (error) {
console.log(error);
}
}
}
}}
shouldPlay={true}
source={{ uri: videos[index]?.uri, overrideFileExtensionAndroid: 'm3u8' }}
useNativeControls={index == 1 ? true : false}
onFullscreenUpdate={async (event) => {
if (
event.fullscreenUpdate === VideoFullscreenUpdate.PLAYER_DID_DISMISS ||
event.fullscreenUpdate === VideoFullscreenUpdate.PLAYER_WILL_DISMISS
) {
await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.PORTRAIT_UP
);
await ref.current.unloadAsync();
setTimeout(() => {
navigate(screenName.homeScreen);
}, 600);
}
}}
onLoadStart={async () =>
index > 0 && [
await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.LANDSCAPE_LEFT
),
await ref.current.presentFullscreenPlayer(),
]
}
resizeMode={ResizeMode.CONTAIN}
isLooping={false}
volume={1}
style={{
height: Dimensions.get('window').height,
}}
{...props}
>
{index == 0 && <AdButton />}
</Video>
Expected behavior: close player and go to screen x.