如何在 Windows Phone 7 中进行广播流媒体播放
我想在我的应用程序中进行广播流媒体。为此,我尝试了以下代码。但是此代码不起作用。任何人都可以告诉我我缺少什么吗? 首先,我在 .xaml 文件中添加了以下引用
xmlns:smooth="clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming"
,然后添加了以下代码
<smooth:SmoothStreamingMediaElement x:Name="streamer" AutoPlay="True" Source="http://208.53.158.48:8364"/>
,但它不是流式传输。 如果您在浏览器中复制上述 URL,则会打开一个页面。该页面中有一个“收听”按钮。单击该按钮将下载一个 .pls 文件,打开该文件即可播放歌曲。 那么有人可以建议我如何从上面的链接进行流式传输吗?
I want to do radio streaming in my application.For that i have tried following code.But this code is not working.Can anyone tell me what i am missing?
First i have added following reference in .xaml file
xmlns:smooth="clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming"
and then i have added following code
<smooth:SmoothStreamingMediaElement x:Name="streamer" AutoPlay="True" Source="http://208.53.158.48:8364"/>
but it is not streaming.
If you copy above URL in browser then one page will be opened.In that page there is a "Listen" button. By clicking on that button one .pls file will be downloaded and by opening it the song will be played.
So can any one suggest me how to do streaming from above link?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 WebClient 下载 .pls 文件,然后以字符串形式读取内容。这将为您提供一个 URL,您可以将其设置为 MediaElement 控件的 Source 属性。如果 Silverlight 支持该格式,则将播放音频。
Download the .pls file with a WebClient, then read the contents as a string. This should give you a URL that you can set as the Source property of the MediaElement control. If the format is supported by Silverlight, the audio will play.
如果这不是平滑流,则不需要使用 SmoothStreamingMediaElement,只需使用 MediaElement (顺便说一句,我认为不存在纯音频平滑流,除非您对视频部分使用 1x1 或其他非常小的图像)
如果这是 Shoutcast 或兼容的,请参阅 https://shoutcastmss.codeplex.com/
You don't need to use SmoothStreamingMediaElement, just MediaElement if this is not a Smooth Stream (btw, I don't think there exist audio-only smooth streams, unless you use a 1x1 or other very small image for the video part)
If this is Shoutcast or compatible, see https://shoutcastmss.codeplex.com/