I need to get the same media that is loaded in a HTML5 media player into an AudioContext. Can I somehow grab it from the media player (or do I have to download it again)?
Note: The media player does not have to be playing, but I know that all of the media has been loaded.
To get the same file, you'd need to fetch it again (using fetch
or XHR), but if your server is well configured, you may not need to download it again no, it should be cached.
Note that if you need to connect your HTMLMediaElement to the AudioContext (so that its audio output goes through the AudioContext's graph), then you can use either HTMLMediaElement.captureStream()
+ AudioContext.createMediaStreamSource()
, or AudioContext.createMediaElementSource()
.