How to play Youtube or Real Time Streaming Protocol Videos in Windows 8 Metro apps?

梦想与她 提交于 2019-12-05 04:03:57

问题


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"/>

I have also looked at Player Framework for Windows 8 Metro Style Applications and Smooth Streaming Client SDK


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.

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


回答1:


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.



来源:https://stackoverflow.com/questions/12330118/how-to-play-youtube-or-real-time-streaming-protocol-videos-in-windows-8-metro-ap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!