49 lines
1.7 KiB
JavaScript
49 lines
1.7 KiB
JavaScript
|
|
function ciy_chart_video1_c1(opdata) {
|
|
this.func = ['video_play'];
|
|
this.lastdata = {};
|
|
this.resize = function () {
|
|
vwidth = opdata.container.width();
|
|
var hei = vwidth * 2 / 3;
|
|
if(hei > opdata.container.height()){
|
|
vwidth = opdata.container.height() * 3 / 2;
|
|
$5('[data-video]', opdata.container).width(vwidth + 'px');
|
|
$5('[data-video]', opdata.container).height(opdata.container.height() + 'px');
|
|
}else{
|
|
$5('[data-video]', opdata.container).height(hei + 'px');
|
|
}
|
|
}
|
|
this.errdata = function (funame, data) {
|
|
if (!data)
|
|
return;
|
|
ciy_alert(data.errmsg);
|
|
}
|
|
this.setdata = function (funame, data) {
|
|
if (!data)
|
|
return;
|
|
console.log(data);
|
|
this.lastdata[funame] = data;
|
|
$5('#tmpimg').attr('src', data.url);
|
|
// playr = new EZUIKit.EZUIKitPlayer({
|
|
// id: 'video-container', // 视频容器ID
|
|
// accessToken: data.accesstoken,
|
|
// url: data.url,
|
|
// template: 'standard', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题;
|
|
// width: vwidth,
|
|
// height: vwidth * 2 / 3,
|
|
// });
|
|
}
|
|
this.distory = function () {
|
|
if(playr)
|
|
playr.stop();
|
|
}
|
|
var playr;
|
|
var vwidth;
|
|
opdata.container.append(`<div class="brimg" style="overflow:hidden;">
|
|
<div data-video style="background:#00000011;margin: auto;">
|
|
<img id="tmpimg" style="width:100%;height:100%;"/>
|
|
<!--<div id="video-container" style="width:100%;height:100%;"></div>-->
|
|
</div>
|
|
</div>`);
|
|
this.resize();
|
|
} |