Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd0e5c4

Browse files
committed
[CHG]支持控制条变量参数
1 parent 3fb5339 commit dd0e5c4

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

demos/base-demo/ezuikit.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
var domElement = document.getElementById(id); // 间隙
202202

203203
domElement.style.fontSize = 0;
204+
domElement.style.position = 'relative';
204205
/**
205206
* 渲染iframe视频框
206207
*/
@@ -210,9 +211,17 @@
210211
function matchIframeUrl() {
211212
switch (_this.opt.template) {
212213
case 'simple':
213-
return domain + "/ezopen/h5/iframe?url=" + _this.opt.url + "&autoplay=" + _this.opt.autoplay + "&audio=" + _this.opt.audio + "&accessToken=" + params.accessToken + "&templete=0" + "&id=" + id;
214-
// return "https://open.ys7.com/ezopen/h5/iframe?url=" + _this.opt.url + "&autoplay=" + _this.opt.autoplay + "&audio=" + _this.opt.audio + "&accessToken=" + params.accessToken + "&templete=0";
215-
214+
var iframeUrl = domain + "/ezopen/h5/iframe?url=" + _this.opt.url + "&autoplay=" + _this.opt.autoplay + "&audio=" + _this.opt.audio + "&accessToken=" + params.accessToken + "&templete=0" + "&id=" + id;
215+
var controlsValue = "";
216+
if(typeof params.controls !== 'undefined' && params.controls){
217+
console.log("typeof" ,typeof params.controls)
218+
controlsValue = "play,voice,hd,fullScreen";
219+
if(params.controls.length > 0){
220+
controlsValue = params.controls.join(",")
221+
}
222+
}
223+
iframeUrl += ('&controls=' + controlsValue);
224+
return iframeUrl;
216225
case 'standard':
217226
return domain + "/ezopen/h5/iframe?url=" + _this.opt.url + "&autoplay=" + _this.opt.autoplay + "&audio=" + _this.opt.audio + "&accessToken=" + params.accessToken + "&templete=1" + "&id=" + id;
218227

demos/base-demo/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ <h2>视频模式使用示例:</h2>
2929
<script>
3030
var playr = new EZUIKit.EZUIKitPlayer({
3131
id: 'video-container', // 视频容器ID
32-
accessToken: 'at.cjmuwh413lljm6jw1mir4u9fbpm4g9vk-6ez1aw1pk9-1uf4k1l-cipwouvzo',
33-
url: 'ezopen://open.ys7.com/E21631277/1.live',
32+
accessToken: 'at.9qq8pk2c1b678ko06xs3p7emcbs0esju-2o9y4h8ra2-0o71n3u-pzelt3dwv',
33+
url: 'ezopen://open.ys7.com/D88600067/1.live',
3434
template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版;
3535
autoplay: true,
3636
// 视频上方头部控件
37-
//header: ['capturePicture','save','zoom'], // 如果templete参数不为simple,该字段将被覆盖
37+
header: ['capturePicture','save','zoom'], // 如果templete参数不为simple,该字段将被覆盖
3838
// 视频下方底部控件
39-
footer: ['talk','broadcast','hd','fullScreen'], // 如果template参数不为simple,该字段将被覆盖
40-
audio: 1, // 是否默认开启声音 0 - 关闭 1 - 开启
39+
footer: ['talk','broadcast'], // 如果template参数不为simple,该字段将被覆盖
40+
// audio: 1, // 是否默认开启声音 0 - 关闭 1 - 开启
4141
plugin: ['talk'], // 加载插件,talk-对讲
42+
controls: true,//['play','voice','hd','fullScreen'], // 视频控制相关控件,如果template参数不为simple,该字段将被覆盖
4243
openSoundCallBack: (data) => console.log("开启声音回调",data),
4344
closeSoundCallBack: (data) => console.log("关闭声音回调",data),
4445
startSaveCallBack: (data) => console.log("开始录像回调",data),

0 commit comments

Comments
 (0)