Create player
curl --request POST \
--url https://api.gcore.com/streaming/players \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"player": [
{
"id": 33,
"name": "Player",
"client_id": 100,
"design": "",
"custom_css": "",
"js_url": "",
"skin_js_url": "",
"bg_color": "#3313df",
"fg_color": "#FFFFFF",
"text_color": "#FFFFFF",
"hover_color": "#ef9047",
"autoplay": true,
"mute": false,
"disable_skin": false,
"save_options_to_cookies": false,
"show_sharing": true,
"speed_control": false
}
]
}
'import requests
url = "https://api.gcore.com/streaming/players"
payload = { "player": [
{
"id": 33,
"name": "Player",
"client_id": 100,
"design": "",
"custom_css": "",
"js_url": "",
"skin_js_url": "",
"bg_color": "#3313df",
"fg_color": "#FFFFFF",
"text_color": "#FFFFFF",
"hover_color": "#ef9047",
"autoplay": True,
"mute": False,
"disable_skin": False,
"save_options_to_cookies": False,
"show_sharing": True,
"speed_control": False
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
player: [
{
id: 33,
name: 'Player',
client_id: 100,
design: '',
custom_css: '',
js_url: '',
skin_js_url: '',
bg_color: '#3313df',
fg_color: '#FFFFFF',
text_color: '#FFFFFF',
hover_color: '#ef9047',
autoplay: true,
mute: false,
disable_skin: false,
save_options_to_cookies: false,
show_sharing: true,
speed_control: false
}
]
})
};
fetch('https://api.gcore.com/streaming/players', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/streaming/players",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'player' => [
[
'id' => 33,
'name' => 'Player',
'client_id' => 100,
'design' => '',
'custom_css' => '',
'js_url' => '',
'skin_js_url' => '',
'bg_color' => '#3313df',
'fg_color' => '#FFFFFF',
'text_color' => '#FFFFFF',
'hover_color' => '#ef9047',
'autoplay' => true,
'mute' => false,
'disable_skin' => false,
'save_options_to_cookies' => false,
'show_sharing' => true,
'speed_control' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/streaming/players"
payload := strings.NewReader("{\n \"player\": [\n {\n \"id\": 33,\n \"name\": \"Player\",\n \"client_id\": 100,\n \"design\": \"\",\n \"custom_css\": \"\",\n \"js_url\": \"\",\n \"skin_js_url\": \"\",\n \"bg_color\": \"#3313df\",\n \"fg_color\": \"#FFFFFF\",\n \"text_color\": \"#FFFFFF\",\n \"hover_color\": \"#ef9047\",\n \"autoplay\": true,\n \"mute\": false,\n \"disable_skin\": false,\n \"save_options_to_cookies\": false,\n \"show_sharing\": true,\n \"speed_control\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/streaming/players")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"player\": [\n {\n \"id\": 33,\n \"name\": \"Player\",\n \"client_id\": 100,\n \"design\": \"\",\n \"custom_css\": \"\",\n \"js_url\": \"\",\n \"skin_js_url\": \"\",\n \"bg_color\": \"#3313df\",\n \"fg_color\": \"#FFFFFF\",\n \"text_color\": \"#FFFFFF\",\n \"hover_color\": \"#ef9047\",\n \"autoplay\": true,\n \"mute\": false,\n \"disable_skin\": false,\n \"save_options_to_cookies\": false,\n \"show_sharing\": true,\n \"speed_control\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/players")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"player\": [\n {\n \"id\": 33,\n \"name\": \"Player\",\n \"client_id\": 100,\n \"design\": \"\",\n \"custom_css\": \"\",\n \"js_url\": \"\",\n \"skin_js_url\": \"\",\n \"bg_color\": \"#3313df\",\n \"fg_color\": \"#FFFFFF\",\n \"text_color\": \"#FFFFFF\",\n \"hover_color\": \"#ef9047\",\n \"autoplay\": true,\n \"mute\": false,\n \"disable_skin\": false,\n \"save_options_to_cookies\": false,\n \"show_sharing\": true,\n \"speed_control\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.This response has no body data.Players
Create player
POST
/
streaming
/
players
Create player
curl --request POST \
--url https://api.gcore.com/streaming/players \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"player": [
{
"id": 33,
"name": "Player",
"client_id": 100,
"design": "",
"custom_css": "",
"js_url": "",
"skin_js_url": "",
"bg_color": "#3313df",
"fg_color": "#FFFFFF",
"text_color": "#FFFFFF",
"hover_color": "#ef9047",
"autoplay": true,
"mute": false,
"disable_skin": false,
"save_options_to_cookies": false,
"show_sharing": true,
"speed_control": false
}
]
}
'import requests
url = "https://api.gcore.com/streaming/players"
payload = { "player": [
{
"id": 33,
"name": "Player",
"client_id": 100,
"design": "",
"custom_css": "",
"js_url": "",
"skin_js_url": "",
"bg_color": "#3313df",
"fg_color": "#FFFFFF",
"text_color": "#FFFFFF",
"hover_color": "#ef9047",
"autoplay": True,
"mute": False,
"disable_skin": False,
"save_options_to_cookies": False,
"show_sharing": True,
"speed_control": False
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
player: [
{
id: 33,
name: 'Player',
client_id: 100,
design: '',
custom_css: '',
js_url: '',
skin_js_url: '',
bg_color: '#3313df',
fg_color: '#FFFFFF',
text_color: '#FFFFFF',
hover_color: '#ef9047',
autoplay: true,
mute: false,
disable_skin: false,
save_options_to_cookies: false,
show_sharing: true,
speed_control: false
}
]
})
};
fetch('https://api.gcore.com/streaming/players', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/streaming/players",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'player' => [
[
'id' => 33,
'name' => 'Player',
'client_id' => 100,
'design' => '',
'custom_css' => '',
'js_url' => '',
'skin_js_url' => '',
'bg_color' => '#3313df',
'fg_color' => '#FFFFFF',
'text_color' => '#FFFFFF',
'hover_color' => '#ef9047',
'autoplay' => true,
'mute' => false,
'disable_skin' => false,
'save_options_to_cookies' => false,
'show_sharing' => true,
'speed_control' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/streaming/players"
payload := strings.NewReader("{\n \"player\": [\n {\n \"id\": 33,\n \"name\": \"Player\",\n \"client_id\": 100,\n \"design\": \"\",\n \"custom_css\": \"\",\n \"js_url\": \"\",\n \"skin_js_url\": \"\",\n \"bg_color\": \"#3313df\",\n \"fg_color\": \"#FFFFFF\",\n \"text_color\": \"#FFFFFF\",\n \"hover_color\": \"#ef9047\",\n \"autoplay\": true,\n \"mute\": false,\n \"disable_skin\": false,\n \"save_options_to_cookies\": false,\n \"show_sharing\": true,\n \"speed_control\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/streaming/players")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"player\": [\n {\n \"id\": 33,\n \"name\": \"Player\",\n \"client_id\": 100,\n \"design\": \"\",\n \"custom_css\": \"\",\n \"js_url\": \"\",\n \"skin_js_url\": \"\",\n \"bg_color\": \"#3313df\",\n \"fg_color\": \"#FFFFFF\",\n \"text_color\": \"#FFFFFF\",\n \"hover_color\": \"#ef9047\",\n \"autoplay\": true,\n \"mute\": false,\n \"disable_skin\": false,\n \"save_options_to_cookies\": false,\n \"show_sharing\": true,\n \"speed_control\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/players")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"player\": [\n {\n \"id\": 33,\n \"name\": \"Player\",\n \"client_id\": 100,\n \"design\": \"\",\n \"custom_css\": \"\",\n \"js_url\": \"\",\n \"skin_js_url\": \"\",\n \"bg_color\": \"#3313df\",\n \"fg_color\": \"#FFFFFF\",\n \"text_color\": \"#FFFFFF\",\n \"hover_color\": \"#ef9047\",\n \"autoplay\": true,\n \"mute\": false,\n \"disable_skin\": false,\n \"save_options_to_cookies\": false,\n \"show_sharing\": true,\n \"speed_control\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyThis response has no body data.This response has no body data.Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Body
application/json
Set of properties for displaying videos. All parameters may be blank to inherit their values from default Streaming player.
Show child attributes
Show child attributes
Example:
[
{
"id": 33,
"name": "Player",
"client_id": 100,
"design": "",
"custom_css": "",
"js_url": "",
"skin_js_url": "",
"bg_color": "#3313df",
"fg_color": "#FFFFFF",
"text_color": "#FFFFFF",
"hover_color": "#ef9047",
"autoplay": true,
"mute": false,
"disable_skin": false,
"save_options_to_cookies": false,
"show_sharing": true,
"speed_control": false
}
]
Response
Was this page helpful?
⌘I