views:

387

answers:

3

In Flash, AS3, I am using NetConnection to connect to a RTMP server, then I use NetStream to play a video+audio stream.

I attach the stream (attachNetStream) to a flash.media.Video instance that is added to stage (double checked that it is ON the stage) and play it, but all I get is the sound of the stream that's being played - no video is displayed.

Note that even though I cannot see the video, when I listen to the onMetaData of the stream I can get plenty of information about the video such as width, height, FPS (changes during playback as if a video is shown), number of decoded frames.

Does anybody have an idea how can I make the video work too?

A: 

Instead of using "raw" NetConnection and NetStream and attach it to a flash.media.Video, I'd recommend using some wrapper such as Pyro Player. Its basically a video API and I've used it many times for RTMP video and it works like a charm (I've always found the Video component from Adobe very buggy, specially when displaying video from a RTMP server). Give it a try!

danii
A: 

thanks dannii for the Pyro Player, but even this isnt working for me with streaming video gahhh its so fustrating that streaming video isnt well documented in Flash. it should be easy, why is it not easier!! ive picked up little hints and tips around the net. i think JW player are systematically making it harder to build your own, so everyone uses theres :)

daidai
A: 

Thank you guys! but I found out the answer:

Apparently Flash's (CS3) built-in Video class does not support H.264 streams. I tried to compile the exact same code in Flex 3.5 and everything worked!

There is a possibility that CS4 also supports H.264 streams. I did not try.

JWPlayer is great, I did not try Pyro.

Cheers.

webwise