Пример #1
0
 /// <summary>
 /// Event Handler for miscellaneous informational events
 /// </summary>
 /// <param name="info">The event that occurred</param>
 /// <param name="extra">The data associated with the event (if any), otherwise, 0</param>
 private void HandleInfo(MLMediaPlayerInfo info, int extra)
 {
     if (info == MLMediaPlayerInfo.NetworkBandwidth)
     {
         // source media is not local
         // the parameter extra would contain bandwidth in kbps
     }
 }
        /// <summary>
        /// Event Handler for miscellaneous informational events
        /// </summary>
        /// <param name="info">The event that occurred</param>
        /// <param name="extra">The data associated with the event (if any), otherwise, 0</param>
        private void HandleInfo(MLMediaPlayerInfo info, int extra)
        {
            switch (info)
            {
            case MLMediaPlayerInfo.NetworkBandwidth:
                // source media is not local
                // the parameter extra would contain bandwidth in kbps
                break;

            case MLMediaPlayerInfo.BufferingStart:
                _isBuffering = true;
                EnableUI(false);
                break;

            case MLMediaPlayerInfo.BufferingEnd:
                _isBuffering = false;
                EnableUI(true);
                break;
            }
        }
Пример #3
0
 /// <summary>
 /// Event Handler for miscellaneous informational events
 /// </summary>
 /// <param name="info">The event that occurred</param>
 /// <param name="extra">The data associated with the event (if any), otherwise, 0</param>
 private void HandleInfo(MLMediaPlayerInfo info, int extra)
 {
     Debug.Log("MediaPlayerExample::HandleInfo " + info.ToString());
     if (info == MLMediaPlayerInfo.BufferingEnd)
     {
         // this is guaranteed to be called only when we're streaming
         // Note: we can't guarantee if this is last BufferingEnd event
         _updateTime = true;
         if (_wasPlaying)
         {
             _mediaPlayer.Play();
             _wasPlaying = false;
         }
     }
     else if (info == MLMediaPlayerInfo.NetworkBandwidth)
     {
         _isStreaming = true;
         // extra would contain bandwidth in kbps
     }
 }