You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,17 @@ npm install expo-video
55
55
56
56
**Note:**`expo-av` is deprecated in SDK 52 and removed in SDK 53. For newer Expo versions, use `expo-video`.
57
57
58
+
### For Video Layer with Controls (CLDVideoLayer)
59
+
If you want to use the `CLDVideoLayer` component with UI controls, you need to install additional dependencies:
60
+
61
+
```bash
62
+
npm install @expo/vector-icons expo-font
63
+
```
64
+
Or
65
+
```bash
66
+
yarn add @expo/vector-icons expo-font
67
+
```
68
+
58
69
## Usage
59
70
### Setup
60
71
The `Cloudinary` class is the main entry point forusing the library. Your `cloud_name` is required to create an instance of this class. Your `api_key` and `api_secret` are also needed to perform secure API calls to Cloudinary (e.g., image and video uploads). Setting the configuration parameters can be done either programmatically using an appropriate constructor of the Cloudinary class or globally using an environment variable. You can find your account-specific configuration parametersin the **Dashboard** page of your [account console](https://cloudinary.com/console).
@@ -154,6 +165,62 @@ export default function App() {
154
165
};
155
166
```
156
167
168
+
### Video Layer with Controls
169
+
The `CLDVideoLayer` component provides a full-screen video experience with overlay controls, seekbar, and customizable actions. **Note: This requires `@expo/vector-icons` and `expo-font` to be installed.**
170
+
171
+
```tsx
172
+
import React from 'react';
173
+
import { View, StyleSheet } from 'react-native';
174
+
import { CLDVideoLayer } from 'cloudinary-react-native';
175
+
import { Cloudinary } from '@cloudinary/url-gen';
176
+
import { useFonts } from 'expo-font';
177
+
import { Ionicons } from '@expo/vector-icons';
178
+
179
+
const myCld = new Cloudinary({
180
+
cloud: {
181
+
cloudName: "demo",
182
+
},
183
+
});
184
+
185
+
export default function App() {
186
+
// Preload fonts to prevent warnings
187
+
const [fontsLoaded] = useFonts({
188
+
...Ionicons.font,
189
+
});
190
+
191
+
if (!fontsLoaded) {
192
+
return null; // or a loading component
193
+
}
194
+
195
+
const video = myCld.video('sea_turtle');
196
+
197
+
const handleBack = () => {
198
+
// Handle back navigation
199
+
};
200
+
201
+
const handleShare = () => {
202
+
// Handle custom share action
203
+
};
204
+
205
+
return (
206
+
<View style={styles.container}>
207
+
<CLDVideoLayer
208
+
cldVideo={video}
209
+
onBack={handleBack}
210
+
onShare={handleShare}
211
+
/>
212
+
</View>
213
+
);
214
+
}
215
+
216
+
const styles = StyleSheet.create({
217
+
container: {
218
+
flex: 1,
219
+
backgroundColor: '#000',
220
+
},
221
+
});
222
+
```
223
+
157
224
### Uploading Assets
158
225
The following example performs an unsigned upload of a `string` using the default settings, a request upload callback, and an upload preset (required for unsigned uploads):
0 commit comments