/// <summary> /// Create instance of MediaPlayerStandalone object with additional arguments /// </summary> /// <param name="monoObject">MonoBehaviour instanse</param> /// <param name="videoOutputObjects">Objects that will be rendering video output</param> /// <param name="options">Additional player options</param> public MediaPlayerStandalone(MonoBehaviour monoObject, GameObject[] videoOutputObjects, PlayerOptionsStandalone options) { _monoObject = monoObject; _videoOutputObjects = videoOutputObjects; _options = options; _wrapper = new WrapperStandalone(_options); if (_wrapper.NativeIndex < 0) { Debug.LogError("Don't support video playback on current platform or you use incorrect UMP libraries!"); throw new Exception(); } if (_options != null) { if (!string.IsNullOrEmpty(_options.DirectAudioDevice)) { _options.DirectAudioDevice = GetAudioDevice(_options.DirectAudioDevice); } _wrapper.NativeSetPixelsVerticalFlip(_options.FlipVertically); if (_options.FixedVideoSize != Vector2.zero) { _videoBuffer = new PlayerBufferVideo((int)_options.FixedVideoSize.x, (int)_options.FixedVideoSize.y); _wrapper.NativeSetPixelsBuffer(_videoBuffer.FramePixelsAddr, _videoBuffer.Width, _videoBuffer.Height); } if (_options.AudioOutputs != null && _options.AudioOutputs.Length > 0) { _audioManager = new PlayerManagerAudios(_options.AudioOutputs); _audioManager.AddListener(OnAudioFilterRead); } _arguments = _options.GetOptions('\n').Split('\n'); _logDetail = _options.LogDetail; _logListener = _options.LogListener; } MediaPlayerInit(); }