private void OnStateChanged(PlayerPlugin.PLAYBACK_STATE args) { this.plugin.QueueAction(() => { var stateType = (PlayerPlugin.StateType)Enum.ToObject(typeof(PlayerPlugin.StateType), args.type); // TODO: Update player state based on this* switch (stateType) { case PlayerPlugin.StateType.StateChanged: //this.PlayerState = (PlaybackState)Enum.ToObject(typeof(PlaybackState), args.state); Debug.Log("Playback State: " + stateType.ToString() + " - " + this.PlayerState.ToString()); break; case PlayerPlugin.StateType.Opened: PlayerPlugin.MEDIA_DESCRIPTION description = args.description; Debug.Log("Media Opened: " + description.ToString()); break; case PlayerPlugin.StateType.Failed: PluginUtils.CheckHResult(args.hresult, "RealtimeVideoPlayer::OnStateChanged"); break; default: break; } }); }
internal static void OnStateChanged_Callback(IntPtr senderPtr, PlayerPlugin.PLAYBACK_STATE args) { var thisObj = PluginUtils.GetSenderObject <RealtimeVideoPlayer>(senderPtr); PluginUtils.ExecuteOnUnityThread(() => { thisObj.OnStateChanged(args); }); }