videogular / videogular2

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

fix(vgControls): Track playing state of media specified in vgFor #743

Open kwarismian opened 6 years ago

kwarismian commented 6 years ago

vgControls can set vgFor to track play/pause/ads for play and pause checking of control hiding, but by checking this.API in the hideAsync function a project without vgMaster set can end up checking the state of a different media than the one bound to vgControls, which could be sitting in a pause state while the media bound to the controls is happily in a playing state. This change sets this.target to always have a media binding so that the controls are either controlling the one found in vgFor or the default media of the API (meaning this adds specificity without changing the previous result of getting state values from the default media object).

Tests have been updated to include a vgMedia object for the new binding.

716