The api.video API Reference

Welcome to the api.video developer hub. You'll find comprehensive guides and documentation to help you start working with api.video as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Full code is can be found here: https://github.com/apivideo/java-sdk

This SDK provides a Java client for api.video service. This is an early version, feel free to report any issue.

Install

With Gradle

Download the latest release.
Add the following dependencies in your

build.gradle file:
// build.gradle
dependencies {
    implementation 'com.konghq:unirest-java:2.3.17'
    implementation files('libs/java-sdk-0.2.0.jar')
}

Quick start

import java.io.File;
import video.api.java.sdk.Client;
import video.api.java.sdk.ClientFactory;
import video.api.java.sdk.domain.exception.ResponseException;
import video.api.java.sdk.domain.video.Video;

public class Main {
    public static void main(String[] args) throws ResponseException {
        Client client = new ClientFactory().create("YourProductionApiKey");
        // Client client = new ClientFactory().createSandbox("YourSandboxApiKey");
    
        // Upload a new video
        Video video = client.videos.upload(new File("/path/to/file.mp4"));

        // Get its embed code
    String embedCode = video.assets.get("iframe"); // <iframe src="..."></iframe>
}

}

Video

// Upload a video with properties
Video video = new Video();
video.title = "My title";
video.tags.add("my tag");
video = client.videos.upload(new File("/path/to/file.mp4"), video);

// Iterate over videos (paging is handled by the client)
for (Video v : client.videos.list()) {
    String videoTitle = v.title;
}

More generally, you can use the following for all video related calls:

client.videos;

Live Streaming

client.liveStreams;

Captions

client.captions;

Player

client.players;

Statistics and Analytics

client.liveStreamAnalytics; 
client.sessionEventAnalytics; 
client.videoAnalytics;

Updated about a month ago

Java SDK


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.