videogular2 icon indicating copy to clipboard operation
videogular2 copied to clipboard

Export dashjs reference

Open VagrantAI-c opened this issue 8 years ago • 9 comments

Export dashjs reference when using VgDash to access low level dashjs functionality

VagrantAI-c avatar Dec 22 '17 09:12 VagrantAI-c

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);
}

Elecash avatar Feb 12 '18 12:02 Elecash

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

Hesesses avatar Apr 12 '18 08:04 Hesesses

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

Elecash avatar Apr 12 '18 08:04 Elecash

I have added it:

"scripts": [
        "../node_modules/hls.js/dist/hls.min.js",
        "../node_modules/dashjs/dist/dash.all.min.js"
      ],

Hesesses avatar Apr 12 '18 14:04 Hesesses

@Hesesses Did you find out what the problem was?

aperonam avatar Jan 23 '19 20:01 aperonam

@Hesesses @Elecash I also have this problem,Cannot read property 'on' of undefined

l-hwen avatar Nov 23 '19 12:11 l-hwen

same problem, im trying to get source from vgHls and then change it to another

ricardo-bazan avatar Nov 25 '20 04:11 ricardo-bazan

i getting same error

vc-jaydeep avatar Jul 29 '21 08:07 vc-jaydeep

i also added script of hsl.min.js and dash.all.min.js

vc-jaydeep avatar Jul 29 '21 08:07 vc-jaydeep