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

Uncaught TypeError: Cannot read property 'msExtendedCode' of null #1494

Closed
abuisine opened this issue Jul 13, 2016 · 1 comment
Closed

Uncaught TypeError: Cannot read property 'msExtendedCode' of null #1494

abuisine opened this issue Jul 13, 2016 · 1 comment
Milestone

Comments

@abuisine
Copy link

  • Dash.js version: 2.2.0
  • Browser name/version:
    screen shot 2016-07-13 at 11 33 19
  • OS name/version: Android
Steps to reproduce
  1. Open content which is not correctly supported by the device
Observed behaviour

msExtendedCode should not be called on a non existing error object

Good management of a null error object at the beginning of the function
    function onPlaybackError(e) {
        var code = e.error ? e.error.code : 0;
        var msg = '';

        if (code === -1) {
            // not an error!
            return;
        }

        switch (code) {
            case 1:
                msg = 'MEDIA_ERR_ABORTED';
                break;
            case 2:
                msg = 'MEDIA_ERR_NETWORK';
                break;
            case 3:
                msg = 'MEDIA_ERR_DECODE';
                break;
            case 4:
                msg = 'MEDIA_ERR_SRC_NOT_SUPPORTED';
                break;
            case 5:
                msg = 'MEDIA_ERR_ENCRYPTED';
                break;
            default:
                msg = 'UNKNOWN';
                break;
        }

        hasMediaError = true;
Missing management of a null error object here
        if (e.error.msExtendedCode) {
            msg += ' (0x' + (e.error.msExtendedCode >>> 0).toString(16).toUpperCase() + ')';
        }
        log('Video Element Error: ' + msg);
        if (e.error) {
            log(e.error);
        }
        errHandler.mediaSourceError(msg);
        reset();
    }
@LloydW93
Copy link
Member

I thought I fixed this a while back, but looks like it got lost somewhere... I'll pick this up now.

LloydW93 pushed a commit to bbc/dash.js that referenced this issue Jul 13, 2016
LloydW93 pushed a commit to bbc/dash.js that referenced this issue Jul 13, 2016
davemevans pushed a commit that referenced this issue Jul 13, 2016
@LloydW93 LloydW93 added this to the v2.3.0 milestone Jul 13, 2016
forbesjo pushed a commit to forbesjo/dash.js that referenced this issue Jul 21, 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

No branches or pull requests

2 participants