chenjun

体育-广东体育-小视频撑到顶部,修复折叠屏带出的问题

@@ -160,11 +160,14 @@ export struct WDPlayerRenderView { @@ -160,11 +160,14 @@ export struct WDPlayerRenderView {
160 if (info.size.width > 0 && info.size.height > 0) { 160 if (info.size.width > 0 && info.size.height > 0) {
161 161
162 if (!this.liftVideo) { 162 if (!this.liftVideo) {
  163 + let ratio = this.videoWidth / this.videoHeight
  164 + const height = info.size.width / ratio
  165 + Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height)
163 if (this.videoHeight > 0 && this.videoWidth > 0) { 166 if (this.videoHeight > 0 && this.videoWidth > 0) {
164 this.xComponentController.setXComponentSurfaceRect({ 167 this.xComponentController.setXComponentSurfaceRect({
165 surfaceWidth: info.size.width, 168 surfaceWidth: info.size.width,
166 surfaceHeight: info.size.width / this.videoRatio, 169 surfaceHeight: info.size.width / this.videoRatio,
167 - offsetY: this.isPad ? this.topSafeHeight : 0 170 + offsetY: this.isPad ? this.topSafeHeight : (info.size.height - height) / 2
168 }); 171 });
169 return 172 return
170 } 173 }