Question

I'm working on a project where we're trying to play video in Flash, by putting the NetStream in data generation mode and appending bytes. This works fine for FLVs, but I need to support other file formats, such as mp4. I want to either support the file without changes or somehow wrap the file on the fly in the flash client.

I know there are ways to stream files via RTMP, HTTP streaming, etc, but I'm trying to do all server less at the moment. I'm confused as to why the NetStream object can handle multiple file formats when just calling .play(file), but when you want to use .play(null) and feed in the bytes, only FLVs seem to work.

Any ideas on how I might achieve these? Please let me know if I need to be more clear in anyway.

Était-ce utile?

La solution

A NetStream in Data Generation Mode only supports FLV formatted data. It is possible to support other data formats but you have to manually modify the bytes to conform to the FLV format.

It's a huge pain and takes quite a bit of time, but it's certainly possible to implement. I've done it several times for several different projects.

Here is an example that I've used to play TS files via NetStream: https://github.com/nweber/hls-as/blob/master/hlsPluginLib/src/at/matthew/httpstreaming/HTTPStreamingMP2PESVideo.as (Not code I wrote; taken from another open source project and updated to OSMF 2.0)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top