UWP 播放直播流 3MU8
参考:http://www.c-sharpcorner.com/UploadFile/2b876a/http-live-streaming-in-windows-10-uwp/
Create new Windows 10 project and go to MainPage.xaml page design view to design.
Add Media control to play the streamed videos and use the following code to design media control:
<Grid>  
   <MediaElement x:Name="liveMedia" />  
</Grid>  
Next add two app bar controls to Play and Pause the streaming.
<Page.BottomAppBar>  
   <AppBar IsOpen="True">  
      <StackPanel Orientation="Horizontal">  
         <AppBarButton Name="playBtn" Click="playBtn_Click" Icon="Play" Label="Play"></AppBarButton>  
         <AppBarButton Name="pausBtn" Click="pausBtn_Click" Icon="Pause" Label="Pause"></AppBarButton>  
      </StackPanel>  
   </AppBar>  
</Page.BottomAppBar>  
Next go to code behind page and write the following code to stream the video:
var streamUri = new Uri(""); //replace your URL  
var streamResponse = await AdaptiveMediaSource.CreateFromUriAsync(streamUri);  
if (streamResponse.Status == AdaptiveMediaSourceCreationStatus.Success)  
liveMedia.SetMediaStreamSource(streamResponse.MediaSource);  
else  
{  
   //not found  
}  
Before set the media source check the status property to verify that everything went correct otherwise skip it.
By default it will start playing the stream. If you want to pause write the following code:
private void pausBtn_Click(object sender, RoutedEventArgs e)  
{  
   liveMedia.Pause();  
}  
If you want to play again write the following code:
private void playBtn_Click(object sender, RoutedEventArgs e)  
{  
   liveMedia.Play();  
}  
You can play around the media control like the following function: pause, play, mute, unmute and volume increase etc.
Now run the app and check the output like the following video. Here I am going to stream the live news channel. 

UWP 播放直播流 3MU8的更多相关文章

  1. 移动端播放直播流(video.js 播放 m3u8 流)

    流媒体服务器: wowza 流媒体格式: m3u8 播放端:移动端网页(Android.IOS) 播放工具: video.js 代码如下: <!DOCTYPE html> <html ...

  2. QT | 聊聊QT与直播流播放——从QMediaPlayer到Qt-AV

    [原创文章,转载请注明来源,方便查看本文更新] 这段时间需要用QT开发一个播放直播流的功能,能够播放各种格式的直播流,并且CPU占用率不要太高(可以占用GPU),这些是我们的目标. 直播流推流的技术进 ...

  3. 抛开flash,自己开发实现C++ RTMP直播流播放器

    抛开flash,自己开发实现C++ RTMP直播流播放器 众所周知,RTMP是以flash为客户端播放器的直播协议,主要应用在B/S形式的场景中.本人研究并用C++开发实现了RTMP直播流协议的播放器 ...

  4. 搭建rtmp直播流服务之4:videojs和ckPlayer开源播放器二次开发(播放rtmp、hls直播流及普通视频)

    前面几章讲解了使用 nginx-rtmp搭建直播流媒体服务器; ffmpeg推流到nginx-rtmp服务器; java通过命令行调用ffmpeg实现推流服务; 从数据源获取,到使用ffmpeg推流, ...

  5. 悄摸直播(二)—— 播流器实现(拉取rtmp服务器中的数据流,播放直播画面)

    悄摸直播 -- JavaCV实现本机摄像头画面远程直播 播流器 一.功能说明 从rtmp服务器中获取视频流数据 + 展示直播画面 二.代码实现 /** * 播流器 * @param inputPath ...

  6. 利用Docker挂载Nginx-rtmp(服务器直播流分发)+FFmpeg(推流)+Vue.js结合Video.js(播放器流播放)来实现实时网络直播

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_75 众所周知,在视频直播领域,有不同的商家提供各种的商业解决方案,其中比较靠谱的服务商有阿里云直播,腾讯云直播,以及又拍云和网易云 ...

  7. 实现输出h264直播流的rtmp服务器

    RTMP(Real Time Messaging Protocol)是常见的流媒体协议,用来传输音视频数据,结合flash,广泛用于直播.点播.聊天等应用,以及pc.移动.嵌入式等平台,是做流媒体开发 ...

  8. 实现输出h264直播流的rtmp服务器 flash直播服务器【转】

    实现输出h264直播流的rtmp服务器 RTMP(Real Time Messaging Protocol)是常见的流媒体协议,用来传输音视频数据,结合flash,广泛用于直播.点播.聊天等应用,以及 ...

  9. 实现输出h264直播流的rtmp服务器 flash直播服务器

    http://www.cnblogs.com/haibindev/archive/2012/04/16/2450989.html 实现输出h264直播流的rtmp服务器 RTMP(Real Time ...

随机推荐

  1. Django ORM字段类型 单表增删改查 万能的双下划线

    1.ORM三种模型 模型之间的三种关系:一对一,一对多,多对多. 一对一:实质就是在主外键(author_id就是foreign key)的关系基础上,给外键加了一个UNIQUE=True的属性: 一 ...

  2. windows下建立netcore控制台程序,然后传送到centos7下的docker容器里运行

    1.首先,在window下用vs2017开发netcore控制台项目. 2.把建立好的项目传送到centos7下面的容器里. docker cp sharefoldersforwindows/ 359 ...

  3. Oracle EBS PO退货失败

    无法读取例程 &ROUTINE 中配置文件选项 INV_DEBUG_TRACE 的值. 系统-配置文件-地点层 INC%调试%踪 是 select *  from po_interface_e ...

  4. openoffice centos7.4 安装

    其他是配置好java环境后操作 1.下载软件 http://www.openoffice.org/download/other.html 2.安装 tar xf Apache_OpenOffice_4 ...

  5. Windows程序设计(Charles Petzold)HELLOWIN程序实现

    /*-------------------------------------------------------------- HELLOWIN.C--DisPlays "Hello, W ...

  6. 通过Python实现一个文档的半自动录入工具

    需求出现/使用场景: 因为公司需要将word办的接口文档在线化,看起来是个很好的事情,但是就是苦逼了我们这些干活的,其中工程量最大的就是参数的录入,要是参数少也罢,有的接口动辄三四十个参数,更甚八九十 ...

  7. python中pandas里面的dataframe数据的筛选小结

    pandas大家用的都很多,像我这种用的不够熟练,也不够多的就只能做做笔记,尽量留下点东西吧. 筛选行: a. 按照列的条件筛选 df = pandas.DataFrame(...) # suppos ...

  8. python第十四课--排序及自定义函数之自定义函数(案例四)

    整理:4中最常见的自定义函数模型1).无参无返回值2).无参有返回值3).有参无返回值4).有参有返回值 #定义无参无返回值自定义函数 def func1(): print('hello method ...

  9. HtmlImageGenerator字体乱码问题解决、html2image放linux上乱码问题解决

    使用html2image-0.9.jar生成图片. 在本地window系统正常,放到服务器linux系统时候中文乱码问题.英文可以,中文乱码应该就是字体问题了. 一.首先需要在linux安装字体,si ...

  10. 1217. [HNOI2003]消防局的设立【贪心】

    Description 2020年,人类在火星上建立了一个庞大的基地群,总共有n个基地.起初为了节约材料,人类只修建了n-1条道路来 连接这些基地,并且每两个基地都能够通过道路到达,所以所有的基地形成 ...