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. Azure Document DB 存储过程、触发器、自定义函数的实现

    阅读 大约需要 4 分钟 在上一篇随笔中记录的是关于Azure Cosmos DB 中SQL API (DocumentDB) 的简介和Repository 的实现.本随笔是Document DB 中 ...

  2. UIImagePickerController按钮的中文问题

    UIImagePickerController按钮的中文问题 执行以下两步即可 1. 在targets中设置region为China 2. 在project中添加支持中文  

  3. magento2 重置后台密码

    项目根目录:运行如下命令 bin/magento admin:user:create --admin-user="admin" --admin-password="123 ...

  4. 关于Tomcat端口出现的问题

    =Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at localhost are already in use. Th ...

  5. springmvc 拦截器的使用小结

    /** * * * * 拦截器的作用: * 每个请求到达Controller之前,或者每个响应到达view之前,都可以进行拦截. * 1.全局日志(谁提交了请求,要做什么事) * 2.权限管理(每个请 ...

  6. (1)String类 (2)StringBuilder类和StringBuffer类 (3)日期相关的类

    1.String类(重中之重)1.1 常用的方法(练熟.记住)(1)常用的构造方法 String() - 使用无参的方式构造空字符串对象. String(byte[] bytes) - 根据参数指定的 ...

  7. 【4】python函数基础

    ---恢复内容开始--- 案例1:时间下一秒程序 #__author:"吉勇佳" #date: 2018/10/14 0014 #function: timestr=input(& ...

  8. Mac Item2 设置别名 永久生效

    使用 Item2 终端, 设置 别名的时候, 按照 网上的说法, 是 去 修改 用户目录下的   .bashrc   或者  .bash_profile 这两个文件都可以, 把 alias 写在 这两 ...

  9. vs环境变量学习

    1. 查看vs环境变量: 在项目设置中的任何路径.目录编辑项目下,右下角有个“宏”,点开即可见所有vs环境变量的当前设置...听说还有其它地方,没看到. 2.上边的“宏”,即是英文的vs环境变量 3. ...

  10. virtualbox 错误解决记录

    1,E_INVALIDARG (0x80070057),virtualbox中Cannot register the hard disk错误解决办法 virtualbox中加载已有的虚拟硬盘时出现Ca ...