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. springboot 针对jackson是自动化配置

    spring.jackson.date-format指定日期格式,比如yyyy-MM-dd HH:mm:ss,或者具体的格式化类的全限定名 spring.jackson.deserialization ...

  2. Python学习---IO的异步[asyncio模块(no-http)]

    Asyncio进行异步IO请求操作: 1. @asyncio.coroutine  装饰任务函数 2. 函数内配合yield from 和装饰器@asyncio.coroutine 配合使用[固定格式 ...

  3. Linux 系统的IP与域名解析文件[局域网的DNS]

    系统的IP与域名解析文件[局域网的DNS] 局域网的DNS: 域名和主机名对应的工具,服务器直接通过域名,方便迁移 # 修改配置 vim /etc/hosts 直接添加: 192.138.25.129 ...

  4. php请求页面将返回的页面发送email

    <?php require_once 'CLI_config.php'; require_once dirname(__FILE__).'/../../../../common/framewor ...

  5. MySQL知识总结(四)二进制日志

    1 定义 bin-log日志记录了所有的DDL和DML的语句,但不包括查询的语句,语句以事件的方式保存,描述了数据的更改过程,此日志对发生灾难时数据恢复起到了极为重要的作用. 2 开启 mysql默认 ...

  6. FFI (语言交互接口(Foreign Function Interface))

    FFI(Foreign Function Interface)是用来与其它语言交互的接口, 在有些语言里面称为语言绑定(language bindings), Java 里面一般称为 JNI(Java ...

  7. 经验总结13--EF配置

    EF配置,开发前的准备及步骤. 使用V22013和EF6.1. 1.使用VS新建MVC项目. 2.创建实体类. 3.配置web.config的数据库链接字符串. <connectionStrin ...

  8. Payment:微信支付配置文件设置说明

    项目GitHub地址:https://github.com/helei112g/payment 微信支付个人觉得在帐号设置上有些麻烦,帐号太多啦,支付宝目前就是一个应用基本涵盖了所有的接口开发. 可能 ...

  9. P4906 小奔关闹钟

    题目背景 由于今天是星期一,闹钟准时响了,由于小奔太困了,所以她想关停闹钟. 题目描述 可是,他的闹钟电路太复杂了,有很多个开关,每个开关都连着其他开关,其他开关又连着更多的开关,当且仅当所有开关都关 ...

  10. ethers.js-1

    https://docs.ethers.io/ethers.js/html/ What is ethers.js The ethers.js library aims to be a complete ...