diff --git a/entry/src/main/ets/pages/VideoPlay.ets b/entry/src/main/ets/pages/VideoPlay.ets index 90e7e427a58cb66c559d7f17b746d1046ae23d1a..302da590213c0c0bb18d3adbc873d3e592a3f874 100644 --- a/entry/src/main/ets/pages/VideoPlay.ets +++ b/entry/src/main/ets/pages/VideoPlay.ets @@ -41,7 +41,7 @@ function msgType() { export struct PlayVideo { @Consume('pageInfos') pageInfos: NavPathStack; @State curState: string = ''; - @State curError: string = ''; + @State curError: ResourceStr = ''; @State buttonAction: string = ''; @State isAutoPull: boolean = false; @State isLightBackground: boolean = false; @@ -110,25 +110,25 @@ export struct PlayVideo { switch (state) { case PiPWindow.PiPState.ABOUT_TO_START: this.curState = 'ABOUT_TO_START'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.STARTED: this.curState = 'STARTED'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.ABOUT_TO_STOP: this.curState = 'ABOUT_TO_STOP'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.STOPPED: this.player?.updatePlayStatus(true); this.player?.play(); this.curState = 'STOPPED'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.ABOUT_TO_RESTORE: this.curState = 'ABOUT_TO_RESTORE'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.ERROR: this.curState = 'ERROR'; @@ -270,8 +270,9 @@ export struct PlayVideo { CallbackMessage() { Column({ space: Constants.SPACE }) { Text($r('app.string.callback_message')) + .width(Constants.CONTROL_WIDTH) .fontColor($r('app.color.Text_color')) - .padding({ right: $r('app.integer.callback_text_padding') }) + .padding({ left: $r('app.integer.other_padding') }) Column() { Text($r('app.string.current_status')) .textType() diff --git a/entry/src/main/ets/pages/WindowPip.ets b/entry/src/main/ets/pages/WindowPip.ets index f7cc5f843a3825ec7c572fe40a24a00f774b26f4..02f9151424fe6c49ef36dd2377cac5259895f56c 100644 --- a/entry/src/main/ets/pages/WindowPip.ets +++ b/entry/src/main/ets/pages/WindowPip.ets @@ -36,7 +36,7 @@ struct ImageWidthTitle { .alignItems(HorizontalAlign.Start) .onClick(() => { getContext().eventHub.emit('onStateChange', true); - this.pageInfos?.pushPath({ name: Constants.NAV_DESTINATION_NAME }); + this.pageInfos?.pushPath({ name: Constants.NAV_DESTINATION_NAME }, { launchMode: 3 }); }) .onAreaChange((oldArea, newArea) => { let width = newArea.width as number; diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 07503114a533e456fc007caa8f14880c4448a9e3..524d7ae334bc7e7ba6e922fb570c636026e5b2de 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "module_desc", - "value": "模块描述" + "value": "module description" }, { "name": "EntryAbility_desc", @@ -14,67 +14,71 @@ }, { "name": "video1", - "value": "视频1" + "value": "Video1" }, { "name": "video2", - "value": "视频2" + "value": "Video2" }, { "name": "video3", - "value": "视频3" + "value": "Video3" }, { "name": "video4", - "value": "视频4" + "value": "Video4" }, { "name": "video5", - "value": "视频5" + "value": "Video5" }, { - "name": "video6", - "value": "视频6" + "name": "video6", + "value": "Video6" }, { "name": "video7", - "value": "视频7" + "value": "Video7" }, { "name": "pip_demo", - "value": "画中画示例" + "value": "WindowPiP" }, { "name": "start", - "value": "开启" + "value": "Start" }, { "name": "stop", - "value": "关闭" + "value": "Stop" }, { "name": "auto", - "value": "自动启动画中画" + "value": "Auto" }, { "name": "current_status", - "value": "当前状态:" + "value": "Current Status" }, { - "name": "current_error", - "value": "错误原因:" + "name": "current_error", + "value": "Current Error" }, { "name": "current_action", - "value": "按钮事件和状态:" + "value": "Current Action" }, { "name": "callback_message", - "value": "回调信息" + "value": "Callback Message" }, { "name": "current_video_pip_play", - "value": "当前视频正在画中画播放" + "value": "Current Video Pip Play" + }, + { + "name": "current_error_hint", + "value": "Without" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json index 79783e15e9b1f94f57aaea8b4187e2b5c7a8aab9..524d7ae334bc7e7ba6e922fb570c636026e5b2de 100644 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -10,71 +10,75 @@ }, { "name": "EntryAbility_label", - "value": "WimdowPiP" + "value": "WindowPiP" }, { "name": "video1", - "value": "video1" + "value": "Video1" }, { "name": "video2", - "value": "video2" + "value": "Video2" }, { "name": "video3", - "value": "video3" + "value": "Video3" }, { "name": "video4", - "value": "video4" + "value": "Video4" }, { "name": "video5", - "value": "video5" + "value": "Video5" }, { "name": "video6", - "value": "video6" + "value": "Video6" }, { "name": "video7", - "value": "video7" + "value": "Video7" }, { "name": "pip_demo", - "value": "pipDemo" + "value": "WindowPiP" }, { "name": "start", - "value": "start" + "value": "Start" }, { "name": "stop", - "value": "stop" + "value": "Stop" }, { "name": "auto", - "value": "auto" + "value": "Auto" }, { "name": "current_status", - "value": "current status" + "value": "Current Status" }, { "name": "current_error", - "value": "current error" + "value": "Current Error" }, { "name": "current_action", - "value": "current action" + "value": "Current Action" }, { "name": "callback_message", - "value": "callback message" + "value": "Callback Message" }, { "name": "current_video_pip_play", - "value": "current video pip play" + "value": "Current Video Pip Play" + }, + { + "name": "current_error_hint", + "value": "Without" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index c1d6a5a16120410f0d11e9cb4142c0828e8f0c67..3e368b8b09eadc9d8a6ff0c45ebb76528e846744 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -76,6 +76,10 @@ { "name": "current_video_pip_play", "value": "当前视频正在画中画播放" + }, + { + "name": "current_error_hint", + "value": "无" } ] } \ No newline at end of file