This component was made to be an offline radio player with randomize play. Create your own radio station with commercials, blurbs, and talks.
add "radio-player" element in your HTML
ready your audio files array in this format:
audArray = [
{
intro:string | string[]
music:string | string[]
sequence?:string | any[]
outro?:string | string[]
}
]
load the audios
let radio = document.getElementsByTagName("radio-player")[0]
radio.loadStations(stations)
ready your events array in this format:
radioEvents = {
onready:()=>{},
onwait:()=>{},
onpause:()=>{},
onend:()=>{},
onplay:(e)=>{},
ontimeupdate:(e)=>{},
}
load the audios and events
let radio = document.getElementsByTagName("radio-player")[0]
radio.loadStations(stations,events)
let's say you only want "sample.mp3" to play with filter "christmas"
you may use "sample.mp3?cond=christmas"
and add "christmas" to filter array:
let radio = document.getElementsByTagName("radio-player")[0]
radio.filter = ["christmas"]
you may use sample.mp3?gain=3.232
you may use a built in normalizeFinder index.html in @theracerx/custom-audionormalizer-module located in your node_modules
you may add custom buttons by using elements with the following className inside the radio-player element
- "nextStation" (input recommended)
- "prevStation" (input recommended)
- "stationName" (h3 or p recommended)
- "stationVolume" (input type="range" recommended)
- "muteStation" (input recommended)