Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.streaming.broadcasts.list()
page = page.items[0]
print(page.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"),
)
page, err := client.Streaming.Broadcasts.List(context.TODO(), streaming.BroadcastListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.gcore.com/streaming/broadcasts \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/broadcasts', 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/broadcasts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/streaming/broadcasts")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/broadcasts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"name": "Player",
"status": "paused",
"share_url": null,
"custom_iframe_url": null,
"show_dvr_after_finish": true,
"ad_id": null,
"player_id": null,
"stream_ids": [],
"id": 3111719,
"client_id": 102748,
"iframe_embed_code": "<iframe width=\"560\" height=\"315\" src=\"https://player.gvideo.co/broadcasts/2675_21606?no_low_latency\" frameborder=\"0\" allowfullscreen></iframe>",
"iframe_url": "https://player.gvideo.co/broadcasts/2675_21606?no_low_latency",
"pending_message": null,
"custom_messages": null,
"client_user_id": null,
"poster_thumb": null,
"poster": null
}
]Broadcasts
Get all broadcasts
Note: Feature “Broadcast” is outdated, soon it will be replaced by “Multicamera”.
Returns a list of broadcasts. Please see description in POST method.
GET
/
streaming
/
broadcasts
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.streaming.broadcasts.list()
page = page.items[0]
print(page.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"),
)
page, err := client.Streaming.Broadcasts.List(context.TODO(), streaming.BroadcastListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.gcore.com/streaming/broadcasts \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/broadcasts', 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/broadcasts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/streaming/broadcasts")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/broadcasts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"name": "Player",
"status": "paused",
"share_url": null,
"custom_iframe_url": null,
"show_dvr_after_finish": true,
"ad_id": null,
"player_id": null,
"stream_ids": [],
"id": 3111719,
"client_id": 102748,
"iframe_embed_code": "<iframe width=\"560\" height=\"315\" src=\"https://player.gvideo.co/broadcasts/2675_21606?no_low_latency\" frameborder=\"0\" allowfullscreen></iframe>",
"iframe_url": "https://player.gvideo.co/broadcasts/2675_21606?no_low_latency",
"pending_message": null,
"custom_messages": null,
"client_user_id": null,
"poster_thumb": null,
"poster": null
}
]Authorizations
Response
200 - application/json
Successful
Broadcast statuses:
Pending — default “Broadcast isn’t started yet” or custom message (see pending_message parameter) is shown, users don't see the live stream
Live — broadcast is live, and viewers can see it
Paused — “Broadcast is paused” message is shown, users don't see the live stream
Finished — “Broadcast is finished” message is shown, users don't see the live stream
The users' browsers start displaying the message/stream immediately after you change the broadcast status
Was this page helpful?