The JavaScript Api allows users to embed a chromeless live stream player via JavaScript.
The player UI interface and skinning can be done in HTML/CSS.
Note: Ads (preroll & synced banners) are not supported in HTML5 in the current version of the API.
On iOS / Android devices, the audio level is always under the user’s physical control. The volume property is not settable in JavaScript.
Choose the platformid:
Loading...
Now Playing:
Module | Action | Method (example) |
---|---|---|
MediaPlayer |
player.play('KMTTFM', 'hdAlternate', 60, true) Play KMTTFM station with hdAlternate connection strategy, timeout after 60 minutes, with time-shifting enabled. |
|
MediaPlayer |
player.stop() Stop the live stream |
|
MediaPlayer |
player.pause() Pause the live stream (time-shifting) |
|
MediaPlayer |
player.resume() Resume the live stream (time-shifting) |
|
MediaPlayer |
player.seekLive() Back to live stream (time-shifting) |
|
MediaPlayer |
player.setVolume(.5)
|
|
MediaPlayer |
player.mute()
|
|
MediaPlayer |
player.unMute()
|
|
MediaPlayer |
Warning!The plugin 'vastAd' is required in the MediaPlayer plugins configuration |
|
MediaPlayer |
Warning!The plugin 'vastAd' is required in the MediaPlayer plugins configuration |
|
MediaPlayer |
Warning!The plugin 'bloom' is required in the MediaPlayer plugins configuration |
|
MediaPlayer |
Warning!The plugin 'mediaAd' is required in the MediaPlayer plugins configuration |
|
MediaPlayer |
player.skipAd()
|
|
NowPlayingApi |
player.NowPlayingApi.load({ mount:'KMTTFM', hd:true, numberToFetch:10 })
|
|
PlayerWebAdmin |
player.PlayerWebAdmin.load(mount, streamid)
|
|
Npe |
Warning!To retrieve the Npe metadata when receiving a new song (event 'track-cue-point'), call this function in the Npe module:player.Npe.loadNpeMetadata( cuePoint.nowplayingURL )
|
|
Npe |
player.Npe.fetchBiography( npeId )
|
|
Npe |
player.Npe.fetchArtist( npeId )
|
|
Npe |
player.Npe.fetchAlbum( npeId )
|
|
Npe |
player.Npe.fetchDiscography( npeId )
|
|
Npe |
player.Npe.fetchPhotos( npeId )
|