Uploading With Accessible URL
When This Option Is Ideal
You’ve got a video accessible on the internet. Maybe it’s in a public S3 bucket, or maybe you can make a pre-signed URL for us to access the video.
You want to make this video playable for everyone else on Hesedvid.
Give us the URL and some config for how to process it. We’ll give you back a video URL for playback by anyone.
The Single-Step Process
This workflow has one step:
- Video Config. Tell Hesedvid things like the video quality and resolutions you want available. Include your video URL.
Upload Your Video
POST https://api.hesedvid.com/v1/{orgID}/environments/{envID}/videos/upload // TODO: We need to figure this out
Required Parameters
| Field | Type | Description |
|---|---|---|
fileName | string | The name of the file including the file extension |
videoQuality | string | Quality preset: standard, high, ultra |
allowPublicAccess | boolean | Whether video can be accessed without authentication |
videoURL | boolean | The URL Hesedvid can use to request your video |
To decide on which video quality you might want to use, click here.
Caution
TODO: We need a comparison page
Optional Parameters
| Field | Type | Default | Description |
|---|---|---|---|
videoName | string | - | Display name for the video. Useful for finding the video in the dashboard or via API. |
maxEdgeLength | integer | (auto-detected) | Maximum resolution: 480, 720, 1080, 1440, 2160 |
maxFrameRate | integer | (auto-detected) | Maximum frame rate (fps) |
EncodingMode | string | fast | Either fast or slow. Use slow for better quality and slightly faster loading speed. |
audioCodec | string | aac | Audio codec: aac, mp3, ac3, eac3 |
Response body
A successful response will include this:
{ "body": { "videoID": "pubvid_XXX" }}Code Examples
const ORGID = "org_XXX";const ENVID = "ENV_XXX";const APIKEY = "key_XXX";
async function uploadVideoFromURL( videoURL: string, fileName: string, videoQuality: "standard" | "high" | "ultra" = "high", allowPublicAccess: boolean = true): Promise<string> { // Step 1: Submit the video config with accessible URL const uploadResponse = await fetch( `https://api.hesedvid.com/v1/api/${ORGID}/environments/${ENVID}/videos/upload`, { method: "POST", headers: { "X-Api-Key": APIKEY, "Content-Type": "application/json" }, body: JSON.stringify({ fileName: fileName, videoQuality: videoQuality, allowPublicAccess: allowPublicAccess, videoURL: videoURL }) } );
const { body: uploadData } = await uploadResponse.json();
return uploadData.videoID;}
// Example usageconst videoID = await uploadVideoFromURL( "https://example.com/my-video.mp4", "my-video.mp4", "high", true);console.log("Video ID:", videoID);import requests
ORGID = "org_XXX"ENVID = "ENV_XXX"APIKEY = "key_XXX"
def upload_video_from_url( video_url: str, file_name: str, video_quality: str = "high", allow_public_access: bool = True) -> str: # Step 1: Submit the video config with accessible URL upload_response = requests.post( f'https://api.hesedvid.com/v1/api/{ORGID}/environments/{ENVID}/videos/upload', headers={ 'X-Api-Key': APIKEY, 'Content-Type': 'application/json' }, json={ 'fileName': file_name, 'videoQuality': video_quality, 'allowPublicAccess': allow_public_access, 'videoURL': video_url } )
upload_data = upload_response.json()['body']
return upload_data['videoID']
# Example usagevideo_id = upload_video_from_url( video_url="https://example.com/my-video.mp4", file_name="my-video.mp4", video_quality="high", allow_public_access=True)print(f"Video ID: {video_id}")package main
import ( "bytes" "encoding/json" "fmt" "net/http")
const ( ORGID = "org_XXX" ENVID = "ENV_XXX" APIKEY = "key_XXX")
type UploadVideoRequest struct { FileName string `json:"fileName"` VideoQuality string `json:"videoQuality"` AllowPublicAccess bool `json:"allowPublicAccess"` VideoURL string `json:"videoURL"`}
type UploadVideoResponse struct { Body struct { VideoID string `json:"videoID"` } `json:"body"`}
func uploadVideoFromURL(videoURL, fileName, videoQuality string, allowPublicAccess bool) (string, error) { // Step 1: Submit the video config with accessible URL reqBody, _ := json.Marshal(UploadVideoRequest{ FileName: fileName, VideoQuality: videoQuality, AllowPublicAccess: allowPublicAccess, VideoURL: videoURL, })
req, _ := http.NewRequest("POST", fmt.Sprintf("https://api.hesedvid.com/v1/api/%s/environments/%s/videos/upload", ORGID, ENVID), bytes.NewBuffer(reqBody)) req.Header.Set("X-Api-Key", APIKEY) req.Header.Set("Content-Type", "application/json")
client := &http.Client{} resp, err := client.Do(req) if err != nil { return "", err } defer resp.Body.Close()
var uploadResp UploadVideoResponse json.NewDecoder(resp.Body).Decode(&uploadResp)
return uploadResp.Body.VideoID, nil}
// Example usagefunc main() { videoID, _ := uploadVideoFromURL( "https://example.com/my-video.mp4", "my-video.mp4", "high", true, )
fmt.Println("Video ID:", videoID)}How To Play The Video You Just Uploaded
After you upload your video, it will begin processing. When it’s done processing, you can take the public Video ID you got from step 1 and start to play the video:
<!-- Replace the {vidID} with the public video ID from step 1 --><iframe src="https://player.hesedvid.com/v1/public/{orgID}/{envID}/{vidID}/master.m3u8?autoplay=true&muted=true" frameborder="0" allowfullscreen></iframe>Check out our “Video Player” docs for more information.