[QUESTION] Load experimental features from CDN
Hi 👋 I have a question about features that are not included in the base minified RxPlayer build, basically I load RxPlayer from private cdn but it doesn't include features like metaplaylist, dash wasm etc. Is there some way to have those features separated as e.g. modules/packages that I can load them additionally from cdn?
Hi,
I've PoCed the possibility of making individual features bundles, but there's some drawbacks and maintenance complexities in doing that on our side.
You're in a case where you have no bundler in your applications? Just bundling a single file like:
import { MULTI_THREAD } from "rx-player/experimental/features";
RxPlayer.addFeatures([MULTI_THREAD]);
Assuming that RxPlayer is here available in global scope, should allow to add the corresponding feature.
Also as you wrote about it, do you use the METAPLAYLIST feature?
We're currently wondering how we could make some evolutions with it (or even replace it by something better), so it would be interesting to have a usage example if you do use it.
About METAPLAYLIST, so far we want to integrate it, because we have some ideas about streaming experience improvements. And here comes some ideas:
-
First, we have something like separate video intro feature that so far we load it separately before the main stream starts. I've used your function for structure of metaplaylist generation
createMetaplaylist, first of all we switched video intro stream type from mp4 to DASH :D Main stream is DRM Dash, so I've created proper keys for access logic and used metaplaylist for it. It seems to work, but not everything, there are no subtitles(they are not working with metaplaylist).textTrackModeishtmland I passtextTrackElement🤔 -
For CSAI ads, we have CVP(custom vast parser), so I've created custom logic for VAST parsing and some ads management system to play ads, mostly it was done due CTV requirements, for old TV's and devices where only one video element is allowed in DOM. The player core engine for that is selectable and one from it is RxPlayer and if here we will use
METAPLAYLISTthen we can reduce unnecessary ads stream loads and create something more like one ad break stream. So far I cannot do that on my side, because ads are provided asmp4in VAST XD But soon they want to switch to DASH ;) -
SGAI, we have small steps in that direction XD I wonder if we can use
METAPLAYLISTfor this 🤔 Case for us is to add dynamically ads while live stream is playing, so far we have lowest priority for this. -
Point 1 and 2 as one
METAPLAYLIST, I wonder how it will works and what performance will be there if all are merged ;) I assume CSAI will change to something like SSAI :D
About bundler, it is more like I would like to generate minified experimental file e.g. MULTI_THREAD and put it in cdn 🤔 Then according to passed config download it and add to features in Rx.
There is some kind of possibility to build minified file like that in Rx Player project? That I could e.g. download rx player project directly with selected version, by command generate that file, put in our CDN, then request for that file script and add feature with it in RX player?
What I did is fork the repo and make the changes (expose the experimental feature) and create my own customized bundle file.
Hi @KunXi-Fox,
If you're doing a bundle, it may not be a mandatory step to fork, or maybe you rely on the RxPlayer's bundler setup also so you don't have one to set?
You could just set-up a supplementary layer with e.g. esbuild as a bundler, the rx-player as a dependency in your package.json and the following js file to bundle:
import RxPlayer from "rx-player";
import { MULTI_THREAD } from "rx-player/experimental/features";
RxPlayer.addFeatures([MULTI_THREAD]);
export default RxPlayer;
Hi @KunXi-Fox,
If you're doing a bundle, it may not be a mandatory step to fork, or maybe you rely on the RxPlayer's bundler setup also so you don't have one to set?
You could just set-up a supplementary layer with e.g.
esbuildas a bundler, therx-playeras a dependency in yourpackage.jsonand the following js file to bundle:import RxPlayer from "rx-player"; import { MULTI_THREAD } from "rx-player/experimental/features"; RxPlayer.addFeatures([MULTI_THREAD]);
export default RxPlayer;
Yeah, that could also works. But we have some extra requirements not only to expose experimental feature to bundle file, but also need to keep es5 build for some legacy CTV devices. So fork the repo and make the changes seems more easier.