Showing
1 changed file
with
4 additions
and
1 deletions
| @@ -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 | } |
-
Please register or login to post a comment