wangliang_wd

feat:优化早晚报语音播放问题

... ... @@ -57,5 +57,8 @@ export enum EmitterEventId {
// 直播,回看半屏
live_half_SCREEN = 17,
//稿件详情
AUDIO_ARTICLE_DETAILS = 18,
}
... ...
... ... @@ -83,7 +83,7 @@ export struct MorningEveningPaperComponent {
@State currentStatus: number | string |undefined = 0;
@State dailyPaperTopicPageId: string = ''
@State isPlayArticleDetails: boolean = false
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
simpleAudioDialog: CustomDialogController = new CustomDialogController({
... ... @@ -143,7 +143,16 @@ export struct MorningEveningPaperComponent {
this.fetchData()
}
}
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_ARTICLE_DETAILS,()=>{
this.isPlayArticleDetails = true
this.currentStatus = 3
})
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
if (this.isPlayArticleDetails) return
console.log(TAG, 'this.currentStatus', val)
this.currentStatus = val
... ... @@ -479,6 +488,7 @@ export struct MorningEveningPaperComponent {
// dialog.open()
// this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
// SPHelper.default.save(SpConstants.APP_NEWS_INFO_DATA_MODEL, JSON.stringify(this.compInfoBean))
this.isPlayArticleDetails = false
this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
// console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
// console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
... ...
... ... @@ -410,6 +410,7 @@ export struct OperRowListView {
.gesture(
TapGesture()
.onAction((event: GestureEvent) => {
EmitterUtils.sendEvent(EmitterEventId.AUDIO_ARTICLE_DETAILS)
this.AudioSuspension.setPlayerUrl(this.audioUrl, this.audioTitle, this.contentDetailData.newsId + "", this.contentDetailData.newsSourceName)
TrackingButton.click('suspendedWindow',this.pageId,this.pageName)
}))
... ...