如何在 Windows 8 Metro 应用程序中播放 Youtube 或实时流媒体协议视频? [英] How to play Youtube or Real Time Streaming Protocol Videos in Windows 8 Metro apps?

查看:77
本文介绍了如何在 Windows 8 Metro 应用程序中播放 Youtube 或实时流媒体协议视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一款应用,该应用可以从我们的频道中挑选视频并在应用中列出和播放.
我已经完成了所有的 json 解析并准备好了一切,但唯一的问题是我无法播放来自 Youtube API 的 rtsp 视频.
我已经读到可以使用 MediaElement 控件播放 rtsp 视频但它不起作用,我的示例 XAML 代码如下.

I am building one app which can pick videos from our channel and list and play from within the application.
I have done all the json parsing and have everything ready but the only problem is that I am not able to play the rtsp videos coming from the Youtube API.
I have read that it is possible to play rtsp videos using the MediaElement control but its not working, my sample XAML code is as below.

<MediaElement Width="500" Height="500" AutoPlay="True" Source="rtsp://v6.cache5.c.youtube.com/CiQLENy73wIaGwkNCW3rSEjLahMYDSANFEgGUghzdGFuZGFyZAw=/0/0/0/video.3gp"/>

我还查看了 Windows 8 Metro 风格应用程序的播放器框架平滑流客户端 SDK


使用这些,我可以播放存储在服务器 (http://localhost/video.mp4) 中的直接视频,但不能播放通过 rtsp 流式传输的视频.请帮忙.我希望主要通过 rtsp 播放 youtube 视频
我已经搜索了很多但没有找到任何解决方案,请帮助.


Using these I am able to play a direct video stored in the server(http://localhost/video.mp4), but not videos streamed via rtsp. Please help. I want mainly youtube videos via rtsp to be played
I have searched a lot but not finding any solution, please help.

rtsp 流也在工作,我试过通过 VLC 播放,它在那里播放.
操作系统:Windows 8 Release Preview w/VS 2012 Express for Windows 8

The rtsp stream is also working I have tried playing via VLC, its playing there.
OS: Windows 8 Release Preview w/ VS 2012 Express for Windows 8

推荐答案

我很确定播放 YouTube 视频不仅仅是 RTSP 协议.您的示例显示了 .3gp 类型的文件,该文件传统上被视为 QuickTime,MediaElement 无法播放.但是,MediaElement 可以播放 MP4,并且在安装了编解码器和自定义 DirectShow 图形后,它甚至可以播放 FLV.甚至还有一个示例 WPF YouTube 播放器讨论了这里和它看起来源仍然可供下载.

I'm pretty sure there's more to playing YouTube videos than just the RTSP protocol. Your example shows a file of type .3gp, which is traditionally treated as QuickTime and not playable by MediaElement. MediaElement can, however, play MP4s and with a codec installed and a custom DirectShow graph it's even able to play FLVs. There's even a sample WPF YouTube player discussed here and it looks like the source is still available for download.

这篇关于如何在 Windows 8 Metro 应用程序中播放 Youtube 或实时流媒体协议视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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