- Centova Cast - Client Usage Guide
- Centova Cast - Client Reference Manual
Web Player
About the Widget
The Web Player widget puts an audio player for your stream on your web page. Visitors can listen to your stream in the web browser, without a separate media player.
The player has these controls:
- The play button, which starts and stops playback.
- A progress bar, which shows the progress of the current track if its length is known. For a file, the visitor can also use the bar to seek.
- A volume slider.
- A caption below the volume slider. By default, the caption is the title of your stream.
The player selects the stream format automatically. It uses the best format that the web browser of the visitor can play, from the formats that your streaming server supplies.
If the widget code names no mount point, the player plays the mount point /stream. To play a different mount point,
select it in the Mount Point box of the Widgets page before you copy the code.
The On-demand Content widget also uses the Web Player widget to play files. For more information, see the On-demand Content section.
Widget Code
The anchor code is a <div> element with the class cc_player. Before the widget loads, the element shows the text
Loading ....
The widget box has four option buttons. Each button changes one option in the advanced code:
Toggle seek bar
Changes theshowSeekoption.Toggle volume
Changes theshowVolumeoption.Toggle caption
Changes theshowCaptionoption.Toggle track details
Changes theshowTrackoption.
Advanced Customization
Configurable Options
The advanced code sets these options:
autoplay
Controls whether the player starts to play when the page loads. Note that most web browsers block automatic playback until the visitor interacts with the page. The default isfalse.showSeek
Controls whether the player shows the progress bar. For a file, the visitor can use the bar to seek. For a stream, the bar shows the progress of the current track, if the length of the track is known. The default istrue.showSeekTimes
Controls whether the player shows the elapsed time and the total time below the progress bar. The default istrue.showTime
Controls whether the player shows the elapsed time in place of the progress bar. This option has an effect only ifshowSeekisfalse. The default isfalse.showVolume
Controls whether the player shows the volume slider. The default istrue.showCaption
Controls whether the player shows the caption below the volume slider. The default istrue.caption
Specifies the text of the caption. If the value is empty, the caption is the title of your stream. The default is empty.showTrack
Controls whether the player shows the album cover, the title, the artist and the album of the current track above the controls. The default isfalse.source
Specifies a different audio source for the player. Ifurlis empty, the player plays your stream. The default is an empty source. The source has these fields:url
Specifies the URL of the audio file or stream.type
Specifies the MIME type of the audio, for exampleaudio/mpeg.title
Specifies the title of the audio.
manual
Controls whether the player loads no audio by itself. Iftrue, andsource.urlis empty, the player does not load your stream. Use this option only if a program on your page gives the audio to the player. The default isfalse.unstyled
Controls whether the widget applies its own styles. Iftrue, the widget applies no styles, and your own CSS controls the appearance. The default isfalse.
Example: to show the track details, hide the volume slider, and use your own caption, use these values:
<script type="text/javascript">
(function(){ (window.$CC||(window.$CC={})).player = {
autoplay: false,
showSeek: true,
showSeekTimes: true,
showTime: false,
showVolume: false,
showCaption: true,
caption: 'Listen live',
showTrack: true,
};})();
</script>
CSS
The widget uses these CSS classes:
/* container for the default styles; not present if unstyled is true */
.cc_player_basic_style {
}
/* the track details, if showTrack is true */
.cc_player_track {
}
/* the title, the artist and the album of the current track */
.cc_player_track_title {
}
.cc_player_track_artist {
}
.cc_player_track_album {
}
/* the controls of the player */
.cc_player_controls {
}
/* the progress bar */
.cc_player_controls .seek {
}
/* the play button */
.cc_player_controls .mainbutton {
}
/* the volume slider and the caption */
.cc_player_controls .volume {
}
.cc_player_controls .caption {
}