Code Monkey home page Code Monkey logo

java-sdk's Introduction

API.video 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

  1. Download the latest release.
  2. 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.1.0.jar')
}

Quick start

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().createSandbox("YourApiKey");
    
        // Upload a new video
        Video video = client.videos.upload("/path/to/file.mp4");

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

        // Iterate over videos (paging is transparent)
        for (PageIterator<Video> it = client.videos.list(); it.hasNext(); ) {
            Video v = it.next();
        
            String videoTitle = v.title;
        }
    }
}

More examples

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

// Iterate over videos (paging is transparent)
for (PageIterator<Video> it = client.videos.list(); it.hasNext(); ) {
    Video video = it.next();

    String videoTitle = video.title;
}

API coverage

Most of api.video features are implemented and autocomplete friendly within your favorite IDE:

client.videos; // https://docs.api.video/5.1/videos
client.players; // https://docs.api.video/5.1/players
client.captions; // https://docs.api.video/5.1/captions
client.liveStreams; // https://docs.api.video/5.1/live

// https://docs.api.video/5.1/analytics
client.liveStreamAnalytics; 
client.sessionEventAnalytics; 
client.videoAnalytics;

java-sdk's People

Contributors

atiaabdessamad avatar apiv-thomas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.