Play video only after its fully downloaded - actionscript-3

Flv seems like can't be use with loader but NetStream. But I wanted to play the video only after I have completely download it (smooth viewing with no buffering time). How can I do it with NetStream? And Can I have multiple video load at same time, and play it according to some array arrangement?

you can check if stream.bytesLoaded == stream.bytesTotal

Related

My MKV to MP4 converted video doesn't play in flex

I am stuck on one issue from last 1 day. I am using Adobe flex video display to play video for my site.
There is some converted video from MKV to MP4 using ffmpeg.
ffmpeg -i Test.mkv -vcodec copy -acodec copy Test.mp4
Now, i am trying to play that video from local it's working fine. But when i upload that video on server and trying to play video. Then it will not work with flex VideoDisplay same will work in browser and HTML videoplayer and also works with JWPlayer.
Other mp4 video which are not converted works very fine. Only converted Videos are not working in only flex VideoDisplay.
I am Just playing using.
<s:VideoDisplay id="videoDisp" autoPlay="false" autoDisplayFirstFrame="true" />
And give path to videoDisplay like:
videoDisp.source = Video_path;
My video file Video and Audio codec is as shown in below image:
Any help will be appreciate,
Thanks.
For my first tests, I saw an #2032 error, which is a stream error, and I think it's caused by the size of your video, because Flash player is trying to download the whole video before starting playing it, and I think there is a timeout or something like that which fire that error. So to avoid that, you can use qt-faststart to move metadata and offset information to the front of the file which will help to play it more quickly.
You can download that tool from here or if you are a fun of python you can try it from here. I will also upload a copy here for Win64.
Hope that can help.

Buffered audio in SoundJS

I'm using SoundJS 0.5.2 to play audio in a music player that I'm designing for a client.
According to the documentation, I have to register or preload an audio file before I can use it, by using the registerSound method of the Sound Class and the audio cannot be played before it is fully loaded.
But how I do I go about buffering the audio while it is being played? Like wait till 10% of the audio is buffered, then play the song? Can this be accomplished using PreloadJS ?
After Googling about it, I found this thread. It says that the WebAudioPlugin does not support buffering because of the underlying technology, but the HTMLAudioPlugin can play the audio before it is fully loaded.
But it does not mention how to do that. When using HTMLAudioPlugin, do I still have to register the sound using registerSound ?
Also, when using FlashPlugin as a fallback, will the buffering still be supported by FlashPlugin?
HTMLAudioPlugin fires the ready event when it receives the canplaythrough event from the audio tag, so it supports buffering by default (no setup required). You have to register sounds for them to start loading, either with PreloadJS or internal SoundJS methods. Buffering will work the same regardless.
Buffering is not supported by the FlashPlugin as far as I know.
Hope that helps.

How to force the NetStream to create a keyframe?

I created a video stream recording application that works fine except the recorded FLVs are corrupt a little bit. :) If I open an FLV in VLC player everything is green but getting "clean" when changes occur. And especially at the beginning of the video is breaking up. (I use Red5 1.0)
For pre-recorded streams, the keyframes are already encoded into the file and they cannot be changed. If you're serving a live stream, the keyframes need to be set in the application that is encoding the live stream (for example, Flash Media Live Encoder).

RTMP stream of a+v plays only audio, no video

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?
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!
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.

FLVPlayback won't seek when streaming from flash media server. How to fix?

I have a simple video player set up that streams from a flash media server. The video plays fine, but the majority of the seek commands send it back to the first frame of the video. If I don't use flash media server it will seek to any point which has already been loaded.
Any ideas what could cause this?
Try and download jw player from here http://www.longtailvideo.com/players/jw-flv-player/ and test if it works with that player. The problem could lay with the streaming server.
the majority of the seek commands send
it back to the first frame
What happens with the rest? - Do they work or does nothing happen?
The problem was I was checking the FLVPlayback playing property to see if I wanted to call play after the seek (The video didn't auto-play, and I wanted it to play if you seeked). The playing property however is set to false after a seek call till it is done seeking apparently. This resulted in play being called every time, which reset the playhead to the start.