private void xMedia_MediaOpened(object sender, RoutedEventArgs e) { try { Output(xMedia.Name + ": xMedia_MediaOpened "); xMediaStatusTextBlockA.Text = "视频文件播放打开"; if (MediaOpened != null) { PPLiveRoutedEventArgs args = new PPLiveRoutedEventArgs(this); MediaOpened(this, args); } } catch (Exception exp) { Output(exp.ToString()); } }
private void xMedia_MediaEnded(object sender, RoutedEventArgs e) { xMediaStatusTextBlockA.Text = "视频文件播放结束"; if (MediaEnded != null) { PPLiveRoutedEventArgs args = new PPLiveRoutedEventArgs(this); MediaEnded(this, args); } }
private void xMedia_BufferingProgressChanged(object sender, RoutedEventArgs e) { string info = "缓冲进度:" + xMedia.BufferingProgress + " 缓冲时间:" + xMedia.BufferingTime; xMediaBufferTextBlockA.Text = info; if (BufferingProgressChanged != null) { PPLiveRoutedEventArgs args = new PPLiveRoutedEventArgs(this); BufferingProgressChanged(this, args); } }
private void xMedia_CurrentStateChanged(object sender, RoutedEventArgs e) { string info = "视频状态:" + xMedia.CurrentState; Output(xMedia.Name + ": xMedia_CurrentStateChanged " + info); xMediaCurrentStatusTextBlockA.Text = info; if (CurrentStateChanged != null) { PPLiveRoutedEventArgs args = new PPLiveRoutedEventArgs(this); CurrentStateChanged(this, args); } }
void StopMedia() { xMedia.Stop(); xMediaBufferTextBlockA.Text = "暂无"; xMediaDownloadTextBlockA.Text = "暂无"; xMediaCurrentStatusTextBlockA.Text = "视频状态:" + xMedia.CurrentState; if (CurrentStateChanged != null) { PPLiveRoutedEventArgs args = new PPLiveRoutedEventArgs(this); CurrentStateChanged(this, args); } }