Closed Yahav closed 1 year ago
You can change the volume by getting the internal Audio
element through player.audioElement
and getting / setting the volume there.
All of the audio output from IcecastMetadataPlayer
is routed through this Audio element, which is created internally by default, or it can be supplied on instantiation (see options)
const player = new IcecastMetadataPlayer("https://stream.example.com");
// get the volume
const myVolume = player.audioElement.volume;
// set the volume
player.audioElement.volume = .5;
Amazing, and this will work for all encoding methods?
So, as with any audio library i think a volume setter/getter is somewhat of a must. Is there anyway to implement this within this package? html5 audio and webaudio have this ability of course so its just a matter of writing adding it to the wrapper.