-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathSimpleVideoLayer.tsx
More file actions
96 lines (90 loc) · 2.36 KB
/
Copy pathSimpleVideoLayer.tsx
File metadata and controls
96 lines (90 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import React from 'react';
import { View, StyleSheet, TouchableOpacity, Text, Platform } from 'react-native';
import { AdvancedVideo } from 'cloudinary-react-native';
import type { CloudinaryVideo } from '@cloudinary/url-gen';
interface SimpleVideoLayerProps {
cldVideo: CloudinaryVideo;
videoUrl?: string;
onBack?: () => void;
onShare?: () => void;
}
export const SimpleVideoLayer = ({
cldVideo,
videoUrl,
onBack,
onShare
}: SimpleVideoLayerProps) => {
return (
<View style={styles.container}>
<AdvancedVideo
cldVideo={cldVideo}
videoUrl={videoUrl}
videoStyle={StyleSheet.absoluteFill}
/>
<View style={styles.overlay}>
<View style={styles.topRow}>
<TouchableOpacity onPress={onBack} style={styles.controlButton}>
<Text style={styles.controlText}>← Back</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.controlButton}>
<Text style={styles.controlText}>Mute</Text>
</TouchableOpacity>
</View>
<View style={styles.centerControls}>
<TouchableOpacity style={styles.playButton}>
<Text style={styles.playText}>▶️</Text>
</TouchableOpacity>
</View>
<View style={styles.bottomRow}>
<TouchableOpacity onPress={onShare} style={styles.controlButton}>
<Text style={styles.controlText}>Share</Text>
</TouchableOpacity>
</View>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'black',
},
overlay: {
...StyleSheet.absoluteFillObject,
justifyContent: 'space-between',
backgroundColor: 'rgba(0,0,0,0.3)',
},
topRow: {
marginTop: Platform.OS === 'ios' ? 50 : 20,
flexDirection: 'row',
justifyContent: 'space-between',
paddingHorizontal: 16,
},
centerControls: {
alignSelf: 'center',
},
bottomRow: {
flexDirection: 'row',
justifyContent: 'flex-end',
padding: 16,
},
controlButton: {
backgroundColor: 'rgba(255,255,255,0.2)',
paddingHorizontal: 12,
paddingVertical: 8,
borderRadius: 6,
},
controlText: {
color: 'white',
fontSize: 16,
fontWeight: '600',
},
playButton: {
backgroundColor: 'rgba(255,255,255,0.2)',
padding: 20,
borderRadius: 50,
},
playText: {
fontSize: 24,
},
});