Commit fa130622 authored by 李纪文's avatar 李纪文

feat: 视频vms增加自定义参数

parent ca0d1964
......@@ -23,12 +23,14 @@ class App extends React.Component {
}
createAll() {
let { VideoInfo, JessibucaObj } = this.props;
const { params = {} } = VideoInfo;
const queryStr = this.toQueryString(params);
this.destroy();
if (VideoInfo.url) {
this.create(this.refs[`myVideo` + VideoInfo.id], `key`, JessibucaObj);
setTimeout(() => {
let code = window.independence ? window.siteCode : window.globalConfig?.userInfo?.site;
let siteInfo = !code ? '' : `?_site=${code}`;
let code = window.independence ? window.siteCode || '' : window.globalConfig?.userInfo?.site || '';
let siteInfo = !code ? `?${queryStr}` : `?_site=${code}&${queryStr}`;
this.play(VideoInfo.url + `/${VideoInfo.dataRate == 'Sub' ? 2 : 1}${siteInfo}`, `key`);
}, 10);
}
......@@ -189,9 +191,11 @@ class App extends React.Component {
changeRate(text) {
const { VideoInfo } = this.props;
const { params = {} } = VideoInfo;
const queryStr = this.toQueryString(params);
if (VideoInfo.url && this.jessibuca) {
let code = window.independence ? window.siteCode : window.globalConfig?.userInfo?.site;
let siteInfo = !code ? '' : `?_site=${code}`;
let code = window.independence ? window.siteCode || '' : window.globalConfig?.userInfo?.site || '';
let siteInfo = !code ? `?${queryStr}` : `?_site=${code}&${queryStr}`;
this.jessibuca.play(VideoInfo.url + `/${text == '标清' ? 2 : 1}${siteInfo}`);
this.setState({
isPlaying: true,
......@@ -217,6 +221,14 @@ class App extends React.Component {
</div>
);
}
toQueryString(obj) {
return Object.keys(obj)
.map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]))
.join('&');
}
render() {
return <div className={style.root} ref={this.domRef}>{this.renderCheckedArr()}</div>;
}
......
......@@ -45,6 +45,10 @@ const Demo1 = (props) => {
password: '78b7dc88f9f4bf19c2b1aabfdd995244',
pandavmsHost: 'ws://192.168.8.30:7000/',
address: 'C83178215',
params: {
name: 1,
title: 2,
}
};
let VideoParam1 = {
id: '38FB4BA7-C61F-466C-9B57-5B401441DABC',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment