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
wuyanan
2024-07-31 19:03:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1cb7f689f55ab745b3ce300e8993ecefd32f8d29
1cb7f689
1 parent
4eee5297
ref |> 处理竖屏直播竖屏流上下有黑边问题
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
3 deletions
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerComponent.ets
sight_harmony/features/wdPlayer/Index.ets
sight_harmony/features/wdPlayer/src/main/ets/controller/WDAliPlayerController.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerComponent.ets
View file @
1cb7f68
import { ContentDetailDTO } from 'wdBean/Index';
import { AliPlayerRenderView, PlayerConstants, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
import { AliPlayerRenderView,
AliScaleMode,
PlayerConstants, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
import { ParamType, TrackConstants } from 'wdTracking/Index';
import { PictureLoading } from './PictureLoading';
...
...
@@ -59,6 +61,7 @@ export struct PlayerComponent {
}
}else{
this.isLarge = true
this.playerController?.setScaleMode(AliScaleMode.SCALE_ASPECT_FILL)
}
}
}
...
...
sight_harmony/features/wdPlayer/Index.ets
View file @
1cb7f68
...
...
@@ -12,7 +12,7 @@ export { SpeedBean } from "./src/main/ets/bean/SpeedBean"
export { DateFormatUtil } from "./src/main/ets/utils/DateFormatUtil"
export { WDAliPlayerController } from "./src/main/ets/controller/WDAliPlayerController"
export { WDAliPlayerController
, AliScaleMode
} from "./src/main/ets/controller/WDAliPlayerController"
export { WDListPlayerData, WDAliListPlayerController } from "./src/main/ets/controller/WDAliListPlayerController"
...
...
sight_harmony/features/wdPlayer/src/main/ets/controller/WDAliPlayerController.ets
View file @
1cb7f68
...
...
@@ -7,7 +7,8 @@ import {
paused,
stopped,
completion,
error
error,
ScaleMode
} from 'premierlibrary/src/main/ets/com/aliyun/player/IPlayer';
import { initGlobalPlayerSettings, setupPlayerConfig } from '../utils/GlobalSetting';
...
...
@@ -18,6 +19,30 @@ import { ParamType, TrackingPlay } from 'wdTracking/Index';
const TAG = "WDAliPlayerController"
export enum AliScaleMode {
/**
* 宽高比适应
*/
/****
* Auto zoom to fit.
*/
SCALE_ASPECT_FIT = 0,
/**
* 宽高比填充
*/
/****
* Fill to fit.
*/
SCALE_ASPECT_FILL,
/**
* 拉伸填充
*/
/****
* Stretch to fit.
*/
SCALE_TO_FILL
}
/*
* 此播放器为阿里播放器鸿蒙版本封装,可播放单个视频、或直播
* 列表上下滑场景用:WDListPlayerController
...
...
@@ -95,6 +120,16 @@ export class WDAliPlayerController {
});
}
public setScaleMode(mode: AliScaleMode) {
let m:ScaleMode = ScaleMode.SCALE_ASPECT_FIT
if (mode == AliScaleMode.SCALE_ASPECT_FILL) {
m = ScaleMode.SCALE_ASPECT_FILL
} else if (mode == AliScaleMode.SCALE_TO_FILL) {
m = ScaleMode.SCALE_TO_FILL
}
this.avPlayer?.setScaleMode(m)
}
public destory() {
Logger.debug(TAG, "播放器销毁")
this.avPlayer?.stop()
...
...
Please
register
or
login
to post a comment