ucservice 1.3.5 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ucservice.common.js +150 -6
- package/dist/ucservice.common.js.gz +0 -0
- package/dist/ucservice.common.js.map +1 -1
- package/dist/ucservice.css +1 -1
- package/dist/ucservice.umd.js +150 -6
- package/dist/ucservice.umd.js.gz +0 -0
- package/dist/ucservice.umd.js.map +1 -1
- package/dist/ucservice.umd.min.js +2 -2
- package/dist/ucservice.umd.min.js.gz +0 -0
- package/dist/ucservice.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/css/scooper.video.css +12 -0
- package/src/net_url/location_url.js +2 -1
- package/src/scooper.video.js +145 -10
package/dist/ucservice.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.video-main{position:absolute;top:0;left:-25px;right:-12px;bottom:-18px}.video-main-full{position:absolute;top:1px;left:1px;right:1px;bottom:1px}.video-main-full>li,.video-main>li{border:1px solid #aaa;float:left;position:relative}.video-main-full>li.loading,.video-main>li.loading{background:#000}.video-main-full>li:hover,.video-main>li:hover{border:1px solid #ffb951}.video-main-full>li.sel,.video-main>li.sel{border:1px solid #ef8601}.video-main-full.mode-1>li,.video-main.mode-1>li{width:98.5%;height:98.5%;list-style:none}.video-main-full.mode-1>li .info,.video-main.mode-1>li .info{font-size:20px;bottom:40px}.video-main.mode-4>li{width:49%;height:49%;list-style:none}.video-main.mode-4>li .info{font-size:18px;bottom:20px}.video-main.mode-6>li{width:33.33%;height:33.33%}.video-main.mode-6>li .info{font-size:14px;bottom:13px}.video-main.mode-6 .screen-1{width:66.66%;height:66.65%}.video-main.mode-6 .screen-1 .info{font-size:18px;bottom:30px}.video-main.mode-9>li{width:32.5%;height:32.5%;list-style:none}.video-main.mode-9>li .info{font-size:12px;bottom:14px}.video-main.mode-16>li{width:24.5%;height:24.5%;list-style:none}.video-main.mode-16>li .info{font-size:8px;bottom:10px}.video-box{-o-object-fit:fill;object-fit:fill;display:none;width:100%;height:100%}.stream-loading{width:200px;height:30px;line-height:30px;position:absolute;top:50%;left:50%;margin-top:-15px;margin-left:-100px;color:#fff;font-size:16px;padding-left:30px}.info{color:#fff;left:10px;width:67%}.info,.operate-btn{position:absolute;float:left;z-index:1}.operate-btn{width:24px;height:24x;right:1px;bottom:2px;cursor:pointer}.send-audio-btn,.unsend-audio-btn{
|
|
1
|
+
.video-main{position:absolute;top:0;left:-25px;right:-12px;bottom:-18px}.video-main-full{position:absolute;top:1px;left:1px;right:1px;bottom:1px}.video-main-full>li,.video-main>li{border:1px solid #aaa;float:left;position:relative}.video-main-full>li.loading,.video-main>li.loading{background:#000}.video-main-full>li:hover,.video-main>li:hover{border:1px solid #ffb951}.video-main-full>li.sel,.video-main>li.sel{border:1px solid #ef8601}.video-main-full.mode-1>li,.video-main.mode-1>li{width:98.5%;height:98.5%;list-style:none}.video-main-full.mode-1>li .info,.video-main.mode-1>li .info{font-size:20px;bottom:40px}.video-main.mode-4>li{width:49%;height:49%;list-style:none}.video-main.mode-4>li .info{font-size:18px;bottom:20px}.video-main.mode-6>li{width:33.33%;height:33.33%}.video-main.mode-6>li .info{font-size:14px;bottom:13px}.video-main.mode-6 .screen-1{width:66.66%;height:66.65%}.video-main.mode-6 .screen-1 .info{font-size:18px;bottom:30px}.video-main.mode-9>li{width:32.5%;height:32.5%;list-style:none}.video-main.mode-9>li .info{font-size:12px;bottom:14px}.video-main.mode-16>li{width:24.5%;height:24.5%;list-style:none}.video-main.mode-16>li .info{font-size:8px;bottom:10px}.video-box{-o-object-fit:fill;object-fit:fill;display:none;width:100%;height:100%}.stream-loading{width:200px;height:30px;line-height:30px;position:absolute;top:50%;left:50%;margin-top:-15px;margin-left:-100px;color:#fff;font-size:16px;padding-left:30px}.info{color:#fff;left:10px;width:67%}.info,.operate-btn{position:absolute;float:left;z-index:1}.operate-btn{width:24px;height:24x;right:1px;bottom:2px;cursor:pointer}.send-audio-btn,.unsend-audio-btn{bottom:-8px;right:70px;width:48px;height:48px}.rotate-btn,.send-audio-btn,.unsend-audio-btn{position:absolute;border:0;float:left;background-size:100% 100%;background-color:transparent}.rotate-btn{bottom:1px;right:76px;width:28px;height:28px}.recv-audio-btn,.unrecv-audio-btn{bottom:-8px;right:30px;width:48px;height:48px}.close-btn,.recv-audio-btn,.unrecv-audio-btn{position:absolute;border:0;float:left;background-size:100% 100%;background-color:transparent}.close-btn{bottom:5px;right:5px;width:20px;height:20px}.operation{position:absolute;width:100%;height:12%;bottom:0;background:rgba(0,0,0,.3);color:#fff}.hide{display:none}
|
package/dist/ucservice.umd.js
CHANGED
|
@@ -12464,7 +12464,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12464
12464
|
windowNums: num
|
|
12465
12465
|
});
|
|
12466
12466
|
me._opts.windows = num;
|
|
12467
|
-
me._opts.extra = extra;
|
|
12467
|
+
me._opts.extra = extra; //设置旋转了的视频样式
|
|
12468
12468
|
},
|
|
12469
12469
|
|
|
12470
12470
|
/**
|
|
@@ -13468,7 +13468,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13468
13468
|
this.dispatch('screenchange', {
|
|
13469
13469
|
windowNums: num,
|
|
13470
13470
|
flag: me._opts.flag
|
|
13471
|
-
});
|
|
13471
|
+
}); //设置旋转视频的样式
|
|
13472
|
+
|
|
13473
|
+
for (let k = 0; k < _li.length; k++) {
|
|
13474
|
+
let rotateIndex = _li.eq(k).find('button[name=rotateVideo]').attr('rotate-index');
|
|
13475
|
+
|
|
13476
|
+
if (rotateIndex != 0 && rotateIndex != 2) videoRotateSize(_li.eq(k), rotateIndex);
|
|
13477
|
+
}
|
|
13472
13478
|
},
|
|
13473
13479
|
|
|
13474
13480
|
/**
|
|
@@ -13879,7 +13885,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13879
13885
|
};
|
|
13880
13886
|
*/
|
|
13881
13887
|
_init: function ($dom, opts) {
|
|
13882
|
-
let me = this;
|
|
13888
|
+
let me = this; //保存dom元素的selector用作后续所有子集对象的定位(在多组件对讲模式下有用)
|
|
13889
|
+
|
|
13890
|
+
if ($dom.length == 0 || !me.getDomSelector($dom)) {
|
|
13891
|
+
console.error("父doom元素为空,无法进行视频初始化", $dom);
|
|
13892
|
+
return;
|
|
13893
|
+
} //配置项
|
|
13894
|
+
|
|
13883
13895
|
|
|
13884
13896
|
me._opts = {
|
|
13885
13897
|
windows: 4,
|
|
@@ -13936,11 +13948,134 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13936
13948
|
me._dbClickFullScreen();
|
|
13937
13949
|
},
|
|
13938
13950
|
|
|
13951
|
+
videoRotateSize(li, rotateIndex) {
|
|
13952
|
+
let video = li.querySelector('video');
|
|
13953
|
+
let videoWidth = video.videoWidth;
|
|
13954
|
+
let videoHeight = video.videoHeight;
|
|
13955
|
+
let vWidth = video.offsetWidth;
|
|
13956
|
+
let vHeight = video.offsetHeight;
|
|
13957
|
+
let liWidth = li.offsetWidth;
|
|
13958
|
+
let liHeight = li.offsetHeight;
|
|
13959
|
+
|
|
13960
|
+
if (rotateIndex == 0) {
|
|
13961
|
+
//0
|
|
13962
|
+
$(video).attr('class', 'video-box');
|
|
13963
|
+
$(video).css('height', '');
|
|
13964
|
+
$(video).css('width', 'auto');
|
|
13965
|
+
video.style.position = 'static';
|
|
13966
|
+
video.style.transform = 'none';
|
|
13967
|
+
$(video).css('left', '');
|
|
13968
|
+
$(video).css('top', '');
|
|
13969
|
+
} else if (rotateIndex == 3) {
|
|
13970
|
+
//3
|
|
13971
|
+
$(video).attr('class', 'video-box');
|
|
13972
|
+
video.style.position = 'absolute';
|
|
13973
|
+
video.style.transform = 'rotate(270deg)';
|
|
13974
|
+
|
|
13975
|
+
if (videoWidth / videoHeight > liWidth / liHeight) {
|
|
13976
|
+
//视频横向留白
|
|
13977
|
+
$(video).css('width', liHeight);
|
|
13978
|
+
$(video).css('height', 'auto');
|
|
13979
|
+
$(video).css('left', 'calc(' + liWidth + ' / 2' + ' - ' + liHeight + ' / 2)');
|
|
13980
|
+
$(video).css('top', 'calc(-' + liHeight / 2 + ' / ' + vWidth + ' * ' + vHeight + ' + ' + liHeight + ' / 2)');
|
|
13981
|
+
} else {
|
|
13982
|
+
//视频纵向留白
|
|
13983
|
+
$(video).css('height', liWidth);
|
|
13984
|
+
$(video).css('width', 'auto');
|
|
13985
|
+
$(video).css('left', 'calc(' + liHeight + ' / 2' + ' - ' + liWidth + ' / 2)');
|
|
13986
|
+
$(video).css('top', 'calc(-' + liWidth / 2 + ' / ' + vHeight + ' * ' + vWidth + ' + ' + liWidth + ' / 2)');
|
|
13987
|
+
}
|
|
13988
|
+
} else if (rotateIndex == 2) {
|
|
13989
|
+
//2
|
|
13990
|
+
$(video).attr('class', 'video-box');
|
|
13991
|
+
$(video).css('height', '');
|
|
13992
|
+
$(video).css('width', 'auto');
|
|
13993
|
+
video.style.position = 'static';
|
|
13994
|
+
video.style.transform = 'rotate(180deg)';
|
|
13995
|
+
$(video).css('left', '');
|
|
13996
|
+
$(video).css('top', '');
|
|
13997
|
+
} else if (rotateIndex == 1) {
|
|
13998
|
+
//1
|
|
13999
|
+
$(video).attr('class', 'video-box');
|
|
14000
|
+
video.style.position = 'absolute';
|
|
14001
|
+
video.style.transform = 'rotate(90deg)';
|
|
14002
|
+
|
|
14003
|
+
if (videoWidth / videoHeight > liWidth / liHeight) {
|
|
14004
|
+
//视频横向留白
|
|
14005
|
+
$(video).css('width', liHeight);
|
|
14006
|
+
$(video).css('height', 'auto');
|
|
14007
|
+
$(video).css('left', 'calc(' + liWidth + ' / 2' + ' - ' + liHeight + ' / 2)');
|
|
14008
|
+
$(video).css('top', 'calc(-' + liHeight / 2 + ' / ' + vWidth + ' * ' + vHeight + ' + ' + liHeight + ' / 2)');
|
|
14009
|
+
} else {
|
|
14010
|
+
//视频纵向留白
|
|
14011
|
+
$(video).css('height', liWidth);
|
|
14012
|
+
$(video).css('width', 'auto');
|
|
14013
|
+
$(video).css('left', 'calc(' + liHeight + ' / 2' + ' - ' + liWidth + ' / 2)');
|
|
14014
|
+
$(video).css('top', 'calc(-' + liWidth / 2 + ' / ' + vHeight + ' * ' + vWidth + ' + ' + liWidth + ' / 2)');
|
|
14015
|
+
}
|
|
14016
|
+
}
|
|
14017
|
+
},
|
|
14018
|
+
|
|
14019
|
+
/**
|
|
14020
|
+
* 获取父窗口传入dom的唯一selector(针对jquery高版本dom对象没有selector属性的问题)
|
|
14021
|
+
* @param $dom
|
|
14022
|
+
* @return {boolean}
|
|
14023
|
+
*/
|
|
14024
|
+
getDomSelector: function ($dom) {
|
|
14025
|
+
var me = this;
|
|
14026
|
+
|
|
14027
|
+
if ($dom.selector) {
|
|
14028
|
+
me.selector = $dom.selector;
|
|
14029
|
+
} else {
|
|
14030
|
+
if ($dom.attr("id")) {
|
|
14031
|
+
me.selector = "#" + $dom.attr("id");
|
|
14032
|
+
} else {
|
|
14033
|
+
if (!$dom.attr("class")) return false;
|
|
14034
|
+
var classNames = $dom.attr("class").split(/\s+/);
|
|
14035
|
+
$.each(classNames, function (i, className) {
|
|
14036
|
+
if ($("." + className).length == 1) {
|
|
14037
|
+
me.selector = "." + className;
|
|
14038
|
+
return true;
|
|
14039
|
+
}
|
|
14040
|
+
});
|
|
14041
|
+
}
|
|
14042
|
+
}
|
|
14043
|
+
|
|
14044
|
+
if (!me.selector) return false;else return true;
|
|
14045
|
+
},
|
|
14046
|
+
|
|
13939
14047
|
/**
|
|
13940
14048
|
* 初始化按钮点击事件
|
|
13941
14049
|
*/
|
|
13942
14050
|
_initBtnEvent: function () {
|
|
13943
|
-
let me = this;
|
|
14051
|
+
let me = this; // 设置视频窗可拖拽
|
|
14052
|
+
|
|
14053
|
+
var src = null;
|
|
14054
|
+
$(me.selector + ' li').bind("dragstart", function (ev) {
|
|
14055
|
+
src = $(this);
|
|
14056
|
+
});
|
|
14057
|
+
$(me.selector + ' li').bind("dragover", function (ev) {
|
|
14058
|
+
ev.preventDefault();
|
|
14059
|
+
});
|
|
14060
|
+
$(me.selector + ' li').bind("drop", function (ev) {
|
|
14061
|
+
ev.preventDefault();
|
|
14062
|
+
|
|
14063
|
+
if (src.prop("outerHTML") === $(this).prop("outerHTML")) {
|
|
14064
|
+
return;
|
|
14065
|
+
}
|
|
14066
|
+
|
|
14067
|
+
var target = $(this);
|
|
14068
|
+
var srcIndex = src.index();
|
|
14069
|
+
var targetIndex = target.index();
|
|
14070
|
+
|
|
14071
|
+
if (srcIndex > targetIndex) {
|
|
14072
|
+
src.insertBefore(target);
|
|
14073
|
+
target.insertAfter($(me.selector + ' .video-main li.screen').eq(srcIndex));
|
|
14074
|
+
} else {
|
|
14075
|
+
src.insertAfter(target);
|
|
14076
|
+
target.insertBefore($(me.selector + ' .video-main li.screen').eq(srcIndex));
|
|
14077
|
+
}
|
|
14078
|
+
});
|
|
13944
14079
|
let videoFlagObj = $('[video-flag="' + me._opts.windowsBeginIndex + '"]'); //锁定视频事件
|
|
13945
14080
|
|
|
13946
14081
|
videoFlagObj.find("button[name='lockVideo']").click(function () {
|
|
@@ -13958,6 +14093,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13958
14093
|
me.VIDEO_DATA[index].isLockVideo = true;
|
|
13959
14094
|
$(this).attr('class', 'lock-video-btn');
|
|
13960
14095
|
}
|
|
14096
|
+
});
|
|
14097
|
+
videoFlagObj.find('button[name=rotateVideo]').click(function () {
|
|
14098
|
+
let rotateIndex = Number($(this).attr("rotate-index"));
|
|
14099
|
+
rotateIndex++;
|
|
14100
|
+
$(this).attr("rotate-index", rotateIndex % 4);
|
|
14101
|
+
let li = $(this).parent().parent()[0];
|
|
14102
|
+
videoRotateSize(li, rotateIndex);
|
|
13961
14103
|
}); //接收音频事件
|
|
13962
14104
|
|
|
13963
14105
|
videoFlagObj.find("button[name='recvAudio']").click(function () {
|
|
@@ -14194,7 +14336,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14194
14336
|
for (let i = index; i < index + me._opts.windowsNum; i++) {
|
|
14195
14337
|
videoHtml += '<li class="screen-' + i + '" index="' + (i - 1) + '"><video class="video-box" id="video-' + i + '" autoplay ></video>' + '<div class="info hide" id="info-' + i + '"></div>' + '<div class="operate-btn">'; //videoHtml +='<button type="button" class="unlock-video-btn hide" name="lockVideo"></button>';
|
|
14196
14338
|
|
|
14197
|
-
checkUserMediaAvailable() && (videoHtml += '<button type="button" class="unsend-audio-btn hide" name="sendAudio"></button>');
|
|
14339
|
+
checkUserMediaAvailable() && (videoHtml += '<button type="button" class="rotate-btn hide" name="rotateVideo" rotate-index="0"></button><button type="button" class="unsend-audio-btn hide" name="sendAudio"></button>');
|
|
14198
14340
|
videoHtml += '<button type="button" class="unrecv-audio-btn hide" name="recvAudio"></button>' + '<button type="button" class="close-btn hide" name="closeVideo"></button>' + '</div>' + '</li>';
|
|
14199
14341
|
}
|
|
14200
14342
|
|
|
@@ -28448,7 +28590,9 @@ let location_url_location = {
|
|
|
28448
28590
|
requestParam: {
|
|
28449
28591
|
mapId: '',
|
|
28450
28592
|
//地图类型
|
|
28451
|
-
|
|
28593
|
+
kw: '',
|
|
28594
|
+
//关键字
|
|
28595
|
+
layers: '' //设备类型 可选
|
|
28452
28596
|
|
|
28453
28597
|
},
|
|
28454
28598
|
responseParam: {
|
package/dist/ucservice.umd.js.gz
CHANGED
|
Binary file
|