Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Extra details on media errors from a
Tech
component are lost when propagated to thePlayer
instance. For example, custom error messages are lost and always use the default message based on the error's code.Demonstration
This example on JSBin registers a dummy
MyTech
tech. In itsplay()
function, it immediately callserror()
with a custom error object:Expected behavior
The player shows an error with the message: "Custom error message"
Actual behavior
The player shows an error with the default message for this media error code: "The media could not be loaded, either because the server or network failed or because the format is not supported."
Specific Changes proposed
Player.handleTechError_
is changed to pass the wholeerror
object toPlayer.error
, instead of only passingerror.code
. This ensures that additional details (such as error messages) are retained.Requirements Checklist