Sign up for free

Player Themes

List all player themes

Retrieve a list of all the player themes you created, as well as details about each one.

get /players
sortBy string

createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format.

Enum
  • name
  • createdAt
  • updatedAt
Example
"createdAt"
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.

Enum
  • asc
  • desc
Example
"asc"
currentPage int

Choose the number of search results to return per page. Minimum value: 1

Default
1
Example
2
pageSize int

Results per page. Allowed values 1-100, default is 25.

Default
25
Example
30

Requests

// 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 ISO-8601 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)
}

Responses

ExamplesSchema

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"
      }
    ]
  }
}

Create a player

Create a player for your video, and customise it.

post /players
name string

Add a name for your player theme here.

Max Length
100
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

Default
true
enableControls boolean

enable/disable player controls. Default: true

Default
true
forceAutoplay boolean

enable/disable player autoplay. Default: false

Default
false
hideTitle boolean

enable/disable title. Default: false

Default
false
forceLoop boolean

enable/disable looping. Default: false

Default
false

Requests

{
  "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
}

Responses

ExamplesSchema

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
}

Retrieve a player

Retreive a player theme by player id.

get /players/{playerId}
playerId string

required

The unique identifier for the player you want to retrieve.

Example
"pl45d5vFFGrfdsdsd156dGhh"

Requests

// 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)
}

Responses

ExamplesSchema

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
}

Delete a player

Delete a player if you no longer need it. You can delete any player that you have the player ID for.

delete /players/{playerId}
playerId string

required

The unique identifier for the player you want to delete.

Example
"pl45d5vFFGrfdsdsd156dGhh"

Requests

// 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)
    }
}

Responses

ExamplesSchema

No Content

Empty response

Update a player

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.

patch /players/{playerId}
name string

Add a name for your player theme here.

Max Length
100
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

Requests

{
  "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
}

Responses

ExamplesSchema

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
}

Upload an image file as a logo for your player. The image should fit within these constraints:

  • The image mime type must be image/jpeg or image/png. api.video recommends using png images with transparent background.
  • The image size should be a maximum of 200px width x 100px.
  • The file size should be a maximum of 100 KiB.
post /players/{playerId}/logo
file file

required

The name of the file you want to use for your logo.

Example
"mylogo.jpg"
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.

Format
string
Example
"https://my-company.com"

Requests

// 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)
}

Responses

ExamplesSchema

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"
  }
}

Delete the logo associated to a player.

delete /players/{playerId}/logo
playerId string

required

The unique identifier for the player.

Example
"pl14Db6oMJRH6SRVoOwORacK"

Requests

// 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)
    }
}

Responses

ExamplesSchema

No Content

Empty response

Was this page helpful?