How to change audio url dynamically?
See original GitHub issueHi there,
How can I change my audio source dynamically? I have a player and select, select contains the information of the files, When the user selects the file, I want to change the URL of the player.
@angular/core: "^10.0.10"
@vime/angular: "^5.0.27"
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
change <audio> src with javascript - html - Stack Overflow
Try this snippet. list.onclick = function(e) { e.preventDefault(); var elm = e.target; var audio = document.getElementById('audio'); var ...
Read more >HTML DOM Audio src Property - W3Schools
The src property sets or returns the value of the src attribute of an audio. The src attribute specifies the location (URL) of...
Read more >HTML Audio Player with Dynamic URL from Data Collection
Is there a way to create an HTML Component audio player on a dynamic page that plays an audio file from a URL...
Read more >Video and Audio APIs - Learn web development | MDN
You can solve both these problems by hiding the native controls (by removing the controls attribute), and programming your own with HTML, CSS, ......
Read more >How to play audio and dynamically change src
i then open chrome, navigate to “localhost:5006”, open the javascript console, click on Elements, and examine the DOM of the audio HTML tag....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Why a library supposedly made to play video and audio do not offer the option of changing the track? Is not the most common thing in the world? Previous / Forward buttons… Have you ever seen a media player without them? I don’t understand this.
Hey ! Just bind URL on
[attr.data-src]from<source>element.In my app :
currentAudio$is an observable (from a BehaviorSubject in my case) which emits an object which contains an audio url (audioLink). I have a page where I can choose which sound I want to listen. Each of them contains a play button which next the audio object atfer a click.