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
liyubing
2024-06-03 18:49:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b4c948e43ff4755f7137aefcba279e804392b638
b4c948e4
1 parent
dd4e7d86
feat:横屏直播详情页面添加垫片逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
22 deletions
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
b4c948e
...
...
@@ -7,9 +7,10 @@ import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { LiveOperRowListView } from 'wdComponent';
import { Live
EmptyComponent, Live
OperRowListView } from 'wdComponent';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
let TAG: string = 'DetailPlayLivePage';
...
...
@@ -39,6 +40,8 @@ export struct DetailPlayLivePage {
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
...
...
@@ -66,8 +69,9 @@ export struct DetailPlayLivePage {
build() {
Column() {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
TabComponent({
tabs: this.tabs,
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
b4c948e
...
...
@@ -83,7 +83,6 @@ export struct DetailPlayVLivePage {
if (this.liveDetailPageLogic.showPad) {
// 有垫片
if(this.liveDetailPageLogic.padImageUri.length > 0){
// 配置了垫片资源
Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%')
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
b4c948e
...
...
@@ -4,6 +4,8 @@ import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from '
import { PlayUIComponent } from './PlayUIComponent';
import { PictureLoading } from '../../vertical/PictureLoading';
import { TrackConstants } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../../../viewModel/LiveDetailPageLogic';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
const TAG: string = 'TopPlayComponent'
...
...
@@ -32,6 +34,7 @@ export struct TopPlayComponent {
@Provide playSourceState: number = 0
private playUrl: string = ""
private xComponentIsLoaded: boolean = false
@Consume liveDetailPageLogic: LiveDetailPageLogic
aboutToAppear(): void {
if (this.playerController) {
...
...
@@ -66,6 +69,15 @@ export struct TopPlayComponent {
* 更新直播播放数据
*/
updateData() {
// 检测垫片
if (this.liveDetailPageLogic.showPad){
this.isHideLoading = true
this.isWait = true
this.previewUrl = this.liveDetailPageLogic.imgUrl
return
}
// 检测直播等待状态的直播预告是否视频资源
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1
&& this.contentDetailData?.liveInfo?.liveState == 'wait'
...
...
@@ -140,7 +152,8 @@ export struct TopPlayComponent {
this.previewUrl = ''
}
}
// Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource)
Logger.debug(TAG,
`---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd + ' -->' + this.isVideoSource)
}
tryToPlay() {
...
...
@@ -163,22 +176,29 @@ export struct TopPlayComponent {
build() {
Stack() {
// 视频资源播放
WDPlayerRenderLiveView({
playerController: this.playerController,
onLoad: async () => {
if (StringUtils.isNotEmpty(this.playUrl)) {
this.isHideLoading = false
this.isError = false
this.xComponentIsLoaded = true
Logger.debug(TAG, `---onLoad------>`)
this.tryToPlay()
if (this.liveDetailPageLogic.showPad) {
} else {
// 视频资源播放
WDPlayerRenderLiveView({
playerController: this.playerController,
onLoad: async () => {
if (StringUtils.isNotEmpty(this.playUrl)) {
this.isHideLoading = false
this.isError = false
this.xComponentIsLoaded = true
Logger.debug(TAG, `---onLoad------>`)
this.tryToPlay()
}
}
}
})
.height('100%')
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
})
.height('100%')
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
}
if (this.isVideoSource) {
...
...
@@ -187,10 +207,25 @@ export struct TopPlayComponent {
Image(this.previewUrl)
.objectFit(ImageFit.Cover)
.alt($r('app.media.live_room_image_fail'))
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
// .contrast(this.isEnd ? 0.4 : 1)
.visibility(this.isWait || this.isEnd ? Visibility.Visible :
Visibility.None)// .contrast(this.isEnd ? 0.4 : 1)
.blur(this.isEnd ? 20 : 0)
.width('100%')
if (this.liveDetailPageLogic.showPad) {
// 有垫片
if (this.liveDetailPageLogic.padImageUri.length > 0) {
// 配置了垫片资源
Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%')
} else {
// 没有配置垫片资源
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
}).width('100%').height('100%')
}
}
}
// loading
...
...
Please
register
or
login
to post a comment