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-05-09 21:38:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0769d683234c5bc17ba2b9261c81394d8eb4d1c5
0769d683
1 parent
5b23c2fb
沉浸式修改
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
10 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/VideoChannelPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/VideoChannelPage.ets
View file @
0769d68
...
...
@@ -54,13 +54,12 @@ export struct VideoChannelPage {
}
build() {
Stack() {
Stack(
{ alignContent: Alignment.Top }
) {
this.pageSwiperView()
this.topNavView()
}
.width('100%')
.height('100%')
.align(Alignment.Top)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
...
...
@@ -131,7 +130,7 @@ export struct VideoChannelPage {
.loop(false)
.width('100%')
.height('100%')
.cachedCount(
3
)
.cachedCount(
-1
)
.displayCount(1, true)
.alignSelf(ItemAlign.Start)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
View file @
0769d68
...
...
@@ -35,6 +35,7 @@ export struct DetailPlayShortVideoPage {
@Consume @Watch('videoStatusChange') switchVideoStatus: boolean
@Consume @Watch('pageShowChange') pageShow: number
@Consume topSafeHeight: number
@State imageVisible: boolean = true
/**
* 页面显示重查用户关注、点赞等信息
...
...
@@ -44,6 +45,7 @@ export struct DetailPlayShortVideoPage {
this.queryNewsInfoOfUser()
if (this.switchVideoStatus) {
this.playerController.play()
this.imageVisible = false
}
}
}
...
...
@@ -56,6 +58,7 @@ export struct DetailPlayShortVideoPage {
if (this.currentIndex === this.index) {
if (this.switchVideoStatus) {
this.playerController.play()
this.imageVisible = false
} else {
this.playerController.pause()
}
...
...
@@ -78,6 +81,7 @@ export struct DetailPlayShortVideoPage {
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '');
} else {
this.playerController.play()
this.imageVisible = false
}
}
}
...
...
@@ -136,6 +140,7 @@ export struct DetailPlayShortVideoPage {
this.playerController.onCanplay = () => {
if ((this.index == 0 || this.currentIndex === this.index) && this.switchVideoStatus) {
this.playerController.play()
this.imageVisible = false
}
}
this.playerController.onTimeUpdate = (position, duration) => {
...
...
@@ -144,14 +149,15 @@ export struct DetailPlayShortVideoPage {
this.queryNewsInfoOfUser()
}
a
boutToDisappear(): void
{
a
sync aboutToDisappear(): Promise<void>
{
console.log(TAG, 'aboutToDisappear', this.index)
this.playerController?.pause()
this.playerController?.release();
await this.playerController?.pause()
await this.playerController?.release();
}
build() {
Stack({ alignContent: Alignment.Top }) {
// this.playerCoverBuilder()
this.playerViewBuilder()
PlayerBottomView({
playerController: this.playerController
...
...
@@ -166,6 +172,21 @@ export struct DetailPlayShortVideoPage {
}
@Builder
playerCoverBuilder() {
Image(this.contentDetailData?.videoInfo?.[0]?.firstFrameImageUri)
.width('100%')
.height('auto')
.margin({
top: this.topSafeHeight + 'px'
})
.padding({
bottom: this.videoLandScape === 1 ? 115 : 0,
})
.align(this.videoLandScape === 0 ? Alignment.Top : Alignment.Center)
// .visibility(this.imageVisible ? Visibility.Visible : Visibility.None)
}
@Builder
playerViewBuilder() {
// 播放窗口
WDPlayerRenderView({
...
...
@@ -178,9 +199,6 @@ export struct DetailPlayShortVideoPage {
})
.height(this.videoLandScape === 1 ? '100%' : 'auto')
.width('100%')
.margin({
top: this.topSafeHeight + 'px'
})
.padding({
bottom: this.videoLandScape === 1 ? 115 : 0,
})
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
0769d68
...
...
@@ -159,6 +159,9 @@ export struct DetailVideoListPage {
index: index,
interactData: this.interactDataList[index]
})
.margin({
top: this.topSafeHeight + 'px'
})
}, (item: ContentDetailDTO) => item.newsId + '')
}
.indicator(false)
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
0769d68
import { ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
import Curves from '@ohos.curves'
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
import {
...
...
@@ -197,7 +198,7 @@ export struct VideoChannelDetail {
await this.getContentInteract(list2)
this.data = this.data.concat(res.data)
}
console.log('根据视频楼层信息批量查询视频列表',
res.data
)
console.log('根据视频楼层信息批量查询视频列表',
JSON.stringify(res.data)
)
})
}
}
...
...
@@ -246,6 +247,7 @@ export struct VideoChannelDetail {
.indicator(false)
.vertical(true)
.loop(false)
.curve(Curves.initCurve(Curve.EaseIn))
.width('100%')
.height('100%')
// 扩展至所有非安全区域
...
...
Please
register
or
login
to post a comment