D
D
Daniel2021-07-19 14:01:28
JavaScript
Daniel, 2021-07-19 14:01:28

Select a file (via input file), play it?

Hello! I need the user to select a file (via input file) and play it via JS:

<input type="file" onchange="file()">
<audio id="a">

function file() {
И тут сам код
}

How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexandroppolus, 2021-07-19
@Alexandroppolus

https://developer.mozilla.org/en-US/docs/Web/API/U...
pass the created url to audio
then don't forget revokeObjectURL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question