简体   繁体   中英

MediaElement Windows Phone 8.1 does not play links to resources

MediaElement Windows Phone 8.1 does not play links to resources, for example http://kgot-fm.akacast.akamaistream.net/7/449/31707/v1/auth.akacast.akamaistream.net/kgot-fm , but plays links. mp3. Windows 8 running all references. What's the problem? and how to fix it? the same code.

//only works in windows 8.1
<MediaElement x:Name="MediaElement" 
                      Source="http://kgot-fm.akacast.akamaistream.net/7/449/31707/v1/auth.akacast.akamaistream.net/kgot-fm"
                      AutoPlay="True" Margin="199,320,114,252" Width="100" Height="100"/>
//works in windows 8, and in windows phone 8.1
<MediaElement x:Name="MediaElement" 
                      Source="http://radio02-cn03.akadostream.ru:8114/businessfm96.mp3"
                      AutoPlay="True" Margin="199,320,114,252" Width="100" Height="100"/>

If you subscribe to MediaElement.MediaFailed :

MediaElement.MediaFailed += MediaElement_MediaFailed;

then you will see that using the first link you get:

MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED : HRESULT - 0xC00D2EE0

which means (HRESULT) that:

0xC00D2EE0 NS_E_UNKNOWN_PROTOCOL

The specified protocol is not supported.

The list of supported audio and video formats you will find here.

从c#中将字符串设置为uri

MediaElement.Source = new Uri("http://kgot-fm.akacast.akamaistream.net/7/449/31707/v1/auth.akacast.akamaistream.net/kgot-fm");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM