Skip to content

Commit 90048df

Browse files
committed
Fix video position
1 parent 4e35503 commit 90048df

File tree

8 files changed

+5723
-6037
lines changed

8 files changed

+5723
-6037
lines changed

example/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { StatusBar } from 'expo-status-bar';
44
import AdvancedImageDemo from './AdvancedImageDemo';
55
import AdvancedVideoDemo from './AdvancedVideoDemo';
66
import VideoLayerDemo from './VideoLayerDemo';
7-
import FullScreenPlayerDemo from './FullScreenPlayerDemo';
87

98
const { height: screenHeight, width: screenWidth } = Dimensions.get('window');
109

example/VideoLayerDemo.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function VideoLayerDemo({ onBack }: VideoLayerDemoProps) {
3434
onShare={handleShare}
3535
// Example: Position back button in top-left (NW) and share button in top-right (NE)
3636
backButtonPosition={ButtonPosition.NW}
37-
shareButtonPosition={ButtonPosition.SE}
37+
shareButtonPosition={ButtonPosition.NE}
3838
showCenterPlayButton={true}
3939
// Other positioning options:
4040
// ButtonPosition.N - Top center
@@ -46,11 +46,7 @@ export default function VideoLayerDemo({ onBack }: VideoLayerDemoProps) {
4646

4747
const styles = StyleSheet.create({
4848
container: {
49-
position: 'absolute',
50-
top: 0,
51-
left: 0,
52-
right: 0,
53-
bottom: 0,
49+
flex: 1,
5450
backgroundColor: '#000',
5551
},
5652
});

example/app.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
"assetBundlePatterns": [
1515
"**/*"
1616
],
17+
"plugins": [
18+
[
19+
"expo-font",
20+
{
21+
"fonts": ["./node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Ionicons.ttf"]
22+
}
23+
]
24+
],
1725
"ios": {
1826
"supportsTablet": true
1927
},

example/package-lock.json

Lines changed: 23 additions & 253 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"dependencies": {
1212
"@expo/config": "~8.5.0",
1313
"@expo/metro-config": "~0.17.1",
14+
"@expo/vector-icons": "^14.0.2",
1415
"cloudinary-react-native": "../",
1516
"expo": "~50.0.21",
1617
"expo-av": "14.0.7",
1718
"expo-crypto": "^14.1.5",
19+
"expo-font": "~11.10.3",
1820
"expo-status-bar": "~1.11.1",
1921
"react": "18.0.0",
2022
"react-native": "0.73.6"

example/yarn.lock

Lines changed: 5685 additions & 5777 deletions
Large diffs are not rendered by default.

src/AdvancedVideo.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface AdvancedVideoProps {
88
videoUrl?: string;
99
cldVideo?: CloudinaryVideo;
1010
videoStyle?: StyleProp<ViewStyle>;
11+
resizeMode?: 'cover' | 'contain' | 'stretch';
1112
onPlaybackStatusUpdate?: (status: AVPlaybackStatus) => void;
1213
enableAnalytics?: boolean;
1314
autoTrackAnalytics?: boolean;
@@ -274,6 +275,7 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
274275
ref={this.videoRef}
275276
source={{ uri: videoUri }}
276277
style={this.props.videoStyle}
278+
resizeMode={this.props.resizeMode || 'contain'}
277279
useNativeControls={false}
278280
onPlaybackStatusUpdate={this.onPlaybackStatusUpdate}
279281
/>

src/widgets/video/layer/CLDVideoLayer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ export class CLDVideoLayer extends React.Component<CLDVideoLayerProps, CLDVideoL
306306
cldVideo={cldVideo}
307307
videoUrl={videoUrl}
308308
videoStyle={StyleSheet.absoluteFill}
309+
resizeMode="contain"
309310
onPlaybackStatusUpdate={this.handleStatusUpdate}
310311
/>
311312

0 commit comments

Comments
 (0)