import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
playlist = client.streaming.playlists.update(
playlist_id=0,
)
print(playlist.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
playlist, err := client.Streaming.Playlists.Update(
context.TODO(),
0,
streaming.PlaylistUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", playlist.ID)
}
curl --request PATCH \
--url https://api.gcore.com/streaming/playlists/{playlist_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'",
"active": true,
"start_time": "2024-07-01T11:00:00Z",
"loop": false,
"video_ids": [
17800,
17801
],
"client_user_id": 2876,
"countdown": true,
"playlist_type": "live"
}
EOFconst options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Playlist: Webinar \'Onboarding for new employees on working with the corporate portal\'',
active: true,
start_time: '2024-07-01T11:00:00Z',
loop: false,
video_ids: [17800, 17801],
client_user_id: 2876,
countdown: true,
playlist_type: 'live'
})
};
fetch('https://api.gcore.com/streaming/playlists/{playlist_id}', 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/playlists/{playlist_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Playlist: Webinar \'Onboarding for new employees on working with the corporate portal\'',
'active' => true,
'start_time' => '2024-07-01T11:00:00Z',
'loop' => false,
'video_ids' => [
17800,
17801
],
'client_user_id' => 2876,
'countdown' => true,
'playlist_type' => 'live'
]),
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;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/streaming/playlists/{playlist_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'\",\n \"active\": true,\n \"start_time\": \"2024-07-01T11:00:00Z\",\n \"loop\": false,\n \"video_ids\": [\n 17800,\n 17801\n ],\n \"client_user_id\": 2876,\n \"countdown\": true,\n \"playlist_type\": \"live\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/playlists/{playlist_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'\",\n \"active\": true,\n \"start_time\": \"2024-07-01T11:00:00Z\",\n \"loop\": false,\n \"video_ids\": [\n 17800,\n 17801\n ],\n \"client_user_id\": 2876,\n \"countdown\": true,\n \"playlist_type\": \"live\"\n}"
response = http.request(request)
puts response.read_body{
"name": "Playlist - playlist2",
"active": true,
"start_time": "2024-06-17T11:56:00.000Z",
"loop": true,
"video_ids": [
5528796,
5268174,
5065017
],
"client_user_id": null,
"countdown": false,
"playlist_type": "live",
"id": 10050,
"client_id": 102748,
"ad_id": null,
"player_id": null,
"hls_cmaf_url": "https://102748.gvideo.io/playlists/102748_10050/master-cmaf.m3u8",
"iframe_embed_code": "<iframe width=\"560\" height=\"315\" src=\"https://player.gvideo.co/playlists/102748_10050\" frameborder=\"0\" allowfullscreen></iframe>",
"iframe_url": "https://player.gvideo.co/playlists/102748_10050",
"hls_url": "https://102748.gvideo.io/playlists/102748_10050/master.m3u8"
}Change playlist
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
playlist = client.streaming.playlists.update(
playlist_id=0,
)
print(playlist.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
playlist, err := client.Streaming.Playlists.Update(
context.TODO(),
0,
streaming.PlaylistUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", playlist.ID)
}
curl --request PATCH \
--url https://api.gcore.com/streaming/playlists/{playlist_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'",
"active": true,
"start_time": "2024-07-01T11:00:00Z",
"loop": false,
"video_ids": [
17800,
17801
],
"client_user_id": 2876,
"countdown": true,
"playlist_type": "live"
}
EOFconst options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Playlist: Webinar \'Onboarding for new employees on working with the corporate portal\'',
active: true,
start_time: '2024-07-01T11:00:00Z',
loop: false,
video_ids: [17800, 17801],
client_user_id: 2876,
countdown: true,
playlist_type: 'live'
})
};
fetch('https://api.gcore.com/streaming/playlists/{playlist_id}', 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/playlists/{playlist_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Playlist: Webinar \'Onboarding for new employees on working with the corporate portal\'',
'active' => true,
'start_time' => '2024-07-01T11:00:00Z',
'loop' => false,
'video_ids' => [
17800,
17801
],
'client_user_id' => 2876,
'countdown' => true,
'playlist_type' => 'live'
]),
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;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/streaming/playlists/{playlist_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'\",\n \"active\": true,\n \"start_time\": \"2024-07-01T11:00:00Z\",\n \"loop\": false,\n \"video_ids\": [\n 17800,\n 17801\n ],\n \"client_user_id\": 2876,\n \"countdown\": true,\n \"playlist_type\": \"live\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/playlists/{playlist_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'\",\n \"active\": true,\n \"start_time\": \"2024-07-01T11:00:00Z\",\n \"loop\": false,\n \"video_ids\": [\n 17800,\n 17801\n ],\n \"client_user_id\": 2876,\n \"countdown\": true,\n \"playlist_type\": \"live\"\n}"
response = http.request(request)
puts response.read_body{
"name": "Playlist - playlist2",
"active": true,
"start_time": "2024-06-17T11:56:00.000Z",
"loop": true,
"video_ids": [
5528796,
5268174,
5065017
],
"client_user_id": null,
"countdown": false,
"playlist_type": "live",
"id": 10050,
"client_id": 102748,
"ad_id": null,
"player_id": null,
"hls_cmaf_url": "https://102748.gvideo.io/playlists/102748_10050/master-cmaf.m3u8",
"iframe_embed_code": "<iframe width=\"560\" height=\"315\" src=\"https://player.gvideo.co/playlists/102748_10050\" frameborder=\"0\" allowfullscreen></iframe>",
"iframe_url": "https://player.gvideo.co/playlists/102748_10050",
"hls_url": "https://102748.gvideo.io/playlists/102748_10050/master.m3u8"
}Authorizations
Path Parameters
Body
Response
Successful
A URL to a master playlist HLS (master.m3u8) with MPEG TS container.
This URL is a link to the main manifest. But you can also manually specify suffix-options that will allow you to change the manifest to your request:
/playlists/{client_id}_{playlist_id}/master[-cmaf][-min-N][-max-N][-img][-(h264|hevc|av1)].m3u8
Please see the details in hls_url attribute of /videos/{id} method.
Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented and intended for your use. Any additional internal manifests, sub-manifests, parameters, chunk names, file extensions, and related components are internal infrastructure entities. These may undergo modifications without prior notice, in any manner or form. It is strongly advised not to store them in your database or cache them on your end.
A URL to a master playlist HLS (master-cmaf.m3u8) with CMAF-based chunks. Chunks are in fMP4 container.
It is possible to use the same suffix-options as described in the "hls_url" attribute.
Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented and intended for your use. Any additional internal manifests, sub-manifests, parameters, chunk names, file extensions, and related components are internal infrastructure entities. These may undergo modifications without prior notice, in any manner or form. It is strongly advised not to store them in your database or cache them on your end.
A URL to a built-in HTML video player with the video inside. It can be inserted into an iframe on your website and the video will automatically play in all browsers.
The player can be opened or shared via this direct link. Also the video player can be integrated into your web pages using the Iframe tag.
Please see the details in iframe_url attribute of /videos/{id} method.
Was this page helpful?