ucservice 2.5.2 → 2.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.
@@ -14180,6 +14180,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14180
14180
 
14181
14181
  videoRotateSize(li, rotateIndex) {
14182
14182
  if (!li) return;
14183
+ let isScale = video.classList.contains('scale-scene');
14184
+
14185
+ if (isScale) {
14186
+ if (rotateIndex == 0 || rotateIndex == 2) {
14187
+ $(video).css('height', '100%');
14188
+ $(video).css('width', '100%');
14189
+ } else if (rotateIndex == 1 || rotateIndex == 3) {
14190
+ $(video).css('height', liWidth);
14191
+ $(video).css('width', liHeight);
14192
+ }
14193
+ }
14194
+
14183
14195
  let video = li.querySelector('video');
14184
14196
  let videoWidth = video.videoWidth;
14185
14197
  let videoHeight = video.videoHeight;
@@ -14187,13 +14199,15 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14187
14199
  let vHeight = video.offsetHeight;
14188
14200
  let liWidth = li.offsetWidth;
14189
14201
  let liHeight = li.offsetHeight;
14190
- let isScale = video.classList.contains('scale-scene');
14191
14202
 
14192
14203
  if (rotateIndex == 0) {
14193
14204
  //0
14194
14205
  // $(video).attr('class', 'video-box');
14195
- $(video).css('height', 'auto');
14196
- $(video).css('width', 'auto');
14206
+ if (!isScale) {
14207
+ $(video).css('height', 'auto');
14208
+ $(video).css('width', 'auto');
14209
+ }
14210
+
14197
14211
  $(video).css('max-height', '100%');
14198
14212
  $(video).css('max-width', '100%');
14199
14213
  video.style.position = 'absolute';
@@ -14201,11 +14215,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14201
14215
  $(video).css('top', '50%');
14202
14216
  if (videoWidth / videoHeight < liWidth / liHeight) $(video).css('height', '100%');else $(video).css('width', '100%');
14203
14217
  video.style.transform = 'translate(-50%, -50%)';
14204
-
14205
- if (isScale) {
14206
- $(video).css('height', '100%');
14207
- $(video).css('width', '100%');
14208
- }
14209
14218
  } else if (rotateIndex == 3) {
14210
14219
  //3
14211
14220
  // $(video).attr('class', 'video-box');
@@ -14216,27 +14225,31 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14216
14225
 
14217
14226
  if (videoHeight * liHeight / videoWidth < liWidth) {
14218
14227
  //视频横向留白
14219
- $(video).css('width', liHeight);
14220
- $(video).css('height', 'auto');
14228
+ if (!isScale) {
14229
+ $(video).css('width', liHeight);
14230
+ $(video).css('height', 'auto');
14231
+ }
14232
+
14221
14233
  $(video).css('left', 'calc(' + liWidth + 'px / 2' + ' - ' + liHeight + 'px / 2)');
14222
14234
  $(video).css('top', 'calc(-' + videoHeight * liHeight / videoWidth / 2 + 'px + ' + liHeight + 'px / 2)');
14223
14235
  } else {
14224
14236
  //视频纵向留白
14225
- $(video).css('width', 'auto');
14226
- $(video).css('height', liWidth);
14237
+ if (!isScale) {
14238
+ $(video).css('width', 'auto');
14239
+ $(video).css('height', liWidth);
14240
+ }
14241
+
14227
14242
  $(video).css('left', 'calc(-' + videoWidth * liWidth / videoHeight / 2 + 'px + ' + liWidth + 'px / 2)');
14228
14243
  $(video).css('top', 'calc(' + liHeight + 'px / 2' + ' - ' + liWidth + 'px / 2)');
14229
14244
  }
14230
-
14231
- if (isScale) {
14232
- $(video).css('height', liWidth);
14233
- $(video).css('width', liHeight);
14234
- }
14235
14245
  } else if (rotateIndex == 2) {
14236
14246
  //2
14237
14247
  // $(video).attr('class', 'video-box');
14238
- $(video).css('height', 'auto');
14239
- $(video).css('width', 'auto');
14248
+ if (!isScale) {
14249
+ $(video).css('height', 'auto');
14250
+ $(video).css('width', 'auto');
14251
+ }
14252
+
14240
14253
  $(video).css('max-height', '100%');
14241
14254
  $(video).css('max-width', '100%');
14242
14255
  video.style.position = 'absolute';
@@ -14244,11 +14257,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14244
14257
  $(video).css('top', '50%');
14245
14258
  if (videoWidth / videoHeight < liWidth / liHeight) $(video).css('height', '100%');else $(video).css('width', '100%');
14246
14259
  video.style.transform = 'translate(-50%, -50%) rotate(180deg)';
14247
-
14248
- if (isScale) {
14249
- $(video).css('height', '100%');
14250
- $(video).css('width', '100%');
14251
- }
14252
14260
  } else if (rotateIndex == 1) {
14253
14261
  //1
14254
14262
  // $(video).attr('class', 'video-box');
@@ -14259,22 +14267,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14259
14267
 
14260
14268
  if (videoHeight * liHeight / videoWidth < liWidth) {
14261
14269
  //视频横向留白
14262
- $(video).css('width', liHeight);
14263
- $(video).css('height', 'auto');
14270
+ if (!isScale) {
14271
+ $(video).css('width', liHeight);
14272
+ $(video).css('height', 'auto');
14273
+ }
14274
+
14264
14275
  $(video).css('left', 'calc(' + liWidth + 'px / 2' + ' - ' + liHeight + 'px / 2)');
14265
14276
  $(video).css('top', 'calc(-' + videoHeight * liHeight / videoWidth / 2 + 'px + ' + liHeight + 'px / 2)');
14266
14277
  } else {
14267
14278
  //视频纵向留白
14268
- $(video).css('width', 'auto');
14269
- $(video).css('height', liWidth);
14279
+ if (!isScale) {
14280
+ $(video).css('width', 'auto');
14281
+ $(video).css('height', liWidth);
14282
+ }
14283
+
14270
14284
  $(video).css('left', 'calc(-' + videoWidth * liWidth / videoHeight / 2 + 'px + ' + liWidth + 'px / 2)');
14271
14285
  $(video).css('top', 'calc(' + liHeight + 'px / 2' + ' - ' + liWidth + 'px / 2)');
14272
14286
  }
14273
-
14274
- if (isScale) {
14275
- $(video).css('height', liWidth);
14276
- $(video).css('width', liHeight);
14277
- }
14278
14287
  }
14279
14288
  },
14280
14289
 
@@ -14353,7 +14362,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14353
14362
  $(this).attr('title', '视频画面铺满');
14354
14363
  }
14355
14364
 
14356
- me.videoRotateSize($(this).parent().parent(), $(this).parent().find('button[name=rotateVideo]').attr('rotate-index'));
14365
+ me.videoRotateSize($(this).parent().parent()[0], $(this).parent().find('button[name=rotateVideo]').attr('rotate-index'));
14357
14366
  $(this).toggleClass("bggray"); //jquery方式阻止默认事件 & 冒泡事件
14358
14367
 
14359
14368
  return false;
@@ -14369,7 +14378,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
14369
14378
  $(this).attr('title', '全屏');
14370
14379
  }
14371
14380
 
14372
- me.videoRotateSize($(this).parent().parent(), $(this).parent().find('button[name=rotateVideo]').attr('rotate-index')); //jquery方式阻止默认事件 & 冒泡事件
14381
+ me.videoRotateSize($(this).parent().parent()[0], $(this).parent().find('button[name=rotateVideo]').attr('rotate-index')); //jquery方式阻止默认事件 & 冒泡事件
14373
14382
  // return false;
14374
14383
  }); //接收音频事件
14375
14384
 
Binary file