diff --git a/commons/base/src/main/ets/utils/AvPlayerUtil.ets b/commons/base/src/main/ets/utils/AvPlayerUtil.ets index c08657c4932323f6429dbf4a085db9f325e6f27f..8f16786299902c182ad62c39e2857a7ae86082e6 100644 --- a/commons/base/src/main/ets/utils/AvPlayerUtil.ets +++ b/commons/base/src/main/ets/utils/AvPlayerUtil.ets @@ -230,7 +230,7 @@ export class AvPlayerUtil { playerStateControl(): void { if (this.avPlayer === undefined) { - Logger.error(`AvPlayer is undefined`); + Logger.info(`AvPlayer is undefined`); return; } if (this.avPlayer.state === CommonConstants.AV_PLAYER_STOPPED_STATE) { diff --git a/features/videoDetail/src/main/ets/view/VideoDetail.ets b/features/videoDetail/src/main/ets/view/VideoDetail.ets index 6a120cd6dd9f9d4653abf2e34199c9aae769eba3..ac02cc99e33b8967cd54b7be725c96729afd9058 100644 --- a/features/videoDetail/src/main/ets/view/VideoDetail.ets +++ b/features/videoDetail/src/main/ets/view/VideoDetail.ets @@ -50,8 +50,11 @@ export struct VideoDetail { this.windowUtil.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); if (data === display.FoldStatus.FOLD_STATUS_HALF_FOLDED) { this.isHalfFolded = true; - // Full-screen playback. - this.pageInfo.pushPath({ name: 'VideoPlayer' }); + let orientation: display.Orientation = display.getDefaultDisplaySync().orientation; + if (orientation === display.Orientation.LANDSCAPE || orientation === display.Orientation.LANDSCAPE_INVERTED) { + // Full-screen playback. + this.pageInfo.pushPath({ name: 'VideoPlayer' }); + } } else { this.isHalfFolded = false; } diff --git a/features/videoPlayer/src/main/ets/view/VideoPlayer.ets b/features/videoPlayer/src/main/ets/view/VideoPlayer.ets index 0b289fed5ddcdbf7336313ff45b8599d6bd1f8c8..da093cafede45a25b492713c76d6eed5681cf591 100644 --- a/features/videoPlayer/src/main/ets/view/VideoPlayer.ets +++ b/features/videoPlayer/src/main/ets/view/VideoPlayer.ets @@ -117,10 +117,6 @@ export struct VideoPlayer { controller: this.xComponentController }) .onLoad(() => { - this.xComponentController.setXComponentSurfaceSize({ - surfaceWidth: CommonConstants.X_COMPONENT_SURFACE_WIDTH, surfaceHeight: - CommonConstants.X_COMPONENT_SURFACE_HEIGHT - }); this.surfaceId = this.xComponentController.getXComponentSurfaceId(); this.avPlayerUtil.createAvPlayer(this.surfaceId, true); })