play audio from internet using AVAudioPlayer

Use AVPlayer to stream audio/video based on http url’s. It will work fine. AVAudioPlayer is for local files. Here’s the code NSURL *url = [NSURL URLWithString:url]; self.avAsset = [AVURLAsset URLAssetWithURL:url options:nil]; self.playerItem = [AVPlayerItem playerItemWithAsset:avAsset]; self.audioPlayer = [AVPlayer playerWithPlayerItem:playerItem]; [self.audioPlayer play];

XmlHttpRequest.responseText while loading (readyState==3) in Chrome

Chrome has a bug where it will only populate xhr.responseText after a certain number of bytes has been received. There are 2 ways to get around this, Set the content type of the return to “application/octet-stream” or Send a prelude of about 2kb to prep the handler. Either of these methods should make chrome populate … Read more

Video Streaming and Android

If you want to just have the OS play a video using the default player you would use an intent like this: String videoUrl = “insert url to video here”; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(videoUrl)); startActivity(i); However if you want to create a view yourself and stream video to it, one approach is to … Read more

WebAPI Request Streaming support

That’s an interesting question. I’ll try to do my best to give some general pointers. Few things to consider: 1) Web API by default buffers requests so your fear that the memory footprint might be considerable is definitely justified. You can force Web API to work with requests in a streamed mode: public class NoBufferPolicySelector … Read more

Live streaming through MP4

You may use fragmented MP4. A fragmented MP4 file is built a follows: moov [moof mdat]+ The moov box then only contains basic information about the tracks (how many, their type , codec initialization and so on) but no information about the samples in the track. The information about sample locations and sample sizes is … Read more

Media Source Api not working for a custom webm file (Chrome Version 23.0.1271.97 m)

The most likely problem is your WebM file has Clusters that don’t start with a keyframe. In Chrome dev-channel builds (ie Chrome 25 or later), you can verify this with the following steps. Open chrome:media-internals in another tab. Return to the tab with your test page and reload it. When the error occurs again, switch … Read more