Fixes so that the source handler mixin adds the expected API after minification #2348
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.
Issue:
In video.js, the
withSourceHandlers
mixin was getting all the names of the functions it used in the SourceHandlers (canHandleSource
,handleSource
, anddispose
) mangled by Closure Compiler.As a result, it worked only with native source handlers that were compiled together with video.js but not any source handler that was registered later.
In addition, the
nativeSourceHandler
property was also mangled which meant that any Techs not compiled with video.js would not be able to fall-back to theirnativeSourceHandler
as a last ditch attempt to play the source if no SourceHandler was found that matched the type.Finally, the tests were written expecting any SourceHandlers that were registered to use the same mangling as video.js instead of testing that the SourceHandler interface worked as expected.
Changes:
Source
registerSourceHandler
since it is properly mixed-in unmangledcanHandleSource
,dispose
, andhandleSource
explicitly instead of by their mangled namesnativeSourceHandler
property is no longer mangled in the code and is called explicitly unmangledTests
withSourceHandlers
andregisterSourceHandler
are used explicitly instead of using the mangled namescanHandleSource
andhandleSource
are quoted to avoid mangling