Demo: Only include DASH_WASM parser when explicitly asked for #1584
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.
In our demo, we have specific scripts to start that demo with our WebAssembly MPD parser, the
DASH_WASM
feature.What those do is to set a
__INCLUDE_WASM_PARSER__
boolean totrue
in global scope, which signals to the demo page that it should include theDASH_WASM
feature and load the corresponding WebAssembly file.However I noticed that when enabling "multithreading" mode in our demo page, it tried to download the WebAssembly MPD parser regardless of the
__INCLUDE_WASM_PARSER__
boolean.This made sense pre-
v4.1.0
when we only relied on the WebAssembly parser to parse a DASH MPD in "multithreading" mode. But now that we also have a JS parser embedded inside our worker code, it seems unnecessary.It also led to some http 404 when testing the demo locally without having built the WebAssembly file. Those don't matter much though because the RxPlayer automatically fallbacks to the JS parser.
Also, the demo built on our GitHub pages accessible on https://developers.canal-plus.com/rx-player/ do have the WebAssembly MPD parser file built. This means that when enabling the "multithreading" mode on that demo, we're actually loading and using that WebAssembly file to parse MPDs.
Doing the change I'm proposing here of only using the WebAssembly parser if
__INCLUDE_WASM_PARSER__
is set totrue
will thus lead to a small change in the globally-accessible demo page, where we will be using the default JS parser instead in "multithreading" mode.We could also in the future add a checkbox in our demo specifically for the inclusion or not of the WebAssembly parser.