陈剑华

Merge remote-tracking branch 'origin/main'

... ... @@ -165,15 +165,15 @@ export struct WdWebLocalComponent {
// 暂停音频悬浮窗
pauseAudioCom() {
// 判断当前窗口是否已显示,使用callback异步回调。
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
return;
}
try {
let data = this.AudioSuspension.floatWindowClass.get().isWindowShowing();
// console.info(TAG, 'window is showing: ' + data);
if(data) {
this.AudioSuspension.playerController.get()?.pause();
}
});
} catch (exception) {
console.error(TAG, `Failed to check whether the window is showing. Cause code: ${exception.code}, message: ${exception.message}`);
}
}
//播放视频
private setCurrentPageOperate9: (data: Message) => void = (data) => {
... ...
... ... @@ -73,13 +73,9 @@ export class AudioSuspensionModel {
// 显示悬浮窗。
public showWindow() {
// 判断当前窗口是否已显示,使用callback异步回调。
this.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
try {
let data = this.floatWindowClass.get().isWindowShowing();
// console.info(TAG, 'window is showing: ' + data);
if(data === false) {
// 显示当前窗口,使用callback异步回调。
this.floatWindowClass.get().showWindow((err: BusinessError) => {
... ... @@ -91,7 +87,9 @@ export class AudioSuspensionModel {
// console.info(TAG, 'floatWindowClass Succeeded in showing the window.');
});
}
});
} catch (exception) {
console.error(TAG, `Failed to check whether the window is showing. Cause code: ${exception.code}, message: ${exception.message}`);
}
}
// 设置悬浮窗尺寸
... ...
... ... @@ -173,19 +173,17 @@ export struct DetailPlayLiveCommon {
// 判断当前窗口是否已显示,使用callback异步回调。
// Logger.info(TAG, 'this.liveState', this.liveState)
if(this.liveState !== 'wait') {
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
try {
let data = this.AudioSuspension.floatWindowClass.get().isWindowShowing();
// console.info(TAG, 'window is showing: ' + data);
if(data) {
this.isShowAudioCom = true
this.AudioSuspension.playerController.get()?.pause();
this.AudioSuspension.minimize()
}
});
} catch (exception) {
console.error(TAG, `Failed to check whether the window is showing. Cause code: ${exception.code}, message: ${exception.message}`);
}
}
}
... ...
... ... @@ -189,19 +189,17 @@ export struct DetailVideoListPage {
this.pageShowTime = DateTimeUtils.getTimeStamp()
// 判断当前窗口是否已显示,使用callback异步回调。
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
try {
let data = this.AudioSuspension.floatWindowClass.get().isWindowShowing();
// console.info(TAG, 'window is showing: ' + data);
if(data) {
this.isShowAudioCom = true
this.AudioSuspension.playerController.get()?.pause();
this.AudioSuspension.minimize()
}
});
} catch (exception) {
console.error(TAG, `Failed to check whether the window is showing. Cause code: ${exception.code}, message: ${exception.message}`);
}
const action: Action = router.getParams() as Action;
if (action) {
... ...
... ... @@ -55,17 +55,15 @@ export struct VideoChannelPage {
async aboutToAppear() {
// 背景图高度
this.backgroundImageH = px2vp(this.topSafeHeight) + 44
// console.info(`cj2024 backgroundImageH = ${this.backgroundImageH} this.topSafeHeight = ${this.topSafeHeight}`)
// console.info(TAG, `cj2024 backgroundImageH = ${this.backgroundImageH} this.topSafeHeight = ${this.topSafeHeight}`)
this.setBarBackgroundColor()
if (this.currentTopNavSelectedIndex === 0) {
this.handleAudio(this.topNavList[0])
}
}
/**
* 切换顶部导航index
*/
setTabbarActive() {
// console.info(TAG, `setTabbarActive`)
let index = this.topNavList.findIndex((item: TopNavDTO, index) => {
return Number(this.assignChannel.channelId) == item.channelId && Number(this.assignChannel.pageId) == item.pageId
}) || 0
... ... @@ -77,7 +75,7 @@ export struct VideoChannelPage {
* 顶导、底导切换下标都到改变背景色,进入或退出沉浸式
*/
setBarBackgroundColor() {
// console.info(TAG, `setBarBackgroundColor`)
if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
this.barBackgroundColor = Color.Black
this.isImmersive = true
... ... @@ -87,7 +85,8 @@ export struct VideoChannelPage {
this.barBackgroundColor = Color.White
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
// 底导为视频同时顶导为视频时关闭音频悬浮窗
this.handleAudio()
}
/**
... ... @@ -125,22 +124,20 @@ export struct VideoChannelPage {
}
// 控制音频悬浮窗显隐
handleAudio(navItem: TopNavDTO) {
if (navItem.name === '视频') {
handleAudio() {
if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
// 判断当前窗口是否已显示,使用callback异步回调。
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
try {
let data = this.AudioSuspension.floatWindowClass.get().isWindowShowing();
// console.info(TAG, 'window is showing: ' + data);
if(data) {
this.isShowAudioCom = true
this.AudioSuspension.playerController.get()?.pause();
this.AudioSuspension.minimize()
}
});
} catch (exception) {
console.error(TAG, `Failed to check whether the window is showing. Cause code: ${exception.code}, message: ${exception.message}`);
}
} else {
// console.info(TAG, 'this.isShowAudioCom: ' + this.isShowAudioCom);
if (this.isShowAudioCom) {
... ... @@ -165,7 +162,7 @@ export struct VideoChannelPage {
clickTopNav(index: number) {
// 视频tab埋点
const tab = this.topNavList[index]
this.handleAudio(tab)
this.handleAudio()
// Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
... ...