Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhenghy
2024-04-24 14:20:23 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
28b9df15c3ab34fb601e0e63eca2d0c21d2db0e3
28b9df15
1 parent
4e8d6f0e
修复直播频道切换问题
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerComponent.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
View file @
28b9df1
...
...
@@ -5,6 +5,8 @@ import router from '@ohos.router';
import { DetailPlayLivePage } from './DetailPlayLivePage'
import { DetailPlayVLivePage } from './DetailPlayVLivePage'
const TAG = 'DetailPlayLiveCommon'
@Entry()
@Component
export struct DetailPlayLiveCommon {
...
...
@@ -47,7 +49,7 @@ export struct DetailPlayLiveCommon {
this.liveDetailsBean = data[0]
this.liveState = this.liveDetailsBean.liveInfo?.liveState
this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle
console.
error('liveDetailsBean===
', JSON.stringify((this.liveDetailsBean)))
console.
log(TAG, 'getLiveDetails:
', JSON.stringify((this.liveDetailsBean)))
}
},
() => {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
28b9df1
...
...
@@ -8,11 +8,11 @@ import { WDPlayerController } from 'wdPlayer/Index';
import { DisplayDirection } from 'wdConstant/Index';
const storage = LocalStorage.getShared();
const TAG = 'DetailPlayVLivePage'
@Entry(storage)
@Component
export struct DetailPlayVLivePage {
TAG: string = 'DetailPlayVLivePage';
private liveViewModel: LiveViewModel = new LiveViewModel()
private playerController: WDPlayerController = new WDPlayerController();
private swiperController: SwiperController = new SwiperController()
...
...
@@ -29,6 +29,7 @@ export struct DetailPlayVLivePage {
@State swiperIndex: number = 1
aboutToAppear(): void {
console.log(TAG, 'aboutToAppear')
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
...
...
@@ -86,11 +87,11 @@ export struct DetailPlayVLivePage {
if (data.length > 0) {
this.liveDetailsBean = data[0]
this.liveState = this.liveDetailsBean.liveInfo?.liveState
console.
error('liveDetailsBean===
', JSON.stringify((this.liveDetailsBean)))
console.
log(TAG, 'getLiveDetails
', JSON.stringify((this.liveDetailsBean)))
}
},
() => {
(message: string) => {
console.error(TAG, 'getLiveDetails catch', message)
})
}
...
...
@@ -99,9 +100,10 @@ export struct DetailPlayVLivePage {
.then(
(data) => {
this.liveRoomDataBean = data
console.log(TAG, 'getLiveRoomData', JSON.stringify((this.liveRoomDataBean)))
},
() => {
(message: string) => {
console.error(TAG, 'getLiveDetails catch', message)
})
}
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerComponent.ets
View file @
28b9df1
...
...
@@ -2,6 +2,7 @@ import { LiveDetailsBean } from 'wdBean/Index';
import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView } from 'wdPlayer/Index';
import componentUtils from '@ohos.arkui.componentUtils';
const TAG = 'PlayerComponent'
@Component
export struct PlayerComponent {
...
...
@@ -16,6 +17,7 @@ export struct PlayerComponent {
@State playUrl: string = ''
aboutToAppear(): void {
console.log(TAG, 'aboutToAppear')
if (this.playerController) {
this.playerController.onCanplay = () => {
console.log('可以播放了')
...
...
@@ -33,7 +35,6 @@ export struct PlayerComponent {
}
updateData() {
console.error('updateData=============')
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
28b9df1
...
...
@@ -46,11 +46,12 @@ export struct VideoChannelDetail {
private swiperController: SwiperController = new SwiperController()
@Provide showComment: boolean = false
@Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@Consume pageShow: number
@Consume pageHide: number
@State data: ContentDetailDTO[] = []
@State currentIndex: number = 0
@State interactDataList: InteractDataDTO[] = []
@State totalCount: number = 0
@State switchVideoStatus: boolean = false
@State isMouted: boolean = false
/**
...
...
@@ -63,13 +64,13 @@ export struct VideoChannelDetail {
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
// 如果视频在暂停则播放视频
this.switchVideoStatus = true
this.barBackgroundColor = Color.Black
this.pageShow = Math.random()
this.openFullScreen()
} else {
// 如果视频在播放则暂停视频
this.switchVideoStatus = false
this.barBackgroundColor = Color.Transparent
this.pageHide = Math.random()
this.closeFullScreen()
}
// timer = -1
...
...
Please
register
or
login
to post a comment