ucservice 1.5.1 → 1.5.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ucservice",
3
3
  "private": false,
4
- "version": "1.5.1",
4
+ "version": "1.5.4",
5
5
  "description": "统一通信服务",
6
6
  "main": "dist/ucservice.common.js",
7
7
  "style": "ucservice.css",
@@ -1327,10 +1327,52 @@
1327
1327
  if (count == 40) {
1328
1328
  clearInterval(index);
1329
1329
  _self._init($dom,opts);
1330
+ let resizeObserver = new ResizeObserver(function( entries ) {
1331
+ // console.log(entries)
1332
+ entries.forEach((item, index) =>{
1333
+ let target = item.target
1334
+ let videoLi = document.querySelector(me.selector).querySelectorAll('li')
1335
+ _self.VIDEO_DATA.forEach((item, index) => {
1336
+ let tel = item.video
1337
+ if (!tel&&item.id) {
1338
+ videoLi[index].querySelector('video').style = ''
1339
+ videoLi[index].querySelector('.rotate-btn').setAttribute('rotate-index', 0)
1340
+ }else{
1341
+ let rotateIndex = $(videoLi[index]).find('button[name=rotateVideo]').attr('rotate-index')
1342
+ setTimeout(() => {
1343
+ _self.videoRotateSize(videoLi[index], rotateIndex);
1344
+ }, 200);
1345
+ }
1346
+ })
1347
+ })
1348
+ })
1349
+ // 监听dom
1350
+ resizeObserver.observe(document.querySelector(_self.selector))
1330
1351
  } else {
1331
1352
  if (window.checkAudioDevicesStatus) {
1332
1353
  clearInterval(index);
1333
1354
  _self._init($dom,opts);
1355
+ let resizeObserver = new ResizeObserver(function( entries ) {
1356
+ // console.log(entries)
1357
+ entries.forEach((item, index) =>{
1358
+ let target = item.target
1359
+ let videoLi = document.querySelector(me.selector).querySelectorAll('li')
1360
+ _self.VIDEO_DATA.forEach((item, index) => {
1361
+ let tel = item.video
1362
+ if (!tel&&item.id) {
1363
+ videoLi[index].querySelector('video').style = ''
1364
+ videoLi[index].querySelector('.rotate-btn').setAttribute('rotate-index', 0)
1365
+ }else{
1366
+ let rotateIndex = $(videoLi[index]).find('button[name=rotateVideo]').attr('rotate-index')
1367
+ setTimeout(() => {
1368
+ _self.videoRotateSize(videoLi[index], rotateIndex);
1369
+ }, 200);
1370
+ }
1371
+ })
1372
+ })
1373
+ })
1374
+ // 监听dom
1375
+ resizeObserver.observe(document.querySelector(_self.selector))
1334
1376
  }
1335
1377
  }
1336
1378
  count++;
@@ -1610,7 +1652,7 @@
1610
1652
  this.dispatch('screenchange', {windowNums:num, flag:me._opts.flag});
1611
1653
 
1612
1654
  //设置旋转了的视频样式
1613
- let videoLi = document.getElementById('videoRef').querySelectorAll('li')
1655
+ let videoLi = document.querySelector(me.selector).querySelectorAll('li')
1614
1656
  me.VIDEO_DATA.forEach((item, index) => {
1615
1657
  let tel = item.video
1616
1658
  if (!tel&&item.id) {
@@ -1621,11 +1663,11 @@
1621
1663
  //设置旋转视频的样式
1622
1664
  for(let k = 0; k < _li.length; k++){
1623
1665
  let rotateIndex = _li.eq(k).find('button[name=rotateVideo]').attr('rotate-index');
1624
- if(rotateIndex != 0 && rotateIndex != 2){
1666
+ // if(rotateIndex != 0 && rotateIndex != 2){
1625
1667
  setTimeout(() => {
1626
1668
  me.videoRotateSize(_li.eq(k)[0], rotateIndex);
1627
1669
  }, 200);
1628
- }
1670
+ // }
1629
1671
  }
1630
1672
 
1631
1673
  },
@@ -2388,8 +2430,8 @@
2388
2430
  videoFlagObj.find("button[name='closeVideo']").click(function(){
2389
2431
  let index = Number($(this).parent().parent().attr("index"));
2390
2432
  me.close(index);
2391
- //jquery方式阻止默认事件 & 冒泡事件
2392
- return false;
2433
+ // //jquery方式阻止默认事件 & 冒泡事件
2434
+ // return false;
2393
2435
  });
2394
2436
  },
2395
2437
  /**