videogular / videogular2

The HTML5 video player for Angular 2
https://videogular.github.io/videogular2-showroom/#/
MIT License
670 stars 211 forks source link

this.api.playbackRate isn't setting default video playback rate #885

Closed ghost closed 4 years ago

ghost commented 4 years ago
smart-playlist.component.ts
(https://ibb.co/716BymL)
smart-playlist.component.html
(https://ibb.co/c6h4gpp)

using "this.api.playbackRate = 2;' doesn't initialize the player to have playback rate of 2 on player ready. I've also tried using @ViewChild() with VgPlaybackButton and calling updatePlaybackSpeed() with the same result.

ghost commented 4 years ago

I was able to resolve this by waiting for "playing" subscription as follows:

this.api.getDefaultMedia().subscriptions.playing.subscribe(() => { this.api.playbackRate = 2; });

marking as closed