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

Added try/catch to protect against IE with no Media Player. Fixes #984 #1060

Merged
merged 2 commits into from
Mar 6, 2014

Conversation

heff
Copy link
Member

@heff heff commented Mar 5, 2014

No description provided.

if (typeof el.load === 'function') {
el.load();
try {
Copy link
Member

Choose a reason for hiding this comment

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

Can we wrap this in a function to make sure that disposeMediaElement isn't deoptimized by js engines for having a try/catch?

Copy link
Member Author

Choose a reason for hiding this comment

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

What would that look like?

Copy link
Member

Choose a reason for hiding this comment

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

Um... either as just an IIFE or a whole separate function we call here. An IIFE is probably good.

if (typeof el.load === 'function') {
  (function() {
    try {
      el.load();
    } catch (e) {
      // not supported
    }
  })();
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yeah, I was thinking about the isSupported one. And I'm guessing it's not worth doing the same there, yeah?

I'll add this in. What would the negative affects be of deoptimization? Just slower processing?

Copy link
Member

Choose a reason for hiding this comment

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

De-optimized code runs in the js interpreter so it's significantly slower.

@heff heff merged commit e4b269e into stable Mar 6, 2014
@mmcc mmcc deleted the patch/ie9-no-media branch February 26, 2015 00:19
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.

2 participants