OSMF Playing Event - actionscript-3

I am using OSMF and noticed when seeking almost immediately after, the "playing" event is fired causing my buffering icon to disappear almost instantly. The playing event is fired even though the video isn't actually playing. It takes a good 3-5 seconds before the video really begins playing. Has anyone heard of this?

Related

Getting player.on("ended") to work on more that 2 videos

I have been going around in circles with this so I have decided to ask for help.
I am trying to write a video based scenario that does the following.
video plays and at the end of the video a set of variables are changed and a new video is loaded.
I have set up the iframe and the first video plays fine. when the on ended event is triggered the actions are taken and the new video is loaded.
The problem arises when the second video as finished. The second video no longer triggers the on ended event.
Could anyone help me please?

AS3 NetStream lags on first frame

I'm developing an application in Adobe Air to display videos for a museum exhibit at a resolution of 2560x1440. The application works without a hitch on my machine, but when I run it on another (less powerful) computer, it does not function as intended. I've texted the application on two machines besides my own.
The problem is when one of the videos is called up, the video is called up and displays the first frame of the video and lags there for a good number of seconds (5-10), however I can still hear audio. After about 8-10 seconds, the video plays back as if it had been playing before and stutters briefly (1-2 seconds) before resuming playback normally. This is consistent behavior every time a video is launched as long as it's a fairly large video (> 50 MB as far as I can tell).
This does not happen on my development machine, which has a GTX 980 graphics card in it, but besides that and the motherboard, I can't think of any differences between the specs of the multiple machines.
The video throws an event indicating the buffer is full immediately as a video is launched, so buffering doesn't seem to be the issue.
Edit: Code (Pastebin)
Edit 2: Figured out it was the first frame, not a black screen
Still not entirely sure where the root of the problem lies, but what fixed it was adding this code right after calling the video. What it does is pause the playback and add a timer for one second, then seek 0.5 seconds into the video. I haven't run tests with this yet beyond getting past that first frame lag, but it works.
ns.pause();
var hesitate:Timer = new Timer(1000, 1);
hesitate.addEventListener(TimerEvent.TIMER_COMPLETE, function(e:TimerEvent)
{
ns.seek(0.5);
ns.resume();
});
hesitate.start();

How to detect putting in or taking out headphones pausing video in Flash using AS3?

I've noticed the sneakiest behavior playing video with NetStream. If the video has an audio track, and the headphones are plugged in to my machine or removed, the video pauses for a second, and then the audio starts playing from the new output.
However, there's no way to listen for this happening that I can find! Flash certainly doesn't allow access to the client machine's sound card, so we can't talk directly to the system about this. Also, I've tried listening for NetStatus events from the NetStream that could inform me that the stream is pausing and then resuming, but no events are dispatched.
Does anyone know of an event I can listen for to capture this input switch? I was thinking of using an Event.ENTER_FRAME event to check the fps of the video every frame, or the time property of NetStream, but that seems pretty hackish.
Any better ideas?
It's not netstream and not Flash Player, it's the device (sound card) pausing the sound during switching from headphones to speakers or vice-versa.

Sound from previous position playing before playback continues from specified position in html audio tag

I am making a HTML5/javascript browser game and I have problems with my audio.
I have all my clips in a single mp3 file to minmize the number of requests sent and when I want to play a clip I seek to the clips starting position (audio.currentTime = startTime) and play (audio.play()) when the audio tag fires the "seeked" event via an event listner.
When I pause playback I use the audio.pause() method.
The problem I have is that, before the sound I want to play starts, a split second of the file is played from where the audio was playing before the seek.
Anyone else that has encountered this problem?
Anyone know what to do about it?
If you're using Safari, this might be your problem.
Also, I'm finding that Web Audio API is looking more and more appealing (see my possible answer to my own question, haha)
Edit:
Lastly, if you want to stick with the whole HTML5 Audio object, this question might point you in a different direction.

Flash NetStream.Buffer.Flush firing repeatedly

I've made a custom video player in as3. Everything works, but once a video has loaded and played through completely, if the user replays the video it continuously fires the NetStream.Buffer.Flush event until the video stops playing again (by either ending or by the user hitting pause).
It doesn't seem to effect anything negatively, but I would rather not have an event continuously firing in the background like that.
I can't find any documentation of this happening online anywhere. Is this normal behavior for a NetStream that has fully loaded?
I believe I've fixed it, though I'm still not sure why it was repeatedly firing the flush event.
My custom videostream class was set to seek(0) once the video completed to rewind the current flv. It seems this was what was causing the issue. Instead of using seek(0), I just reset the source back to the original url, which reloads the video completely. Since the video is cached at that point, it reloads immediately so it's not an issue.