-
Notifications
You must be signed in to change notification settings - Fork 311
loadstart should fire during the resource selection algorithm #93
Conversation
Previously, loadstart and waiting fired once the video started playing. This is later than specced for loadstart and waiting doesn't even make sense. Move loadstart to the moment when we create the NetConnection which is closer to the desired behavior. Remove the waiting event from this flow.
@@ -402,6 +402,10 @@ package com.videojs.providers{ | |||
} | |||
|
|||
private function initNetConnection():void{ | |||
// the video element triggers loadstart as soon as the resource selection algorithm selects a source | |||
// this is somewhat later than that moment but relatively close | |||
ExternalInterface.call('console.trace'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this trace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops.
Get rid of console.trace()
Makes sense to me. |
Calling abort() on a source buffer resets the decoder buffers. Instead of relying on this happening implicitly through seeking, add a method so that media sources can trigger it directly.
|
||
public function abort():void{ | ||
// flush the netstream buffers | ||
_ns.seek(time); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should time
be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on whether the netstream requires an input value or not. We're basically forcing it to flush the buffers by calling seek to the current time. It's possible we could just call _ns.seek()
but having time
there shouldn't make a difference, really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetStream.seek requires an offset time as a parameter ( per API reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#seek() ). Buffer flushing is normalized as NetStream.seek(currentTime).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But where is time
defined? It's at least not clear from what I'm looking at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the time it's referring to, should it be _ns.seek(time())
then? Or do class property getters always execute? I really don't know action script...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This syntax is correct within actionscript when the originating function is explicitly set as a getter. Least that's how I remember it, it's been a while since I was in here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha, ok. ignore me then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, yeah, we had this problem also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think getters are a terrible language feature in general because they're so easy to abuse but when in Rome...
loadstart should fire during the resource selection algorithm
Previously, loadstart and waiting fired once the video started playing. This is later than specced for loadstart and waiting doesn't even make sense. Move loadstart to the moment when we create the NetConnection which is closer to the desired behavior. Remove the waiting event from this flow.