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

Console error due to reading field from null #3787

Closed
lamflam opened this issue Oct 13, 2021 · 5 comments
Closed

Console error due to reading field from null #3787

lamflam opened this issue Oct 13, 2021 · 5 comments
Assignees
Labels
Milestone

Comments

@lamflam
Copy link

lamflam commented Oct 13, 2021

Environment
  • Link to playable MPD file: N/A
  • Dash.js version: 4.1.0
  • Browser name/version: Chrome Version 94.0.4606.81 (Official Build) (x86_64)
  • OS name/version: Mac OS/X
Steps to reproduce
  1. Please provide clear steps to reproduce your problem
  2. If the bug is intermittent, give a rough frequency if possible
Observed behavior

The player works, but seeing errors in the console.

Console output
Uncaught TypeError: Cannot read properties of null (reading 'end')
Expected behavior

This shouldn't error.

On this line, DVRWindow.end is used but two lines above it can explicitly be set to null. I'm not sure what the expected behavior here is exactly (whether or not null is truly valid) but if so the seek should probably be made conditional on DVRWindow having a value.

const DVRWindow = DVRMetrics ? DVRMetrics.range : null;
seek(DVRWindow.end - mediaPlayerModel.getLiveDelay(), true, false);

@lamflam lamflam added the Bug label Oct 13, 2021
@dsilhavy
Copy link
Collaborator

@lamflam Thanks for pointing this out. I am curious how you were able to to trigger this error. Are you playing in low latency mode? Can you share the structure of your MPD, for instance is there a timeShiftBufferDepth parameter? Any specific settings you are using?

@dsilhavy dsilhavy added this to the 4.1.1 milestone Oct 14, 2021
@dsilhavy dsilhavy self-assigned this Oct 14, 2021
@dsilhavy
Copy link
Collaborator

Issue is addressed in #3789

@lamflam
Copy link
Author

lamflam commented Oct 14, 2021

Awesome, thanks @dsilhavy!

Yes I am using low latency mode, here are my settings:

{
    streaming: {
        lowLatencyEnabled: true,
        delay: {
            liveDelay: 1.5,
        },
        liveCatchup: {
            enabled: true,
            playbackBufferMin: 0.5,
            mode: 'liveCatchupModeLoLP',
            minDrift: 0.05,
            playbackRate: 0.2,
            latencyThreshold: 30,
        },
    },
}

It actually only seemed to happen when I switch from the one stream to another, never on the first attempt to play a stream. When switching streams, I call reset() on the MediaPlayer and then call initialize() again with the new stream details to start playback. Everything works very well, I just happened to notice the error in the console and when I dug in I noticed that the explicit null reference.

Thanks again for the quick fix! dash.js is an incredible tool :)

@lamflam
Copy link
Author

lamflam commented Oct 14, 2021

Also, should I close this or do you generally keep it open until it makes it into a public release?

@dsilhavy
Copy link
Collaborator

@lamflam Thanks for the feedback, probably the function is called while the switch to the next stream is performed. Please close this issue then, the fix will be part of the next release 4.1.1

@lamflam lamflam closed this as completed Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants