PDA

View Full Version : NetStream.pause Bug



snozbunny
February 6th, 2009, 03:40 PM
Hello everyone, :beer:

I am working on a video player application and I came across this odd problem with the play/pause/togglePause. I wanted to check if anyone else has seen it before.

If I check the time when I pause a NetStream then resume it the video will randomly start at a different time. It's almost identical but the number is off by -.0000004 or something incredibly close. I just noticed it when I was play/pausing and the scrubber would back up by a pixel before moving forward.

I haven't found any documentation on this yet. Let me know.

Anogar
February 6th, 2009, 03:56 PM
I'm pretty sure this has to do with the number of keyframes in your FLV. It's part of the compression process, you can keyframe every second, every X seconds, whatever... it has a big effect on the scrubbing, and also the play / pause behavior.

snozbunny
February 6th, 2009, 04:23 PM
I had that problem when I started and I thought it was too but what I've done is calculate the space left instead of what time the scrubber is at so it doesn't jump around when you click on the timeline. It's great except that's what brought out the bug.

I boiled the program down to just a NetStream, play/pause that sets a variable 'originalTime' and a timer that checks...

if (originalTime > NetStream.time) { trace(NetStream.time - originalTime); }

It doesn't happen 100% of the time but it does trigger on occasion.

You might be right, assuming the resume function doesn't just start from where it left off.