Exemple #1
0
 /// <summary>
 /// 绑定播放错误事件
 /// </summary>
 /// <param name="action"></param>
 private void AddEncounteredErrorEvent()
 {
     if (player)
     {
         player.AddEncounteredErrorEvent(OnEncounteredError);
         player.AddPlayingEvent(OnVideoPlay);
     }
 }
 /// <summary>
 /// 绑定播放错误事件
 /// </summary>
 /// <param name="action"></param>
 private void AddEncounteredEvent(UniversalMediaPlayer vedioPlayer, Action action = null)
 {
     if (vedioPlayer)
     {
         vedioPlayer.AddEncounteredErrorEvent(() =>
         {
             OnEncounteredError(vedioPlayer);
         });
         vedioPlayer.AddPlayingEvent(OnVideoPlay);
     }
     if (action != null)
     {
         action();
     }
 }