0

I'm using osmf and I'm tring to stream over http a m4v file (osmf should support it) Instead of streaming it, it downloads the whole file and when it's done, it plays it. How can I make it stream it instead of downloading it?

My code is:

var resource:URLResource = new URLResource("http://path/to/file.m4v");
mediaFactory = new DefaultMediaFactory();
var element:MediaElement = mediaFactory.createMediaElement(resource);
player = new MediaPlayer(element);
container = new MediaContainer();
container.addMediaElement(element);
videoContainer.addChild(container);

I have tried instead of using the mediaFactory:

var videoElement:VideoElement =  new VideoElement(resource ,new HTTPStreamingNetLoader());

No success.

user1307863
  • 75
  • 1
  • 9
  • How are you generating your m4v file? If it is a elementary mpeg4 file then it is not streamable. – av501 Oct 15 '12 at 02:35

1 Answers1

0

To make mp4's playable immediately you need to hint it. Use MP4Box.

MP4Box -hint input_file

Google a bit about hinting to understand it better. The idea is that the header is put at the begining of the file.

av501
  • 6,645
  • 2
  • 23
  • 34