Windows Phone 7 앱에서 라디오를 스트리밍하려고하는데이 경우 ManagedMediaHelpers
을 사용하고 있습니다. 연속 스트림을 가져 오는 HttpWebRequest
은 작동하지만 연속 스트림 때문에 콜백 URL을 호출하지 않습니다.액세스 스트림 버퍼 HttpWebRequest
콜백 URL의 도움없이 스트림에 어떻게 액세스합니까? 다른 게시물에 일부는 O가 리플렉션을 사용해야한다고 말했지만 누군가 그것을 반영하도록 열정적으로 알고 있습니까? 여기에 내 코드입니다 : - 당신이 실행하는 경우 있는지 확인 또한 당신의 URL에 문제가있을 수 있습니다
Getting bytes from continuous streams on Windows Phone 7
:
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);
});
}
실시간 라디오 스트림의 ContentLength는 얼마입니까? – AnthonyWJones
동의! 디버그에서 값이 -1이라는 것을 알았습니다. 그래서 어떤 아이디어 나 팁이 있습니까? 답장을 보내 주셔서 감사합니다! –