发现自己又错了,才发现Silverlight 1.1 Alpha对MMS协议支持并不完善,仅仅只是能播放和消耗极少的内存而已,而对于流媒体播放的一些事件开始变得奇怪。

播放MMS流时,只是有播放缓冲,即缓冲百分比和下载百分比会迅速变成100%,随即开始播放,而更奇怪的是,当播放一个自动换头的MMS流时,其播放状态不再是和HTTP流一致。在HTTP流中,在换头时,有播放事件Media Ended,而播放MMS流结束后并不会触发这个事件,而是把播放状态(Current State)改变为Paused,此时若在程序中更改MMS流的地址,则会触发一个Media Ended事件。

另外,对于MMS和HTTP流的支持,在Silverlight 1.0的SDK中是这么说的:

Streaming
In addition to progressive downloads, MediaElement supports live and on-demand streaming from a Windows Media Server. If the file URI specifies the mms protocol, the MediaElement attempts to stream the file first. If the file can’t be streamed, it downloads the file progressively. If the file URI specifies another protocol, such as http or https, the MediaElement attempts a progressive download first. If that fails, the MediaElement attempts to stream the file.

Note that live streaming media cannot be paused–calling the Pause method has no effect.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.