Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

puemos/jwplayer-api

Repository files navigation

jwplayer-api Build Status Greenkeeper badge

A wrapper for jwplayer platform API

Install

$ npm install --save-dev jwplayer-api

Usage

'use strict';

const axios = require("axios");
const JwplayerApi = require('jwplayer-api');

const api = new JwplayerApi({
    key: "myKey",
    secret: "mySecret"
});

const myApi = {
    getUploadUrl: params => {
        return api.getUploadUrl(params);
    },

    delete: video_key => {
        return api.delete(video_key);
    },

    getVideoDetails: video_key => {
        return axios({
            method: "get",
            url: api.generateUrl("v1/videos/show", {
                video_key
            })
        }).then(res => {
            return res.data;
        });
    },

    conversionCreate: (video_key, template_key) => {
        return api.conversionCreate(video_key, template_key);
    }
};

License

MIT © Shy Alter