From f53a1e9ac79c0f6a231cbdd84042e755f096b87a Mon Sep 17 00:00:00 2001
From: topAmity <112688936+topAmity@users.noreply.github.com>
Date: Sat, 6 Jan 2024 17:00:44 +0700
Subject: [PATCH] fix video ios player
---
.../dist/ImageViewing.js | 34 +++++++++++--------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/src/components/react-native-image-viewing/dist/ImageViewing.js b/src/components/react-native-image-viewing/dist/ImageViewing.js
index b0253545..95c33a05 100644
--- a/src/components/react-native-image-viewing/dist/ImageViewing.js
+++ b/src/components/react-native-image-viewing/dist/ImageViewing.js
@@ -84,22 +84,26 @@ function ImageViewing({
[imageList]
);
const playVideoFullScreen = async () => {
- if(Platform.OS === 'ios'){
+ if (Platform.OS === 'ios') {
onClickPlayButton(currentImageIndex);
setIsPlaying(true)
setPlayingUri(`https://api.${apiRegion}.amity.co/api/v3/files/${videoPosts[currentImageIndex]?.videoFileId?.original}/download`)
- }else{
+ setTimeout(() => {
+ videoPlayerRef.current.presentFullscreenPlayer();
+ }, 100);
+
+ } else {
navigation.navigate('VideoPlayer', { source: `https://api.${apiRegion}.amity.co/api/v3/files/${videoPosts[currentImageIndex]?.videoFileId?.original}/download` })
}
};
- useEffect(() => {
- if (videoPlayerRef && playingUri && isPlaying) {
- videoPlayerRef.current.presentFullscreenPlayer();
- }
- }, [playingUri, isPlaying])
-
+ // useEffect(() => {
+ // if (videoPlayerRef && playingUri.length > 0 && isPlaying) {
+ // videoPlayerRef.current.presentFullscreenPlayer();
+ // }
+ // }, [playingUri, isPlaying])
+
if (!visible) {
return null;
}
@@ -192,14 +196,14 @@ function ImageViewing({
)}
-
-
+