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-03-29 19:48:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b066c51136855e023652806edf993dd7f0ba74aa
b066c511
1 parent
88c7a107
视频播放修改
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
31 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerDetailContainer.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleComment.ets
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
b066c51
...
...
@@ -4,6 +4,7 @@ import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
import { Test } from './Test'
import router from '@ohos.router';
import window from '@ohos.window';
@Entry
@Component
...
...
@@ -17,6 +18,7 @@ export struct DetailVideoListPage {
@State currentIndex: number = 0
async aboutToAppear(): Promise<void> {
console.error('=================',)
let data: ContentDetailDTO[] = []
let action: Action = router.getParams() as Action
if (action) {
...
...
@@ -80,9 +82,10 @@ export struct DetailVideoListPage {
// }, (item: string) => item)
}
.cachedCount(
2
)
.cachedCount(
0
)
.indicator(false)
.vertical(true)
.loop(false)
.width('100%')
.height('100%')
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerDetailContainer.ets
View file @
b066c51
...
...
@@ -77,9 +77,10 @@ export struct PlayerDetailContainer {
.zIndex(1)
}
.width('100%')
.height('100%')
// .aspectRatio(this.isFullScreen ? 0.1 : 16 / 9.0) // 若width值确定,当aspectRatio值越小,则height值越大
.height(this.isFullScreen ? '100%' : this.buildVideoHeight())
.margin({ top: this.isFullScreen ? 0 : this.buildVideoTo() })
// .height(this.isFullScreen ? '100%' : this.buildVideoHeight())
// .margin({ top: this.isFullScreen ? 0 : this.buildVideoTo() })
// .margin({ bottom: this.isFullScreen ? 0 : this.buildVideoBottom() })
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleComment.ets
View file @
b066c51
...
...
@@ -29,33 +29,33 @@ export struct PlayerTitleComment {
build() {
Column() {
Column() {
Row() {
Image($r('app.media.ic_switch_orientation'))
.width(34)
.aspectRatio(1)
.objectFit(ImageFit.Contain)
.padding({ left: 10, right: 5 })
Text("全屏观看")
.fontColor(Color.White)
.fontSize('14fp')
.maxLines(2)
.layoutWeight(1)
}
.width(100)
.backgroundColor(Color.Gray)
.borderRadius(10)
.alignItems(VerticalAlign.Center)
.visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible)
.onClick(() => {
this.isFullScreen = !this.isFullScreen;
WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE);
devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE);
})
}
.width('100%')
// .margin({ bottom: 120 })
.alignItems(HorizontalAlign.Center)
// Column() {
// Row() {
// Image($r('app.media.ic_switch_orientation'))
// .width(34)
// .aspectRatio(1)
// .objectFit(ImageFit.Contain)
// .padding({ left: 10, right: 5 })
// Text("全屏观看")
// .fontColor(Color.White)
// .fontSize('14fp')
// .maxLines(2)
// .layoutWeight(1)
// }
// .width(100)
// .backgroundColor(Color.Gray)
// .borderRadius(10)
// .alignItems(VerticalAlign.Center)
// .visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible)
// .onClick(() => {
// this.isFullScreen = !this.isFullScreen;
// WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE);
// devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE);
// })
// }
// .width('100%')
// // .margin({ bottom: 120 })
// .alignItems(HorizontalAlign.Center)
Row() {
Column() {
...
...
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
View file @
b066c51
...
...
@@ -80,6 +80,9 @@ export struct WDPlayerRenderView {
})
.onLoad(async (event) => {
Logger.info(TAG, 'onLoad')
let surfaceId = this.xComponentController.getXComponentSurfaceId()
console.log('surfaceId===', surfaceId)
console.log('insId===', this.insId)
this.xComponentController.setXComponentSurfaceSize({
surfaceWidth: 1920,
surfaceHeight: 1080
...
...
@@ -94,7 +97,7 @@ export struct WDPlayerRenderView {
}
.id(this.insId)
.onAreaChange(() => {
this.updateLayout()
//
this.updateLayout()
})
.backgroundColor("#000000")
.justifyContent(FlexAlign.Center)
...
...
Please
register
or
login
to post a comment