@@ -4,11 +4,6 @@ import type { CloudinaryVideo } from '@cloudinary/url-gen';
44import { SDKAnalyticsConstants } from './internal/SDKAnalyticsConstants' ;
55import { VideoPlayerAdapter , VideoPlayerRef , VideoPlayerFactory } from './adapters' ;
66
7- // Log module import (but not during tests)
8- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
9- console . log ( '🚀 [Cloudinary] AdvancedVideo module imported successfully!' ) ;
10- }
11-
127interface AdvancedVideoProps {
138 videoUrl ?: string ;
149 cldVideo ?: CloudinaryVideo ;
@@ -46,15 +41,6 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
4641
4742 const videoAdapter = VideoPlayerFactory . getAvailableAdapter ( ) ;
4843
49- // Log detailed information about video adapter selection
50- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
51- console . log ( '[Cloudinary AdvancedVideo] Initializing video component...' ) ;
52- const availableAdapters = VideoPlayerFactory . getAvailableAdapters ( ) ;
53- console . log ( `[Cloudinary AdvancedVideo] Available adapters:` , availableAdapters ) ;
54- console . log ( `[Cloudinary AdvancedVideo] 🎥 Selected video adapter: ${ videoAdapter . getAdapterName ( ) } ` ) ;
55- console . log ( `[Cloudinary AdvancedVideo] You are using: ${ videoAdapter . getAdapterName ( ) === 'expo-video' ? '📱 EXPO-VIDEO (newer)' : videoAdapter . getAdapterName ( ) === 'expo-av' ? '📱 EXPO-AV (legacy)' : '⚠️ FALLBACK' } ` ) ;
56- }
57-
5844 this . state = {
5945 analyticsConnector : null ,
6046 previousStatus : undefined ,
@@ -211,47 +197,23 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
211197 }
212198
213199 try {
214- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
215- console . log ( `[Cloudinary AdvancedVideo] 🎬 Rendering video with ${ this . state . videoAdapter . getAdapterName ( ) } adapter` ) ;
216- }
217200 const videoElement = this . state . videoAdapter . renderVideo ( {
218201 videoUri,
219202 style : this . props . videoStyle ,
220203 onPlaybackStatusUpdate : this . onPlaybackStatusUpdate ,
221- onLoadStart : ( ) => {
222- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
223- console . log ( `[Cloudinary AdvancedVideo] 📡 Video load started using ${ this . state . videoAdapter . getAdapterName ( ) } ` ) ;
224- }
225- } ,
226- onLoad : ( ) => {
227- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
228- console . log ( `[Cloudinary AdvancedVideo] ✅ Video loaded successfully using ${ this . state . videoAdapter . getAdapterName ( ) } ` ) ;
229- }
230- } ,
231- onError : ( error : any ) => {
232- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
233- console . log ( `[Cloudinary AdvancedVideo] ❌ Video error with ${ this . state . videoAdapter . getAdapterName ( ) } :` , error ) ;
234- }
235- } ,
204+ onLoadStart : ( ) => { } ,
205+ onLoad : ( ) => { } ,
206+ onError : ( _error : any ) => { } ,
236207 } , this . videoRef ) ;
237208
238- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
239- console . log ( `[Cloudinary AdvancedVideo] ✅ Video component successfully rendered with ${ this . state . videoAdapter . getAdapterName ( ) } ` ) ;
240- }
241209 return videoElement ;
242210 } catch ( error ) {
243211 // If the adapter fails, fall back to a fallback adapter
244- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
245- console . log ( `[Cloudinary AdvancedVideo] ❌ ${ this . state . videoAdapter . getAdapterName ( ) } adapter failed, falling back to fallback adapter:` , error instanceof Error ? error . message : 'Unknown error' ) ;
246- }
247212 const { FallbackVideoAdapter } = require ( './adapters/FallbackVideoAdapter' ) ;
248213 const fallbackAdapter = new FallbackVideoAdapter (
249214 error instanceof Error ? `Video Error: ${ error . message } ` : 'Unknown video error'
250215 ) ;
251216
252- if ( process . env . NODE_ENV !== 'test' && typeof jest === 'undefined' ) {
253- console . log ( `[Cloudinary AdvancedVideo] 🔄 Using fallback adapter to render video` ) ;
254- }
255217 return fallbackAdapter . renderVideo ( {
256218 videoUri,
257219 style : this . props . videoStyle ,
0 commit comments