Create a new player that can contain video objects
| Code | Description |
|---|---|
| 400 | Bad Request: body has wrong syntax or unable to handle request |
| 401 | Unauthorized: auth_token omitted or authentication failed |
| 403 | Forbidden: This action cannot be performed |
| 404 | Not Found: The requested resource could not be found |
| 406 | Not Acceptable: Accept or Content-Type headers must be application/json, text/csv or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| 422 | Unprocessable Entity: body has wrong attributes |
// There are 2 options to create a new player:
// Option 1: create a player with a single video.
{
"name":"My Player",
"chapters_attributes":[{
"position":0,
"video_attributes":{
"name":"My Video",
"upload_url":"http://myvideos.com/video.mp4"
}
}]
}
//Option 2: create a player that can contain multiple videos. Use the <a href="/apidoc/api_chapters/create.html">chapters endpoint</a> to add videos to the player.
REQUEST
Content-Type: application/json
{
"name": "My Player",
"description": "The besterest videos",
"viral_sharing": true,
"viral_sharing_message": "Check out this awesome video!",
"height": 360,
"width": 640,
"color": "A7A7A7",
"splash_screen_fade": true,
"on_complete": "loop",
"sharing_page": true,
"sharing_page_comments": true,
"whitelisted_embed_domain": "*.example.com,example2.com",
"authorized_by": "platform"
}
RESPONSE
201 (Created)
{
"id": 1111,
"uuid": "eQSsPVXinqGoesujP2Vteg",
"name": "My Player",
"description": "The besterest videos",
"play_button": true,
"autoplay": false,
"embed_button": true,
"viral_sharing": true,
"viral_sharing_message": "Check out this awesome video!",
"custom_sharing_link": null,
"height": 360,
"width": 640,
"color": "A7A7A7",
"playlist_color": "222222",
"splash_screen_fade": true,
"mute_onload": false,
"disable_playlist": false,
"playlist_always_open": false,
"audio_player_visuals": "visualization",
"on_complete": "loop",
"redirect_url": null,
"redirect_whole_page": false,
"sharing_page": true,
"sharing_page_comments": true,
"release_date": 0,
"expiry_date": null,
"whitelisted_embed_domain": "*.example.com,example2.com",
"authorized_by": "platform",
"hidden_controls": false,
"up_next": false,
"disable_legacy": false,
"chapters_attributes": [],
"created_at": 1390585689,
"updated_at": 1390585689,
"length_in_seconds": 0,
"show_playback_speed": false,
"show_time": true
}
| Param name | Description |
|---|---|
|
auth_token optional |
API token needed to authorize requests Validations:
|
|
name optional |
Name of the player Validations:
|
|
description optional |
Description of the player Validations:
|
|
play_button optional |
Display the play button on the thumbnail Validations:
|
|
autoplay optional |
Force the player to start playing when the page loads Validations:
|
|
first_frame optional |
Causes the player to begin playing as soon as it has loaded and then immediately pause Validations:
|
|
embed_button optional |
Display embed button on player Validations:
|
|
viral_sharing optional |
Adds a share button to your player allowing your viewers to share your videos on social networks and email Validations:
|
|
viral_sharing_message optional |
The message used when viral sharing button is clicked Validations:
|
|
custom_sharing_link optional |
The link that will be shared when viral sharing button is clicked Validations:
|
|
height optional |
Height of the player Validations:
|
|
width optional |
Width of the player Validations:
|
|
color optional |
Color of the player (Hex) Validations:
|
|
playlist_color optional |
Color of the playlist (Hex) Validations:
|
|
splash_screen_fade optional |
The player gets highlighted when a viewer’s mouse hovers over it Validations:
|
|
mute_onload optional |
The videos will default to mute with a text overlay prompting the viewer to click for sound Validations:
|
|
disable_playlist optional |
The playlist is not shown on the side of the player Validations:
|
|
playlist_always_open optional |
The playlist is always shown on the side of the player Validations:
|
|
on_complete optional , nil allowed |
What would you like to happen when all videos have finished playing? Validations:
|
|
redirect_url optional |
URL to redirect the player iframe to when videos have finished playing Validations:
|
|
redirect_whole_page optional |
Redirects the entire page if “on_complete” is set to “redirect_url” Validations:
|
|
sharing_page optional |
Enable the sharing page for the player Validations:
|
|
sharing_page_comments optional |
Allow viewers to comment on the sharing page Validations:
|
|
release_date optional , nil allowed |
Timestamp (Unix Time) Validations:
|
|
expiry_date optional , nil allowed |
Timestamp (Unix Time) Validations:
|
|
whitelisted_embed_domain optional |
Restrict this player to be embedded only on specific domains Validations:
|
|
authorized_by optional |
Restrict this player to a specific platform such as Hubs or Salesforce Chatter Validations:
|
|
hidden_controls optional |
Disable playback controls Validations:
|
|
up_next optional |
Enable Up Next feature Validations:
|
|
disable_legacy optional |
Disable legacy mode Validations:
|
|
audio_player_visuals optional |
Change what is displayed during playback of an audio chapter Validations:
|
|
chapters_attributes optional |
Advanced feature: Used for embedded chapter resource creation Validations:
|