Export dashjs reference
Export dashjs reference when using VgDash to access low level dashjs functionality
Actually you can access to the Dash reference with.
@ViewChild(VgDASH) vgDash: VgDASH;
onPlayerReady(api:VgAPI) {
this.api = api;
console.log(this.vgDash.dash);
}
This works too for HLS.
@ViewChild(VgHLS) vgHls: VgHLS;
onPlayerReady(api:VgAPI) {
this.api = api;
console.log(this.vgHls.hls);
}
ERROR ReferenceError: VgHLS is not defined
if I add:
import {VgHLS} from "videogular2/src/streaming/vg-hls/vg-hls";
@ViewChild(VgHLS) vgHls: VgHLS;
onPlayerReady(api:VgAPI) {
this.api = api;
console.log(this.vgHls.hls);
}
ERROR TypeError: Cannot read property 'hls' of undefined
You must add the hls.js library to the .angular-cli.json as explained in the docs here:
http://videogular.github.io/videogular2/docs/modules/streaming/vg-hls/
You can check the demo code here: https://github.com/videogular/videogular2-showroom
I have added it:
"scripts": [
"../node_modules/hls.js/dist/hls.min.js",
"../node_modules/dashjs/dist/dash.all.min.js"
],
@Hesesses Did you find out what the problem was?
@Hesesses @Elecash I also have this problem,Cannot read property 'on' of undefined
same problem, im trying to get source from vgHls and then change it to another
i getting same error
i also added script of hsl.min.js and dash.all.min.js