A wrapper for jwplayer platform API
$ npm install --save-dev jwplayer-api
'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);
}
};
MIT © Shy Alter