node-wistia
v1.0.3
Published
A Node.js wrapper for the Wistia API. Upload your videos to Wistia and get your account data
Downloads
8
Maintainers
Readme
node-wistia
Includes
- Data API Wistia data API docs
- Upload API Wistia upload API docs
Installation
npm install node-wistia
Usages
Upload Video
With File
const Wistia = require('node-wistia');
const fs = require('fs');
let wistia = new Wistia('****************************************************************');
async function uploadVideo() {
let data = await wistia.uploadVideo({
file: fs.writeFileSync('test.mp4'),
name: 'Test Video Uploaded With File',
project_id: "*********"
})
console.log(data)
};
With URL
const Wistia = require('node-wistia');
let wistia = new Wistia('****************************************************************');
async function uploadVideo() {
let data = await wistia.uploadVideo({
url: 'https://www.website.com/test.mp4',
name: 'Test Video Uploaded With File',
project_id: "*********"
})
console.log(data)
};
Get Account Datas
let account = await wistia.accountData();
console.log(account);
let stats = await wistia.accountStats();
console.log(stats);
Get Media Datas
let medias = await wistia.getMedias();
console.log(medias);
let media = await wistia.getMedia('********');
console.log(media);
Get Project Datas
let projects = await wistia.getProjects();
console.log(projects);
let project = await wistia.getProject('********');
console.log(project);