wqcloud-video

腾讯云视频Node.js SDK (lvb)

MIT License

Downloads
20
Stars
5
Committers
2

WQcloud Video

Node.js SDK

Table of Contents generated with DocToc

npm install wqcloud-video --save
# 
yarn add wqcloud-video
var options = {
  appid: '',
  appkey: '',
};

:

{
  t: 10, // 10s, ,
  channel_id: 'test', // , Param.s.channel_id
  status: 0 // , Param.n.status
}

const { getPushUrl } = require('wqcloud-video');

console.log(
  getPushUrl({
    bizid: 8888,
    streamid: 'test',
    key: 'aabbccdd001122333444', // , Key
    expires: 3600
  })
);
// rtmp://8888.livepush.myqcloud.com/live/8888_test?bizid=8888&txTime=5943874C&txSecret=ffc8cc832447ea92335df69970e6ce25

const { getPlayUrl } = require('wqcloud-video');

console.log(
  getPlayUrl({
    bizid: 8888,
    streamid: 'test'
  })
);
//{ rtmp: 'rtmp://8888.liveplay.myqcloud.com/live/8888_test',
//  flv: 'http://8888.liveplay.myqcloud.com/live/8888_test.flv',
//  m3u8: 'http://8888.liveplay.myqcloud.com/live/8888_test.m3u8' }

/

:

// API http://fcgi.video.qcloud.com/common_access
const { fcgi } = require('wqcloud-video');

const qcloud = fcgi({
  appid: '1234567890',
  appkey: 'aabbccddeeffgghhiijjkkmmnnooppqq' // , APIKey
});

qcloud.Live_Channel_SetStatus({
  channel_id: '8888_test',
  status: 1
}).then(console.log).catch(console.err);

:

const { fcgi } = require('wqcloud-video');

const qcloud = fcgi({
  appid: '1234567890',
  appkey: 'aabbccddeeffgghhiijjkkmmnnooppqq'
});

qcloud.Live_Channel_GetStatus({
  channel_id: '8888_test' 
}).then(console.log).catch(console.err);

:

// API http://statcgi.video.qcloud.com/common_access
const { statcgi } = require('wqcloud-video');

const qcloud = statcgi({
  appid: '1234567890',
  appkey: 'aabbccddeeffgghhiijjkkmmnnooppqq'
});

qcloud.Get_LiveStat({
  stream_id: '8888_test'
}).then((data) => {
  console.log(JSON.stringify(data, null, 2));
}).catch(console.err);

TODO:

License

MIT