qm-player-sdk-test
v0.4.0
Published
qm player js sdk lib
Downloads
3
Readme
QM Player SDK for Browser
Installation
$ yarn add qm-player-jssdk
# or
$ npm install qm-player-jssdk
开始
复制依赖文件
copy node_modules/qm-player-sdk/dist/liveplayer.swf 到根目录 copy node_modules/qm-player-sdk/dist/crossdomain.xml 到根目录 copy node_modules/qm-player-sdk/dist/liveplayer-element.min.js 到根目录
在 html 中引用根目录 liveplayer-element.min.js
全局配置
import QMPlayer from 'qm-player-sdk'
QMPlayer.initGlobalConfig({
debug: true,
accessToken: '<VALID_ACCESS_TOKEN>'
})
创建实例
Step 1:
<div id="player"></div>
Step 2:
import QMPlayer from 'qm-player-jssdk'
const client = QMPlayer.createClient('#player', {
type: 'single',
windowNumber: 2,
live: true,
width: '500px',
height: 400,
autoplay: false,
autoActivedNext: false,
hideBigPlayButton: true
})
client.activePlayer.videoUrl = '<VALID_VIDEO_URL>'