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. shell_processing

    1.文本处理_2:grep,sed,awk 2.regular_expression 3.Test   一.文本处理_2 1.grep --Linux处理正则表达式的主要程序.正则表达式是一种符号表示 ...

  2. Oracle EBS 清除并发请求和(或)管理器数据 请求

    请求说明:该请求可以清除平时提交的请求日志文件.并发管理器的日志文件.报表输出文件.并发请求和并发管理器进程的历史记录信息. 参数说明:(红色标注字段为必输项)1.  实体:ALL:清除请求历史记录. ...

  3. 转: C# 的结构剖析

    原文链接:http://www.cnblogs.com/jiajiayuan/archive/2011/09/20/2181582.html 本文意在巩固基础知识,并不是对其进行深入剖析,还望理解.本 ...

  4. [UI] 精美UI界面欣赏[2]

    精美UI界面欣赏[2]

  5. Python学习---IO的异步[gevent+Grequests模块]

    安装gevent模块 pip3 install gevent Gevent实例 import gevent import requests from gevent import monkey # so ...

  6. 剑指offer 10矩形覆盖

    我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形.请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法 java版本: public class Solution { publ ...

  7. spring-boot默认的application.properties属性

    # =================================================================== # COMMON SPRING BOOT PROPERTIE ...

  8. 在web.xml中配置404错误拦截

    <error-page> <error-code>404</error-code> <location>/home.do</location> ...

  9. jQuery实现简易轮播图的效果

    (图片素材取自于小米官网) 刚开始接触jQuery的学习,个人觉得如果为了实现多数的动态效果,jQuery的确很简易方便. 下面简易的轮播图效果,还请前辈多多指教~ (努力学习react vue an ...

  10. Spring 读取配置文件的俩种方式

    读取配置可通过 org.springframework.core.env.Environment 类来获取, 也可以通过@Value的方式来获取 注解形式: @PropertySource({&quo ...