Update Video
put
https://api.dyntube.com/v1/
videos/{id}
This endpoint will upate some fields of video. The fields are Title, Description, Options and Tags. You will need to POST the full "options" object that you receive in your video GET request. Please don't omit any fields.
Parameters
Body
title*
String
Video Title
description*
String
Video Description
tags*
Array
Video Tags
options*
Object
Options object provided in GET video request.
Responses
200: OK
{
"id": "VT3qwXmpxIVA",
"title": "Video",
"description": "",
"options": {
"autoplay": false,
"playerColor": "rgba(255, 65, 113, 0.83)",
"playerSkin": "solid",
"controlsColor": "#FFFFFF",
"seekButtons": false,
"volumeControl": true,
"preload": "auto",
"fullscreenControl": true,
"controls": true,
"stickyControls": false,
"defaultQuality": "",
"qualityControl": true,
"speedControl": true,
"fastForward": true,
"bigPlayControl": true,
"playControl": true,
"volume": 1.0,
"loop": false,
"muted": false,
"linkSharing": true,
"modal": false,
"resumePlayback": false
},
"tags": [],
}
using System;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
//Note: You will need to add the Newtonsoft.Json package from NuGet to use the `JsonConvert.SerializeObject` method.
namespace HttpPutRequestExample
{
class Program
{
static async System.Threading.Tasks.Task Main(string[] args)
{
string id = "VT3qwXmpxIVA";
string url = "https://api.dyntube.com/v1/videos/" + id;
var data = new
{
id = "VT3qwXmpxIVA",
title = "Video",
description = "",
options = new
{
autoplay = false,
playerColor = "rgba(255, 65, 113, 0.83)",
playerSkin = "solid",
controlsColor = "#FFFFFF",
seekButtons = false,
volumeControl = true,
preload = "auto",
fullscreenControl = true,
controls = true,
stickyControls = false,
defaultQuality = "",
qualityControl = true,
speedControl = true,
fastForward = true,
bigPlayControl = true,
playControl = true,
volume = 1.0,
loop = false,
muted = false,
linkSharing = true,
modal = false,
resumePlayback = false
},
tags = new string[] { }
};
using (var httpClient = new HttpClient())
{
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
var response = await httpClient.PutAsync(url, content);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Successful PUT request");
}
else
{
Console.WriteLine("PUT request failed with status code: " + response.StatusCode);
}
}
}
}
const https = require('https');
const data = JSON.stringify({
"id": "VT3qwXmpxIVA",
"title": "Video",
"description": "",
"options": {
"autoplay": false,
"playerColor": "rgba(255, 65, 113, 0.83)",
"playerSkin": "solid",
"controlsColor": "#FFFFFF",
"seekButtons": false,
"volumeControl": true,
"preload": "auto",
"fullscreenControl": true,
"controls": true,
"stickyControls": false,
"defaultQuality": "",
"qualityControl": true,
"speedControl": true,
"fastForward": true,
"bigPlayControl": true,
"playControl": true,
"volume": 1.0,
"loop": false,
"muted": false,
"linkSharing": true,
"modal": false,
"resumePlayback": false
},
"tags": [],
});
const options = {
hostname: 'api.dyntube.com',
port: 443,
path: '/v1/videos/VT3qwXmpxIVA',
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
console.log(`statusCode: ${res.statusCode}`);
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.on('error', (error) => {
console.error(error);
});
req.write(data);
req.end();
import json
import requests
id = "VT3qwXmpxIVA"
url = f"https://api.dyntube.com/v1/videos/{id}"
data = {
"id": id,
"title": "Video",
"description": "",
"options": {
"autoplay": False,
"playerColor": "rgba(255, 65, 113, 0.83)",
"playerSkin": "solid",
"controlsColor": "#FFFFFF",
"seekButtons": False,
"volumeControl": True,
"preload": "auto",
"fullscreenControl": True,
"controls": True,
"stickyControls": False,
"defaultQuality": "",
"qualityControl": True,
"speedControl": True,
"fastForward": True,
"bigPlayControl": True,
"playControl": True,
"volume": 1.0,
"loop": False,
"muted": False,
"linkSharing": True,
"modal": False,
"resumePlayback": False
},
"tags": []
}
headers = {"Content-type": "application/json"}
response = requests.put(url, data=json.dumps(data), headers=headers)
if response.status_code == 200:
print("Successful PUT request")
else:
print(f"PUT request failed with status code: {response.status_code}")
<?php
$id = "VT3qwXmpxIVA";
$url = "https://api.dyntube.com/v1/videos/" . $id;
$data = array(
"id" => $id,
"title" => "Video",
"description" => "",
"options" => array(
"autoplay" => false,
"playerColor" => "rgba(255, 65, 113, 0.83)",
"playerSkin" => "solid",
"controlsColor" => "#FFFFFF",
"seekButtons" => false,
"volumeControl" => true,
"preload" => "auto",
"fullscreenControl" => true,
"controls" => true,
"stickyControls" => false,
"defaultQuality" => "",
"qualityControl" => true,
"speedControl" => true,
"fastForward" => true,
"bigPlayControl" => true,
"playControl" => true,
"volume" => 1.0,
"loop" => false,
"muted" => false,
"linkSharing" => true,
"modal" => false,
"resumePlayback" => false
),
"tags" => array()
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if ($response === false) {
echo "PUT request failed: " . curl_error($ch);
} else {
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpStatus == 200) {
echo "Successful PUT request";
} else {
echo "PUT request failed with status code: " . $httpStatus;
}
}
curl_close($ch);
Last modified 2mo ago