Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flash: Extra timeupdate event after ended event #723

Closed
svoynow opened this issue Jan 18, 2013 · 0 comments
Closed

Flash: Extra timeupdate event after ended event #723

svoynow opened this issue Jan 18, 2013 · 0 comments

Comments

@svoynow
Copy link
Contributor

svoynow commented Jan 18, 2013

The flash player seems to send an extra timeupdate event after the ended event. This is causing confusion for the javascript that's driving the player in my case. In any case, this seems incorrect (and doesn't match the behavior of the HTML5 player).
As far as I can tell the issue is this.
The 'ended' event listener in the mediaelement-and-player.js calls setCurrentTime(0) which calls setCurrentTime(0) on the plugin. The setCurrentTime function in VideoElement.as does the following:

            sendEvent(HtmlMediaEvent.SEEKING);
            _stream.seek(pos);
            sendEvent(HtmlMediaEvent.TIMEUPDATE);

Which is the right behavior in most cases, but seems wrong after the video has ended.
Furthermore, the stream.time turns out to be incorrect in the timeupdate event because of the asynchronous nature of NetStream.seek

A fix that would work for my case would be to check before sending the timeupdate:

if(!_isEnded) {
    sendEvent(HtmlMediaEvent.TIMEUPDATE);
}

I'm not sure if I'm missing some case where that would cause the wrong behavior.

I'll submit a pull request for folks to look at / comment on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants