예제 #1
0
# Update details about how your player looks.
import apivideo
from apivideo.apis import PlayerThemesApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

player_api = PlayerThemesApi(client)

player_id = "your player ID here"

player_theme_update_payload = {
    "track_unplayed": "rgba(240, 255, 255, .1)",
    "track_played": "rgba(255, 240, 255, .95)"
}

response = player_api.update(player_id, player_theme_update_payload)
print(response)
예제 #2
0
# Create a player
import apivideo
from apivideo.apis import PlayerThemesApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

player_api = PlayerThemesApi(client)

# Create player payload. To use the parameters in the client, change them to have
# the common structure for a Python parameter. For example enableApi becomes enable_api.
# enableControls becomes enable_controls, and so on.

player_theme_creation_payload = {
    "enable_api": True,
    "enable_controls": True,
    "force_autoplay": False,
    "hide_title": False,
    "force_loop": False,
    "text": "rgba(255, 255, 255, .95)",
    "link": "rgba(255, 0, 0, .95)",
    "link_hover": "rgba(255, 255, 255, .75)",
    "track_played": "rgba(255, 255, 255, .95)",
    "track_unplayed": "rgba(255, 255, 255, .1)",
예제 #3
0
# Upload a logo for your player and add a link the user navigates to when they click your logo.
import apivideo
from apivideo.apis import PlayerThemesApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

player_api = PlayerThemesApi(client)

# Add the file you want to use as a logo.
# It must be no bigger than h: 100px, w: 200px, no larger than 200KB.

file = open("image2.jpg", "rb")

# Optionally, you can add a link that the player will send the viewer to if they click on
# your logo.
link = "https://google.com"

# ID for the player you want to add a logo to.
player_id = "your player ID here"

response = player_api.upload_logo(player_id, file, link)
print(response)
예제 #4
0
# Retrieve details about a player using the ID.
import apivideo
from apivideo.apis import PlayerThemesApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

player_api = PlayerThemesApi(client)

player_id = "your player ID here"

response = player_api.get(player_id)
print(response)
예제 #5
0
# List all players.
import apivideo
from apivideo.apis import PlayerThemesApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

player_api = PlayerThemesApi(client)

# Retrieve a list of all players
response = player_api.list()
print(response)
예제 #6
0
# Delete a player
import apivideo
from apivideo.apis import PlayerThemesApi
from apivideo.exceptions import ApiAuthException

api_key = "your api key here"

client = apivideo.AuthenticatedApiClient(api_key)

# If you'd rather use the sandbox environment:
# client = apivideo.AuthenticatedApiClient(api_key, production=False)

client.connect()

player_api = PlayerThemesApi(client)

player_id = "your player ID here"

response = player_api.delete(player_id)
print(response)