Access Stream Buffer HttpWebRequest

I am trying to transfer a radio to a Windows Phone 7 application, and for this I am using ManagedMediaHelpers . HttpWebRequest to receive a continuous stream works, but does not call the callback URL due to the continuous stream.

How do I access a stream without using a callback url? On other posts, some said that O needs to use reflection, but does anyone know that it needs to be implemented? Here is my code:

 req = (HttpWebRequest) WebRequest.Create( "http://streamer-dtc-aa01.somafm.com:80/stream/1018"); // if this is false it will fire up the callback Url // but the mediastreamsource will throw an exception // saying the it needs to be true req.AllowReadStreamBuffering = true; IAsyncResult result = req.BeginGetResponse(RequestComplete,null); private void RequestComplete(IAsyncResult r) { HttpWebResponse resp = req.EndGetResponse(r) as HttpWebResponse; Stream str = resp.GetResponseStream(); mss = new Mp3MediaStreamSource(str, resp.ContentLength); Deployment.Current.Dispatcher.BeginInvoke(() => { this.me.Volume = 100; this.me.SetSource(mss); }); } 
+7
source share
1 answer

Had the same problem, here is how I solved it:

Getting bytes from continuous streams on Windows Phone 7

There may also be a problem with your URL - make sure that when you start the request outside the application, you get the required amount of data.

+1
source

All Articles