- Centova Cast - Client Usage Guide
- Centova Cast - Client Reference Manual
Stream Details
About the Widget
The Stream Details widget shows separate items of information about your stream. Each item is its own HTML element. You can put each element anywhere on your web page, and you can use any combination of the elements. Centova Cast fills in each element and updates it in real time.
If the widget code names no mount point, the widget shows the mount point /stream. To show a different mount point,
select it in the Mount Point box of the Widgets page before you copy the code.
The Stream Status Summary widget uses the same script. If you use both widgets on one page, put the script code on the page only once.
Available Elements
Each element has the class cc_streaminfo. The data-type attribute of the element selects the information that
the element shows. The widget code on the Widgets page contains one example of each element, with a label in front
of it. You can delete the elements that you do not need, and you can change or delete the labels.
Current song (
data-type="song")
Shows the title information that your autoDJ or your live source sends, for exampleArtist Name - Track Title. If no source is connected, the element showsNone. In the widget code, this element is a link to the tune-in URL of your stream. A visitor can click it to tune in.Stream title (
data-type="title")
Shows the title of the stream. If the stream has no title, the element showsNone.Bit rate (
data-type="bitrate")
Shows the bit rate of the stream, in kilobits per second.Current listeners (
data-type="listeners")
Shows the number of listeners who are tuned in to the mount point now.Maximum listeners (
data-type="maxlisteners")
Shows the maximum number of listeners that the mount point accepts.Server status (
data-type="server")
ShowsOnlineif the streaming server runs, orOfflineif it does not run.AutoDJ status (
data-type="autodj")
ShowsOnlineif the autoDJ supplies the stream now, orOfflineif it does not.Source connected (
data-type="source")
ShowsOnlineif a source is connected to the mount point, orOfflineif no source is connected. The source can be the autoDJ or a live source.Station time (
data-type="date"anddata-type="time")
Shows the date and the time at which the current track started. If the start time is not known, the elements show the current date and time. The visitor's web browser formats the date and the time, in the time zone and the language of the visitor's computer.Current playlist (
data-type="trackplaylist")
Shows the name of the autoDJ playlist that the current track comes from. If the track comes from no playlist, the element shows-.Track details (
data-type="trackartist",data-type="tracktitle"anddata-type="trackalbum")
Show the artist, the title and the album of the current track, each in its own element. If an item is not known, its element showsNone.Raw metadata (
data-type="rawmeta")
Shows the title information exactly as the source sends it. Unlike Current song, this element does not showNonewhen no source is connected.Album image (
data-type="trackimageurl")
Shows the album cover of the current track. This element must be an<img>tag. If the cover is not available in the large size, the widget uses the nearest available size. If no cover is available, the widget shows a transparent image.Buy this album (
data-type="trackbuyurl")
Links to the album URL of the current track. This element must be an<a>tag. If the track has no album URL, the link points to#.
Note that the listener counts are available only if the Publish listener counts setting is Yes. If the setting
is No, the Current listeners and Maximum listeners elements show 0. For more
information, see the Widgets section of the configuration settings.
Below the code, the widget box shows the Also available as links. These links give the same stream information as
a JSON document or an XML document. A program on your web site can read these documents.
Advanced Customization
Configurable Options
The advanced code sets these options:
setVisibility
Controls whether the widget hides the Buy this album element when the current track has no album URL. The option also hides the Album image element when the current track has no album cover. Iffalse, the elements stay visible, and the Buy this album element links to#. The default isfalse.useEffects
Controls whether the widget fades out the old text and fades in the new text when the information changes. The default istrue.
Example:
<script type="text/javascript">
(function(){ (window.$CC||(window.$CC={})).streaminfo = {
setVisibility: true,
useEffects: true,
};})();
</script>
CSS
The widget code is plain HTML. You can add your own class names or id attributes to the elements and address them
with CSS. The widget itself uses these classes:
/* each element that shows stream information */
.cc_streaminfo {
}
/* added for 0.3 seconds while the text fades out, if useEffects is true */
.cc_streaminfo.fade-out {
}