Skip to content

Commit 38aee33

Browse files
committed
Add feature flag
1 parent e89b297 commit 38aee33

File tree

8 files changed

+310
-115
lines changed

8 files changed

+310
-115
lines changed

example/VideoLayerDemo.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ interface VideoLayerDemoProps {
2020
export default function VideoLayerDemo({ onBack }: VideoLayerDemoProps) {
2121
useEffect(() => {
2222
const currentAdapter = VideoPlayerFactory.getAvailableAdapter();
23-
console.log(`🎥 Video Package: ${currentAdapter.getAdapterName()}`);
2423
}, []);
2524

2625
function createMyVideoObject() {

src/AdvancedImage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ interface AdvancedImageProps extends Omit<ImageProps, 'source'> {
88
}
99

1010
const AdvancedImage: React.FC<AdvancedImageProps> = ({
11-
cldImg,
12-
...rest
13-
}) => {
11+
cldImg,
12+
...rest
13+
}) => {
1414
const uri = cldImg.toURL({trackedAnalytics: SDKAnalyticsConstants});
1515
return (
1616
<Image

src/AdvancedVideo.tsx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
8383
private getVideoUri = (): string => {
8484
if (this.props.videoUrl) {
8585
return this.props.videoUrl;
86-
}
86+
}
8787
if (this.props.cldVideo) {
8888
return this.props.cldVideo.toURL({ trackedAnalytics: SDKAnalyticsConstants });
89-
}
90-
return '';
91-
};
89+
}
90+
return '';
91+
};
9292

9393
private initializeAnalytics = async () => {
9494
if (!this.props.enableAnalytics || !this.videoRef.current || this.state.analyticsInitialized) {
@@ -123,12 +123,6 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
123123
};
124124

125125
private onPlaybackStatusUpdate = (status: any) => {
126-
console.log('AdvancedVideo - Status Update:', {
127-
adapterName: this.state.videoAdapter.getAdapterName(),
128-
videoUri: this.getVideoUri(),
129-
status: status,
130-
hasCallback: !!this.props.onPlaybackStatusUpdate
131-
});
132126

133127
if (this.props.enableAnalytics && this.videoRef.current && this.state.analyticsInitialized) {
134128
if (!this.videoRef.current._currentStatus) {
@@ -146,7 +140,6 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
146140
}
147141
this.setState({ previousStatus: status });
148142
} catch (error) {
149-
console.log('AdvancedVideo - Status processing error:', error);
150143
}
151144
}
152145

@@ -262,14 +255,8 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
262255

263256
render() {
264257
const videoUri = this.getVideoUri();
265-
console.log('AdvancedVideo - Render:', {
266-
videoUri,
267-
adapterName: this.state.videoAdapter.getAdapterName(),
268-
isAdapterAvailable: this.state.videoAdapter.isAvailable()
269-
});
270258

271259
if (!videoUri) {
272-
console.log('AdvancedVideo - No video URI provided');
273260
return this.state.videoAdapter.renderVideo({
274261
videoUri: '',
275262
style: this.props.videoStyle,
@@ -283,19 +270,15 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
283270
useNativeControls: this.props.useNativeControls,
284271
onPlaybackStatusUpdate: this.onPlaybackStatusUpdate,
285272
onLoadStart: () => {
286-
console.log('AdvancedVideo - Load Start');
287273
},
288274
onLoad: () => {
289-
console.log('AdvancedVideo - Load Complete');
290275
},
291-
onError: (error: any) => {
292-
console.log('AdvancedVideo - Load Error:', error);
276+
onError: () => {
293277
},
294278
}, this.videoRef);
295279

296280
return videoElement;
297281
} catch (error) {
298-
console.log('AdvancedVideo - Adapter Error:', error);
299282
// If the adapter fails, fall back to a fallback adapter
300283
const { FallbackVideoAdapter } = require('./adapters/FallbackVideoAdapter');
301284
const fallbackAdapter = new FallbackVideoAdapter(

src/adapters/ExpoAVVideoAdapter.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ export class ExpoAVVideoAdapter implements VideoPlayerAdapter {
1717
}
1818

1919
isAvailable(): boolean {
20-
const hasModule = !!this.expoAVModule;
21-
const hasVideo = !!(this.expoAVModule && this.expoAVModule.Video);
22-
const isAvailable = hasModule && hasVideo;
23-
24-
return isAvailable;
20+
return !!(this.expoAVModule && this.expoAVModule.Video);
2521
}
2622

2723
getAdapterName(): string {

0 commit comments

Comments
 (0)