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

Dispatch Flash events asynchronously #3700

Merged
merged 1 commit into from
Oct 26, 2016
Merged

Conversation

dmlap
Copy link
Member

@dmlap dmlap commented Oct 21, 2016

Description

Flash blocks until the javascript side of ExternalInterface callbacks complete and swallows any exceptions generated during that process. To avoid performance issues and missed exceptions, trigger events from Flash asynchronously.

// invokes
// - Flash is suspended until the javascript returns which may cause
// playback performance issues
setTimeout(function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use tech.setTimeout()? It's theoretically possible that the tech would be disposed in between onEvent getting called at the timeout running.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking.

// invokes
// - Flash is suspended until the javascript returns which may cause
// playback performance issues
setTimeout(function() {
Copy link
Member

@misteroneill misteroneill Oct 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor, but should this use window.setTimeout instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind. @gkatsev beat me to it. 😄

tech.trigger(eventName, Array.prototype.slice.call(arguments, 2));
const args = Array.prototype.slice.call(arguments, 2);

// dispatch Flash events after asynchronously for two reasons:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"after" should probably be removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

Flash blocks until the javascript side of ExternalInterface callbacks complete and swallows any exceptions generated during that process. To avoid performance issues and missed exceptions, trigger events from Flash asynchronously.
@dmlap dmlap merged commit f599ef4 into videojs:master Oct 26, 2016
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

Successfully merging this pull request may close these issues.

3 participants