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 error thrown on representation switch when init segment has previously been cached #1873

Closed
davemevans opened this issue Apr 12, 2017 · 0 comments

Comments

@davemevans
Copy link
Contributor

Uncaught Error: 'type' is a reserved word for event dispatching
    at Object.trigger (EventBus.js:84)
    at appendToBuffer (BufferController.js:201)
    at Object.switchInitData (BufferController.js:163)
    at getNextFragment (ScheduleController.js:205)
    at schedule (ScheduleController.js:229)

This seems to have been caused by #1844, specifically by an error when triggering the new event VIDEO_CHUNK_RECEIVED.

The problem is that the second argument to trigger is modified by that function, so it is important that it is a new object containing the object to be passed, rather than the object itself. As it is implemented today, the chunk has a new attribute type added to it and is subsequently cached. When the chunk is retrieved and appended later, the call to trigger detects the reserved type attribute and throws an exception.

I'll issue a PR shortly.

dsparacio pushed a commit that referenced this issue Apr 13, 2017
Fix #1873 - supply correct args to trigger for VIDEO_CHUNK_RECEIVED
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

1 participant