public virtual BaseMediaPlayer CreatePlatformMediaPlayer() { BaseMediaPlayer mediaPlayer = null; #if !AVPROVIDEO_FORCE_NULL_MEDIAPLAYER // Setup for running in the editor (Either OSX, Windows or Linux) #if UNITY_EDITOR #if (UNITY_EDITOR_OSX) #if UNITY_EDITOR_64 mediaPlayer = new OSXMediaPlayer(); #else Debug.LogError("[AVProVideo] 32-bit OS X Unity editor not supported. 64-bit required."); #endif #elif UNITY_EDITOR_WIN WindowsMediaPlayer.InitialisePlatform(); mediaPlayer = new WindowsMediaPlayer(_optionsWindows.forceDirectShowApi, _optionsWindows.forceAudioOutputDeviceName); #endif #else // Setup for running builds #if (UNITY_STANDALONE_WIN || UNITY_WSA_10_0 || UNITY_WINRT_8_1) WindowsMediaPlayer.InitialisePlatform(); mediaPlayer = new WindowsMediaPlayer(_optionsWindows.forceDirectShowApi, _optionsWindows.forceAudioOutputDeviceName); #elif (UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS) mediaPlayer = new OSXMediaPlayer(); #elif (UNITY_ANDROID) // Initialise platform (also unpacks videos from StreamingAsset folder (inside a jar), to the persistent data path) AndroidMediaPlayer.InitialisePlatform(); mediaPlayer = new AndroidMediaPlayer(); #elif (UNITY_WEBGL) WebGLMediaPlayer.InitialisePlatform(); mediaPlayer = new WebGLMediaPlayer(); #endif #endif #endif // Fallback if (mediaPlayer == null) { Debug.LogWarning("[AVProVideo] Not supported on this platform. Using placeholder player!"); mediaPlayer = new NullMediaPlayer(); } return mediaPlayer; }
private BaseMediaPlayer CreatePlatformMediaPlayer() { BaseMediaPlayer mediaPlayer = null; // Setup for running in the editor (Either OSX, Windows or Linux) #if UNITY_EDITOR #if (UNITY_EDITOR_OSX) #if UNITY_EDITOR_64 mediaPlayer = new OSXMediaPlayer(); #else Debug.LogWarning("[AVProVideo] 32-bit OS X Unity editor not supported. 64-bit required."); #endif #elif UNITY_EDITOR_WIN WindowsMediaPlayer.InitialisePlatform(); mediaPlayer = new WindowsMediaPlayer(); #endif #else // Setup for running builds #if (UNITY_STANDALONE_WIN) WindowsMediaPlayer.InitialisePlatform(); mediaPlayer = new WindowsMediaPlayer(); //Windows_VLC_MediaPlayer.InitialisePlatform(); //mediaPlayer = new Windows_VLC_MediaPlayer(); #elif (UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS) mediaPlayer = new OSXMediaPlayer(); #elif (UNITY_ANDROID) // Initialise platform (also unpacks videos from StreamingAsset folder (inside a jar), to the persistent data path) AndroidMediaPlayer.InitialisePlatform(); mediaPlayer = new AndroidMediaPlayer(); #elif (UNITY_WP8) // TODO: add Windows Phone 8 suppport #elif (UNITY_WP81) // TODO: add Windows Phone 8.1 suppport #endif #endif // Fallback if (mediaPlayer == null) { Debug.LogWarning("[AVProVideo] Not supported on this platform. Using placeholder video!"); mediaPlayer = new NullMediaPlayer(); } return(mediaPlayer); }