/players
Retrieve a list of all the player themes you created, as well as details about each one.
sortBy
string
createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format.
sortOrder
string
Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones.
currentPage
int
Choose the number of search results to return per page. Minimum value: 1
pageSize
int
Results per page. Allowed values 1-100, default is 25.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/PlayerThemesApi.md#list
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
req := apivideosdk.PlayerThemesApiListRequest{}
req.SortBy("createdAt") // string | createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format.
req.SortOrder("asc") // string | Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones.
req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1)
req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25)
res, err := client.PlayerThemes.List(req)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PlayerThemes.List``: %v\
", err)
}
// response from `List`: PlayerThemesListResponse
fmt.Fprintf(os.Stdout, "Response from `PlayerThemes.List`: %v\
", res)
}
Success
{
"data": [
{
"playerId": "pl4fgtjy4tjyKDK545DRdfg",
"createdAt": "2020-01-13T10:09:17+00:00",
"updatedAt": "2020-01-13T10:09:17+00:00",
"text": "rgba(255, 255, 255, .95)",
"link": "rgba(255, 0, 0, .95)",
"linkHover": "rgba(255, 255, 255, .75)",
"linkActive": "rgba(255, 0, 0, .75)",
"trackPlayed": "rgba(255, 255, 255, .95)",
"trackUnplayed": "rgba(255, 255, 255, .1)",
"trackBackground": "rgba(0, 0, 0, 0)",
"backgroundTop": "rgba(72, 4, 45, 1)",
"backgroundBottom": "rgba(94, 95, 89, 1)",
"backgroundText": "rgba(255, 255, 255, .95)",
"enableApi": false,
"enableControls": false,
"forceAutoplay": false,
"hideTitle": false,
"forceLoop": false
},
{
"playerId": "pl54fgtjy4tjyKDK45DRdfg",
"createdAt": "2020-01-13T10:09:17+00:00",
"updatedAt": "2020-01-13T10:09:17+00:00",
"text": "rgba(255, 255, 255, .95)",
"link": "rgba(255, 0, 0, .95)",
"linkHover": "rgba(255, 255, 255, .75)",
"linkActive": "rgba(255, 0, 0, .75)",
"trackPlayed": "rgba(255, 255, 255, .95)",
"trackUnplayed": "rgba(255, 255, 255, .1)",
"trackBackground": "rgba(0, 0, 0, 0)",
"backgroundTop": "rgba(72, 4, 45, 1)",
"backgroundBottom": "rgba(94, 95, 89, 1)",
"backgroundText": "rgba(255, 255, 255, .95)",
"enableApi": true,
"enableControls": true,
"forceAutoplay": true,
"hideTitle": false,
"forceLoop": false
}
],
"pagination": {
"currentPage": 1,
"pageSize": 25,
"pagesTotal": 1,
"itemsTotal": 4,
"currentPageItems": 4,
"links": [
{
"rel": "self",
"uri": "https://ws.api.video/players?currentPage=1"
},
{
"rel": "first",
"uri": "https://ws.api.video/players?currentPage=1"
},
{
"rel": "last",
"uri": "https://ws.api.video/players?currentPage=1"
}
]
}
}
/players
Create a player for your video, and customise it.
name
string
Add a name for your player theme here.
text
string
RGBA color for timer text. Default: rgba(255, 255, 255, 1)
link
string
RGBA color for all controls. Default: rgba(255, 255, 255, 1)
linkHover
string
RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1)
linkActive
string
RGBA color for the play button when hovered.
trackPlayed
string
RGBA color playback bar: played content. Default: rgba(88, 131, 255, .95)
trackUnplayed
string
RGBA color playback bar: downloaded but unplayed (buffered) content. Default: rgba(255, 255, 255, .35)
trackBackground
string
RGBA color playback bar: background. Default: rgba(255, 255, 255, .2)
backgroundTop
string
RGBA color: top 50% of background. Default: rgba(0, 0, 0, .7)
backgroundBottom
string
RGBA color: bottom 50% of background. Default: rgba(0, 0, 0, .7)
backgroundText
string
RGBA color for title text. Default: rgba(255, 255, 255, 1)
enableApi
boolean
enable/disable player SDK access. Default: true
enableControls
boolean
enable/disable player controls. Default: true
forceAutoplay
boolean
enable/disable player autoplay. Default: false
hideTitle
boolean
enable/disable title. Default: false
forceLoop
boolean
enable/disable looping. Default: false
{
"name": "My nice theme",
"assets": {
"logo": "https://cdn.api.video/player/pl14Db6oMJRH6SRVoOwORacK/logo.png",
"link": "https://api.video"
},
"shapeMargin": 10,
"shapeRadius": 3,
"shapeAspect": "flat",
"shapeBackgroundTop": "rgba(50, 50, 50, .7)",
"shapeBackgroundBottom": "rgba(50, 50, 50, .8)",
"text": "rgba(255, 255, 255, .95)",
"link": "rgba(255, 0, 0, .95)",
"linkHover": "rgba(255, 255, 255, .75)",
"linkActive": "rgba(255, 0, 0, .75)",
"trackPlayed": "rgba(255, 255, 255, .95)",
"trackUnplayed": "rgba(255, 255, 255, .1)",
"trackBackground": "rgba(0, 0, 0, 0)",
"backgroundTop": "rgba(72, 4, 45, 1)",
"backgroundBottom": "rgba(94, 95, 89, 1)",
"backgroundText": "rgba(255, 255, 255, .95)",
"language": "en",
"enableApi": true,
"enableControls": true,
"forceAutoplay": false,
"hideTitle": false,
"forceLoop": false
}
Created
{
"playerId": "pl45d5vFFGrfdsdsd156dGhh",
"createdAt": "2020-01-13T10:09:17+00:00",
"updatedAt": "2020-01-13T10:09:17+00:00",
"text": "rgba(255, 255, 255, .95)",
"link": "rgba(255, 0, 0, .95)",
"linkHover": "rgba(255, 255, 255, .75)",
"linkActive": "rgba(255, 0, 0, .75)",
"trackPlayed": "rgba(255, 255, 255, .95)",
"trackUnplayed": "rgba(255, 255, 255, .1)",
"trackBackground": "rgba(0, 0, 0, 0)",
"backgroundTop": "rgba(72, 4, 45, 1)",
"backgroundBottom": "rgba(94, 95, 89, 1)",
"backgroundText": "rgba(255, 255, 255, .95)",
"enableApi": false,
"enableControls": false,
"forceAutoplay": false,
"hideTitle": false,
"forceLoop": false
}
/players/{playerId}
Retreive a player theme by player id.
playerId
string
required
The unique identifier for the player you want to retrieve.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/PlayerThemesApi.md#get
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
playerId := "pl45d5vFFGrfdsdsd156dGhh" // string | The unique identifier for the player you want to retrieve.
res, err := client.PlayerThemes.Get(playerId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PlayerThemes.Get``: %v\
", err)
}
// response from `Get`: PlayerTheme
fmt.Fprintf(os.Stdout, "Response from `PlayerThemes.Get`: %v\
", res)
}
Success
{
"playerId": "pl45d5vFFGrfdsdsd156dGhh",
"createdAt": "2020-01-13T10:09:17+00:00",
"updatedAt": "2020-01-13T11:12:14+00:00",
"text": "rgba(255, 255, 255, .95)",
"link": "rgba(255, 0, 0, .95)",
"linkHover": "rgba(255, 255, 255, .75)",
"linkActive": "rgba(255, 0, 0, .75)",
"trackPlayed": "rgba(255, 255, 255, .95)",
"trackUnplayed": "rgba(255, 255, 255, .1)",
"trackBackground": "rgba(0, 0, 0, 0)",
"backgroundTop": "rgba(72, 4, 45, 1)",
"backgroundBottom": "rgba(94, 95, 89, 1)",
"backgroundText": "rgba(255, 255, 255, .95)",
"enableApi": false,
"enableControls": false,
"forceAutoplay": false,
"hideTitle": false,
"forceLoop": false
}
/players/{playerId}
Delete a player if you no longer need it. You can delete any player that you have the player ID for.
playerId
string
required
The unique identifier for the player you want to delete.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/PlayerThemesApi.md#delete
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
playerId := "pl45d5vFFGrfdsdsd156dGhh" // string | The unique identifier for the player you want to delete.
err := client.PlayerThemes.Delete(playerId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PlayerThemes.Delete``: %v\
", err)
}
}
No Content
Empty response
/players/{playerId}
Use a player ID to update specific details for a player. NOTE: It may take up to 10 min before the new player configuration is available from our CDN.
name
string
Add a name for your player theme here.
text
string
RGBA color for timer text. Default: rgba(255, 255, 255, 1)
link
string
RGBA color for all controls. Default: rgba(255, 255, 255, 1)
linkHover
string
RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1)
linkActive
string
RGBA color for the play button when hovered.
trackPlayed
string
RGBA color playback bar: played content. Default: rgba(88, 131, 255, .95)
trackUnplayed
string
RGBA color playback bar: downloaded but unplayed (buffered) content. Default: rgba(255, 255, 255, .35)
trackBackground
string
RGBA color playback bar: background. Default: rgba(255, 255, 255, .2)
backgroundTop
string
RGBA color: top 50% of background. Default: rgba(0, 0, 0, .7)
backgroundBottom
string
RGBA color: bottom 50% of background. Default: rgba(0, 0, 0, .7)
backgroundText
string
RGBA color for title text. Default: rgba(255, 255, 255, 1)
enableApi
boolean
enable/disable player SDK access. Default: true
enableControls
boolean
enable/disable player controls. Default: true
forceAutoplay
boolean
enable/disable player autoplay. Default: false
hideTitle
boolean
enable/disable title. Default: false
forceLoop
boolean
enable/disable looping. Default: false
{
"name": "string",
"text": "string",
"link": "string",
"linkHover": "string",
"linkActive": "string",
"trackPlayed": "string",
"trackUnplayed": "string",
"trackBackground": "string",
"backgroundTop": "string",
"backgroundBottom": "string",
"backgroundText": "string",
"enableApi": true,
"enableControls": true,
"forceAutoplay": true,
"hideTitle": true,
"forceLoop": true
}
Success
{
"playerId": "pl45d5vFFGrfdsdsd156dGhh",
"createdAt": "2020-01-13T10:09:17+00:00",
"updatedAt": "2020-01-13T11:12:14+00:00",
"text": "rgba(255, 255, 255, .95)",
"link": "rgba(255, 0, 0, .95)",
"linkHover": "rgba(255, 255, 255, .75)",
"linkActive": "rgba(255, 0, 0, .75)",
"trackPlayed": "rgba(255, 255, 255, .95)",
"trackUnplayed": "rgba(255, 255, 255, .1)",
"trackBackground": "rgba(0, 0, 0, 0)",
"backgroundTop": "rgba(72, 4, 45, 1)",
"backgroundBottom": "rgba(94, 95, 89, 1)",
"backgroundText": "rgba(255, 255, 255, .95)",
"enableApi": false,
"enableControls": false,
"forceAutoplay": false,
"hideTitle": false,
"forceLoop": false
}
/players/{playerId}/logo
Upload an image file as a logo for your player. The image should fit within these constraints:
image/jpeg
or image/png
. api.video recommends using png
images with transparent background.file
file
required
The name of the file you want to use for your logo.
link
string
A public link that you want to advertise in your player. For example, you could add a link to your company. When a viewer clicks on your logo, they will be taken to this address.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/PlayerThemesApi.md#uploadLogo
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
playerId := "pl14Db6oMJRH6SRVoOwORacK" // string | The unique identifier for the player.
file := os.NewFile(1234, "some_file") // *os.File | The name of the file you want to use for your logo.
link := "link_example" // string | A public link that you want to advertise in your player. For example, you could add a link to your company. When a viewer clicks on your logo, they will be taken to this address.
res, err := client.PlayerThemes.UploadLogoFile(playerId, file)
// you can also use a Reader instead of a File:
// client.PlayerThemes.UploadLogo(playerId, fileName, fileReader)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PlayerThemes.UploadLogo``: %v\
", err)
}
// response from `UploadLogo`: PlayerTheme
fmt.Fprintf(os.Stdout, "Response from `PlayerThemes.UploadLogo`: %v\
", res)
}
Created
{
"name": "string",
"text": "string",
"link": "string",
"linkHover": "string",
"linkActive": "string",
"trackPlayed": "string",
"trackUnplayed": "string",
"trackBackground": "string",
"backgroundTop": "string",
"backgroundBottom": "string",
"backgroundText": "string",
"enableApi": true,
"enableControls": true,
"forceAutoplay": true,
"hideTitle": true,
"forceLoop": true,
"playerId": "pl45KFKdlddgk654dspkze",
"createdAt": "2020-01-31T10:17:47+00:00",
"updatedAt": "2020-01-31T10:18:47+00:00",
"assets": {
"logo": "mylogo.jpg",
"link": "path/to/my/logo/mylogo.jpg"
}
}
/players/{playerId}/logo
Delete the logo associated to a player.
playerId
string
required
The unique identifier for the player.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/PlayerThemesApi.md#deleteLogo
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
playerId := "pl14Db6oMJRH6SRVoOwORacK" // string | The unique identifier for the player.
err := client.PlayerThemes.DeleteLogo(playerId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PlayerThemes.DeleteLogo``: %v\
", err)
}
}
No Content
Empty response
Was this page helpful?