[UWP] [C#] - MediaPlayer如何使用BufferingEnded? [英] [UWP][C#] - MediaPlayer how to use BufferingEnded ?

查看:82
本文介绍了[UWP] [C#] - MediaPlayer如何使用BufferingEnded?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好,

我正在尝试为ARM设备(Raspberry)开发UWP。  在此我使用MediaPlayerElement和MediaPlayer管理我的视频。

I'm trying to develop a UWP for ARM devices (Raspberry).  Into this I'm using a MediaPlayerElement and MediaPlayer for managed my Video.

我想确保视频在开始之前完全缓冲。  查看MediaPlayer的属性可用"BufferingEnded"当缓冲完成时发生。

I would like to be sure that the video is fully buffered before to start.  Looking the properties of MediaPlayer is available "BufferingEnded" that occurs when the buffering has been finished.

问题是我不知道如何使用它...我想在缓冲时将变量置为真完成并等待一个循环,然后继续缓冲完成。  下面是我从Microsoft MSDN获取的简单代码:

The Problem is that I don't know how to use it ... I've in mind to put a variable equal true when the buffering is finished and wait inside a cycle before to go on when the buffering is finish.  Below a simple code that I take from Microsoft MSDN:

XAML

        <MediaPlayerElement x:Name="_mediaPlayerElement" AreTransportControlsEnabled="False" IsFullWindow =" true" HorizontalAlignment="Stretch"   Grid.Row="0" Background="Yellow" Visibility ="Collapsed" PosterSource="Assets/test.png"/>




C#

_mediaPlayerElement.SetMediaPlayer(_mediaPlayer);
 _mediaPlayerElement.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/Video.mp4"));
 _mediaPlayer = _mediaPlayerElement.MediaPlayer;
 _mediaPlayer.RealTimePlayback = true;
            
     // _mediaPlayer.Play();
_mediaPlayer.IsLoopingEnabled = true;

此外,当我暂停视频时,我想要显示图像...我正在乒乓球之间崩溃属性图像和视频......我希望我能做得很好...从表现的立场......

Also When I'm pausing the video, I want to display image ... I'm ping pong with collapse property between the image and the video ... I hope that im doing fine ...from performance stand-point...

提前感谢您的支持,

Br

Andrea

推荐答案

您好,Magni Andrea,

Hi Magni Andrea,

欢迎来到
开发通用Windows应用论坛
!您的问题与IOT有关,我会将此主题移至
对应的  论坛。感谢您的理解。

Welcome to the Developing Universal Windows apps forum! Your issue is relative to IOT, I will move this thread to the corresponding forum. Thanks for your understanding.

最好的问候,

Breeze


这篇关于[UWP] [C#] - MediaPlayer如何使用BufferingEnded?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆