Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
hi, I'm trying to play audios with vime player with angular
I can load a new url dynamically (using behaviorsubject), but i can't play it using player.play(), only with the play button of the player.
I can see the new audio source being loaded in the player (the time of the audio source in the player changes).
If I click on play button of the player, it plays the good one, but when I'm trying to play it with code, it only plays the first url I loaded at the beginning, and the player doesn't pass in play mode (the play button doesn't change, and the time indicator doesn't increase).
The url is passed through a subject and an observable.
Here is the angular code:
this.audioService.isPlayCalled$.subscribe(() => { this.player.play(); }); this.audioService.isPauseCalled$.subscribe(() => { this.player.pause(); }) this.audioService.isNewMusicSet$.subscribe(() => { this.audioService.getDataSource(); this.player.canAutoplay().then(canPlay => { if (canPlay) { console.log("New music to play: " + this.url); this.player.play(); } })
hi, I'm trying to play audios with vime player with angular I can load a new url dynamically (using behaviorsubject), but i can't play it using player.play(), only with the play button of the player. I can see the new audio source being loaded in the player (the time of the audio source in the player changes). If I click on play button of the player, it plays the good one, but when I'm trying to play it with code, it only plays the first url I loaded at the beginning, and the player doesn't pass in play mode (the play button doesn't change, and the time indicator doesn't increase). The url is passed through a subject and an observable. Here is the angular code:
this.audioService.isPlayCalled$.subscribe(() => { this.player.play(); }); this.audioService.isPauseCalled$.subscribe(() => { this.player.pause(); }) this.audioService.isNewMusicSet$.subscribe(() => { this.audioService.getDataSource(); this.player.canAutoplay().then(canPlay => { if (canPlay) { console.log("New music to play: " + this.url); this.player.play(); } })
and this is my html :
`<vm-player theme="light" style="--vm-player-theme: #7D3C98;"
player>
if anyone knows what i am doing wrong :/