I want to control multiple videos with one custom control, i've created minimal repo here https://stackblitz.com/edit/ngx-plyr-cxla4q?file=src%2Fapp%2Fapp.component.html i've tried using querySelectorAll then listen to an event but not working. did anyone know how to do it?
EDIT
I have found the solutions, here's what i got
i change plyr tag to
<video controls crossorigin playsinline
data-poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg" class="js-player">
<!-- Video files -->
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4" type="video/mp4"
size="576" />
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4" type="video/mp4"
size="720" />
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4" type="video/mp4"
size="1080" />
</video>
then i initiate the player using this code
this.listPlayer = Plyr.setup('.js-player', { controls });
and then in play function i have this
play(): void {
this.listPlayer.map(
e => {
e.play();
e.config.muted = true;
e.config.volume = 0;
}
)
}
which solution is the best practices if u compare @yogen darji solution to mine?