Sign up for free

Player Themes

get

List all player themes

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

sortBystring

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.

Enum
  • name
  • createdAt
  • updatedAt
Example
"createdAt"
sortOrderstring

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

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

Default
1
Example
2
pageSizeint

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

Default
25
Example
30

Responses

Request examples

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

Response examples

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

Create a player

Create a player for your video, and customise it.

namestring

Add a name for your player theme here.

Max Length
100
textstring

RGBA color for timer text. Default: rgba(255, 255, 255, 1)

linkstring

RGBA color for all controls. Default: rgba(255, 255, 255, 1)

linkHoverstring

RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1)

linkActivestring

RGBA color for the play button when hovered.

trackPlayedstring

RGBA color playback bar: played content. Default: rgba(88, 131, 255, .95)

trackUnplayedstring

RGBA color playback bar: downloaded but unplayed (buffered) content. Default: rgba(255, 255, 255, .35)

trackBackgroundstring

RGBA color playback bar: background. Default: rgba(255, 255, 255, .2)

backgroundTopstring

RGBA color: top 50% of background. Default: rgba(0, 0, 0, .7)

backgroundBottomstring

RGBA color: bottom 50% of background. Default: rgba(0, 0, 0, .7)

backgroundTextstring

RGBA color for title text. Default: rgba(255, 255, 255, 1)

enableApiboolean

enable/disable player SDK access. Default: true

Default
true
enableControlsboolean

enable/disable player controls. Default: true

Default
true
forceAutoplayboolean

enable/disable player autoplay. Default: false

Default
false
hideTitleboolean

enable/disable title. Default: false

Default
false
forceLoopboolean

enable/disable looping. Default: false

Default
false

Responses

Request examples

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

Response examples

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

Retrieve a player

Retreive a player theme by player id.

playerIdstring

required

The unique identifier for the player you want to retrieve.

Example
"pl45d5vFFGrfdsdsd156dGhh"

Responses

Request examples

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

Response examples

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

Delete a player

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

playerIdstring

required

The unique identifier for the player you want to delete.

Example
"pl45d5vFFGrfdsdsd156dGhh"

Responses

Request examples

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

Response examples

No Content

Empty response

patch

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.

namestring

Add a name for your player theme here.

Max Length
100
textstring

RGBA color for timer text. Default: rgba(255, 255, 255, 1)

linkstring

RGBA color for all controls. Default: rgba(255, 255, 255, 1)

linkHoverstring

RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1)

linkActivestring

RGBA color for the play button when hovered.

trackPlayedstring

RGBA color playback bar: played content. Default: rgba(88, 131, 255, .95)

trackUnplayedstring

RGBA color playback bar: downloaded but unplayed (buffered) content. Default: rgba(255, 255, 255, .35)

trackBackgroundstring

RGBA color playback bar: background. Default: rgba(255, 255, 255, .2)

backgroundTopstring

RGBA color: top 50% of background. Default: rgba(0, 0, 0, .7)

backgroundBottomstring

RGBA color: bottom 50% of background. Default: rgba(0, 0, 0, .7)

backgroundTextstring

RGBA color for title text. Default: rgba(255, 255, 255, 1)

enableApiboolean

enable/disable player SDK access. Default: true

enableControlsboolean

enable/disable player controls. Default: true

forceAutoplayboolean

enable/disable player autoplay. Default: false

hideTitleboolean

enable/disable title. Default: false

forceLoopboolean

enable/disable looping. Default: false

Responses

Request examples

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

Response examples

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

Upload a logo

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.
filefile

required

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

Example
"mylogo.jpg"
linkstring

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"

Responses

Request examples

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

Response examples

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

Delete logo

Delete the logo associated to a player.

playerIdstring

required

The unique identifier for the player.

Example
"pl14Db6oMJRH6SRVoOwORacK"

Responses

Request examples

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

Response examples

No Content

Empty response

Was this page helpful?