There are a two methods to use the Clevercast Player:
<iframe>
with options as URL parameters. You can always find the embed code for your item, event or webcast in the Clevercast platform.Note about autoplay: most browsers do not allow content to play automatically with sound. When you enable autoplay, we strongly advise you to also enable muted. For more information, click here.
<iframe width="854" height="480" src="//player.clevercast.com/?account_id=Wjb45d&item_id=VzzgGr" style="border: 0" allow="autoplay; fullscreen" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>
<iframe width="854" height="480" src="//player.clevercast.com/?account_id=271mkz&event_id=W9m0eR" style="border: 0" allow="autoplay; fullscreen" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>
<script src="//player.clevercast.com/js/api.min.js"></script>
<div id="player"></div>
When using the API, you can pass layout options. By default, a fixed width
and height
is used:
var player = new RMP({
'id': 'player',
'width': 854,
'height': 480,
'options': {
'account_id': 'Wjb45d',
// `item_id` for VOD
// `event_id` for live
// See options for more.
'item_id': 'VzzgGr'
}
});
Or, if you want the player to behave responsive (16 by 9), you can instead enable the responsive
parameter:
var player = new RMP({
'id': 'player',
'responsive': true,
'options': {
'account_id': 'Wjb45d',
'item_id': 'VzzgGr'
}
});
If you want the player to follow while the user scrolls down, you can enable the autoscrollspy
parameter (requires responsive
):
var player = new RMP({
'id': 'player',
'responsive': true,
'autoscrollspy': true,
'options': {
'account_id': 'Wjb45d',
'item_id': 'VzzgGr'
}
});
Or, if you want the player to auto play when visible, you can enable the autoscrollplay
parameter (requires responsive
):
var player = new RMP({
'id': 'player',
'responsive': true,
'autoscrollplay': true,
'options': {
'account_id': 'Wjb45d',
'item_id': 'VzzgGr'
}
});
Please contact support or visit the price calculator for more information.
To add a separate captions display:
var captions = new RMCP({
// Required.
'id': 'captions',
// The instantiated RMP object to attach to.
'rmp': player,
// Optional.
'options': {
// The default captions language to open with (defaults to the first).
'captions_default': 'su',
// Basic styling of the captions.
'color': 'red',
'bg_color': 'green',
'active_cue_color': 'turquoise',
'active_cue_bg_color': 'darkblue',
'font_family': 'Tex Gyre Pagella',
'font_size': '1.5rem',
// Whether to show the caption language selection.
'show_select': true,
// Custom CSS can be used for complete control.
'custom_css': `
body {
padding: 1rem;
}
`,
}
});
Name | Parameters | Description |
---|---|---|
addEventListener | event:String , callback:Function |
Add an event listener, see below for a list of events |
removeEventListener | event:String , callback:Function |
Remove an event listener, see below for a list of events |
load | options:Object |
Load new options (see options) |
play | None | position:Number |
Start playback, optionally seek to given position |
pause | None | position:Number |
Pause playback, optionally seek to given position |
seek | position:Number |
Seek to given position |
playing | None | Returns true when video is playing, false when it is not |
adPlaying | None | Returns true when ad video is playing, false when it is not |
currentTime | None | Returns the current time |
currentAbsoluteTime | None | Returns the absolute current time (only applicable to live streams) |
currentType | None | Returns the current type |
duration | None | Returns the current duration |
volume | None | volume:Number |
Set or get the volume |
muted | None | isMuted:Boolean |
Set or get the muted volume state |
audioTrackList | None | Get the list of audio tracks |
audioTrack | None | audioTrack:String |
Set or get the current audio track |
playbackRate | None | rate:Number |
Set or get the playback rate |
liveStatus | status:Number |
Get the live event status NONE = -1 WAITING = 0 STARTED = 1 PAUSED = 2 ENDED = 3 |
showControls | None | Show the controls |
hideControls | None | Hide the controls |
requestScrollspy | None | Request the player to go in scrollspy mode |
exitScrollspy | None | Request the player to leave scrollspy mode |
showShareDialog | None | Show the share dialog |
hideShareDialog | None | Hide the share dialog |
showRelatedDialog | None | Show the related dialog |
hideRelatedDialog | None | Hide the related dialog |
Name | Callback parameters | Description |
---|---|---|
ready | None | Fires when the player is ready. |
error | error:Object |
Fires when an error in encountered. |
loadedmetadata | None | Fires when the video metadata is loaded. |
waiting | None | Fires when the video is waiting for the buffer. |
canplay | None | Fires when the video can be played (is buffered). |
play | currentTime:Number |
Fires when the video has been started or is no longer paused. |
pause | currentTime:Number |
Fires when the video has been paused. |
seeked | currentTime:Number |
Fires when the user is finished moving/skipping to a new position in the video. |
ended | currentTime:Number |
Fires when the video ended. |
fullscreenchange | isFullscreen:Boolean , isFake:Boolean |
Fires on fullscreen change. Some devices (iOS) require a fake fullscreen, this will result in the player filling the document window. |
scrollspychange | isScrollspy:Boolean |
Fires on scrollspy change. |
structureddata | data:Object |
Fires when player fetched the data for an item or event from the Clevercast platform. data contains: name description thumbnailUrl uploadDate duration |
livestatuschange | status:Number |
Fires on new live event status change. |
action | currentTime:Number , plugin:String , action:String | action:Object |
Fires on action. |
Option | Default value | Description |
---|---|---|
account_id | '' |
Account ID |
item_id | '' |
Item ID |
event_id | '' |
Event ID |
smartlist_id | '' |
Smartlist ID |
playlist_id | '' |
Playlist ID |
webcast_id | '' |
Webcast ID |
registrant_id | '' |
Registrant ID |
player_id | '' |
Player ID |
abouttext | 'Clevercast Player' |
Top text in context menu, leave empty to disable the menu |
aboutlink | '//www.clevercast.com' |
Top link in context menu |
continuous | false |
Autoplay next playlist item |
hmac | '' |
HMAC string to pass to the redirect service |
expires | '' |
Expire time to pass to the redirect service |
back_button | true |
Show back button (on media switch) |
autoload | 'on' |
on metadata off |
start_level | -1 |
Start level index, use -1 for automatic selection |
autoplay | false |
Autoplay the media |
playsinline | false |
Play inside page on mobile devices |
controls | true |
Show player controls |
controls_inactivity_timeout | 2000 |
Number of milliseconds to wait after inactivity before hiding controls |
language_instructions | false |
Show language instructions |
language_instructions_delay | 6000 |
Number of milliseconds to wait before showing language instructions |
language_instructions_timeout | 8000 |
Number of milliseconds to wait before hiding language instructions |
unplayed_seek | true |
Allow seeking to unplayed position |
picture_in_picture | false |
Show Picture-in-Picture button in controls |
fullscreen | true |
Show Fullscreen button in controls |
disable_pause | false |
Disable pausing the video and hide play button in controls (ignored with native controls). Best used in combination with playsinline on iOS. |
volume | 1.0 |
Start volume |
muted | false |
Start muted |
show_title | false |
Show name as title |
starttime | 0.0 |
Start at time |
loop | false |
Loop media |
audio_default | '' |
Default audio track: leave empty, browser or set to ISO-639-1 language code (for example en) |
audio_default_store | true |
Keep and re-use user selected audio track session storage (initial option only) |
captions_default | '' |
Default text track: leave empty, browser or set to ISO-639-1 language code (for example en) |
captions_default_store | true |
Keep and re-use user selected text track session storage (initial option only) |
captions_default_show | false |
Show the default subtitle from start |
captions_color | #FFF |
Captions foreground color, valid values: #000, #00F, #0FF, #0F0, #F0F, #F00, #FFF, #FF0 |
captions_bg_color | #000 |
Captions background color, valid values: #000, #00F, #0FF, #0F0, #F0F, #F00, #FFF, #FF0 |
captions_bg_opacity | #000 |
Captions background opacity, valid values: 0, 0.5, 1 |
captions_edge_style | none |
Captions edge syle, valid values: none, raised, depressed, uniform, dropshadow |
captions_font_family | proportionalSansSerif |
Captions font family, valid values: proportionalSansSerif, monospaceSansSerif, proportionalSerif, monospaceSerif, casual, script, small-caps |
captions_font_percent | 1.00 |
Captions font size percent, valid values: 0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 2.00, 3.00, 4.00 |
comm_url_enable | true |
Enable ad tag URL request (*) |
comm_url | '' |
Ad tag URL (*) |
comm_url_prefetch | true |
Use the API to prefetch the ad URL when available |
comm_url_credentials | true |
Send credentials and cookies to ad tag URL |
comm_min_duration | 0.0 |
Minimum item duration required to play ad (*) |
playback_rates | [] |
Allow setting playback rate with controls, example: [ 0.5, 1.0, 1.5 ] |
chromecast | false |
Enable Chromecast support |
* Can only be set when "Allow Ad URL Override" is enabled for your player in Clevercast, this is disabled by default.