windows phone 7 - WP7 Shoutcast with MediaStreamSource -


i trying implement shoutcast streaming mediaelement via mediastreamsource. here code basics. readdata method can download raw audio data (mp3 samples), question how can set stream mediastreamsource. in way doesn't work (it compiles , there no errors on mediafailed event can't hear sound). maybe should implement of these in custom shoutcastmediastreamsource? there no problem fixed stream, non-fixed. can give me advice?

on wp7 there no possibility set "useunsafeheaderparsing" can't http headers shoutcast metadata - raw data. in shoutcastmediastreamsource have implemented code of managedmediahelpers.

thanks

    private void phoneapplicationpage_loaded(object sender, routedeventargs e)     {         httpwebrequest request = (httpwebrequest)webrequest.create("http://radiozetmp3-02.eurozet.pl:8400/;");          request.method = "get";         request.headers["icy-metadata"] = "1";         request.useragent = "winampmpeg/5.09";         request.allowreadstreambuffering = false;          request.begingetresponse(new asynccallback(requestcomplete), request);         alldone.waitone();          shoutcastmediastreamsource smss = new shoutcastmediastreamsource(stream);         player.setsource(smss); // mediaelement         player.play();     }      public void requestcomplete(iasyncresult r)     {         httpwebrequest request = (httpwebrequest)r.asyncstate;         httpwebresponse response = request.endgetresponse(r) httpwebresponse;         stream = response.getresponsestream();          iasyncresult res = stream.beginread(buffer, 0, buffer.length, callback, null);          alldone.set();     }      public void readdata(iasyncresult r)     {         int bytes = stream.endread(r);          if (bytes == 0) { debug.writeline("no bytes readed"); }         else         {             debug.writeline("readed: " + buffer.length.tostring());             stream.beginread(buffer, 0, buffer.length, callback, buffer);         }     } 

you need develop custom mediastreamsource.

you can find prototype of 1 developed 1 of projects here: https://skydrive.live.com/redir.aspx?cid=eb0868f2135b874c&resid=eb0868f2135b874c!1037&parid=eb0868f2135b874c!169&authkey=!agsyfcvvcasgari


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -