Skip to content

Latest commit

 

History

History
391 lines (268 loc) · 14.4 KB

PlayerThemesAPI.md

File metadata and controls

391 lines (268 loc) · 14.4 KB

PlayerThemesAPI

All URIs are relative to https://ws.api.video

Method HTTP request Description
create POST /players Create a player
get GET /players/{playerId} Retrieve a player
update PATCH /players/{playerId} Update a player
delete DELETE /players/{playerId} Delete a player
list GET /players List all player themes
uploadLogo POST /players/{playerId}/logo Upload a logo
deleteLogo DELETE /players/{playerId}/logo Delete logo

create

    open class func create(playerThemeCreationPayload: PlayerThemeCreationPayload, completion: @escaping (_ data: PlayerTheme?, _ error: Error?) -> Void)
    open class func create(playerThemeCreationPayload: PlayerThemeCreationPayload, completion: @escaping (_ result: Swift.Result<Response<PlayerTheme>, ErrorResponse>) -> Void)

Create a player

Create a player for your video, and customise it.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let playerThemeCreationPayload = PlayerThemeCreationPayload(name: "name_example", text: "text_example", link: "link_example", linkHover: "linkHover_example", linkActive: "linkActive_example", trackPlayed: "trackPlayed_example", trackUnplayed: "trackUnplayed_example", trackBackground: "trackBackground_example", backgroundTop: "backgroundTop_example", backgroundBottom: "backgroundBottom_example", backgroundText: "backgroundText_example", enableApi: false, enableControls: false, forceAutoplay: false, hideTitle: false, forceLoop: false) // PlayerThemeCreationPayload | 

// Create a player
PlayerThemesAPI.create(playerThemeCreationPayload: playerThemeCreationPayload) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
playerThemeCreationPayload PlayerThemeCreationPayload

Return type

PlayerTheme

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get

    open class func get(playerId: String, completion: @escaping (_ data: PlayerTheme?, _ error: Error?) -> Void)
    open class func get(playerId: String, completion: @escaping (_ result: Swift.Result<Response<PlayerTheme>, ErrorResponse>) -> Void)

Retrieve a player

Retreive a player theme by player id.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let playerId = "playerId_example" // String | The unique identifier for the player you want to retrieve. 

// Retrieve a player
PlayerThemesAPI.get(playerId: playerId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
playerId String The unique identifier for the player you want to retrieve.

Return type

PlayerTheme

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update

    open class func update(playerId: String, playerThemeUpdatePayload: PlayerThemeUpdatePayload, completion: @escaping (_ data: PlayerTheme?, _ error: Error?) -> Void)
    open class func update(playerId: String, playerThemeUpdatePayload: PlayerThemeUpdatePayload, completion: @escaping (_ result: Swift.Result<Response<PlayerTheme>, ErrorResponse>) -> Void)

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.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let playerId = "playerId_example" // String | The unique identifier for the player.
let playerThemeUpdatePayload = PlayerThemeUpdatePayload(name: "name_example", text: "text_example", link: "link_example", linkHover: "linkHover_example", linkActive: "linkActive_example", trackPlayed: "trackPlayed_example", trackUnplayed: "trackUnplayed_example", trackBackground: "trackBackground_example", backgroundTop: "backgroundTop_example", backgroundBottom: "backgroundBottom_example", backgroundText: "backgroundText_example", enableApi: false, enableControls: false, forceAutoplay: false, hideTitle: false, forceLoop: false) // PlayerThemeUpdatePayload | 

// Update a player
PlayerThemesAPI.update(playerId: playerId, playerThemeUpdatePayload: playerThemeUpdatePayload) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
playerId String The unique identifier for the player.
playerThemeUpdatePayload PlayerThemeUpdatePayload

Return type

PlayerTheme

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete

    open class func delete(playerId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
    open class func delete(playerId: String, completion: @escaping (_ result: Swift.Result<Response<Void>, ErrorResponse>) -> Void)

Delete a player

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

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let playerId = "playerId_example" // String | The unique identifier for the player you want to delete.

// Delete a player
PlayerThemesAPI.delete(playerId: playerId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
playerId String The unique identifier for the player you want to delete.

Return type

Void (empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

    open class func list(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ data: PlayerThemesListResponse?, _ error: Error?) -> Void)
    open class func list(sortBy: SortBy_list? = nil, sortOrder: SortOrder_list? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ result: Swift.Result<Response<PlayerThemesListResponse>, ErrorResponse>) -> Void)

List all player themes

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

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let sortBy = "sortBy_example" // 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. (optional)
let sortOrder = "sortOrder_example" // String | Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. (optional)
let currentPage = 987 // Int | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
let pageSize = 987 // Int | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)

// List all player themes
PlayerThemesAPI.list(sortBy: sortBy, sortOrder: sortOrder, currentPage: currentPage, pageSize: pageSize) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
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. [optional]
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. [optional]
currentPage Int Choose the number of search results to return per page. Minimum value: 1 [optional] [default to 1]
pageSize Int Results per page. Allowed values 1-100, default is 25. [optional] [default to 25]

Return type

PlayerThemesListResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

uploadLogo

    open class func uploadLogo(playerId: String, file: URL, link: String? = nil, completion: @escaping (_ data: PlayerTheme?, _ error: Error?) -> Void)
    open class func uploadLogo(playerId: String, file: URL, link: String? = nil, completion: @escaping (_ result: Swift.Result<Response<PlayerTheme>, ErrorResponse>) -> Void)

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.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let playerId = "playerId_example" // String | The unique identifier for the player.
let file = URL(string: "https://example.com")! // URL | The name of the file you want to use for your logo.
let 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. (optional)

// Upload a logo
PlayerThemesAPI.uploadLogo(playerId: playerId, file: file, link: link) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
playerId String The unique identifier for the player.
file URL 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. [optional]

Return type

PlayerTheme

Authorization

apiKey

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteLogo

    open class func deleteLogo(playerId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
    open class func deleteLogo(playerId: String, completion: @escaping (_ result: Swift.Result<Response<Void>, ErrorResponse>) -> Void)

Delete logo

Delete the logo associated to a player.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let playerId = "playerId_example" // String | The unique identifier for the player.

// Delete logo
PlayerThemesAPI.deleteLogo(playerId: playerId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
playerId String The unique identifier for the player.

Return type

Void (empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]