Shoutcast MediaElement MediaStreamSource. , Shoutcast, MediaStreamSource - , . . mp3 ( mp3), MediaStreamSource. :
private void Button_Click(object sender, RoutedEventArgs e)
{
var assembly = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
var res = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Demo1.sample.mp3");
byte[] data = new byte[res.Length];
res.Read(data, 0, data.Length);
MemoryStream ms = new MemoryStream();
ms.Write(data, 0, data.Length);
ms.Position = 0;
ShoutcastMediaStreamSource ss = new ShoutcastMediaStreamSource(ms);
player.SetSource(ss);
}
my ShoutcastMediaStreamSource MenagedMediaHelpers. , ShoutcastMediaStreamSource debbuger, , OpenMediaAsync() , GetSampleAsync() MediaElement, , , ! , , . , GetSampleAsync() , ( ) 30 , . 10 . , , ().
- Silverlight -!. . .
http://timheuer.com/blog/archive/2010/08/16/download-and-store-media-for-playback-in-windows-phone-7-using-mediastreamsource.aspx
and there is a comment:
If Mp3MediaStreamSource is set as the source for MediaElement, then MediaElement does not play this file and does not detect errors in Windows Phone 7 sdk RTM version. In the preface, it worked, but not work with the Windows 7 sdk phone final release.
source
share