bug修改

This commit is contained in:
XiuYun CHEN 2025-06-17 13:18:34 +08:00
parent 7e3a597e92
commit 61a28b9150
4 changed files with 31 additions and 15 deletions

View File

@ -9,7 +9,7 @@ export struct VideoSelected{
Column() { Column() {
HdNav({ title: this.params.title, showRightIcon: false, showLeftIcon: true }) HdNav({ title: this.params.title, showRightIcon: false, showLeftIcon: true })
ListCompVideoSelect({type_uuid:this.params.uuid}).backgroundColor(Color.White).height('100%') ListCompVideoSelect({type_uuid:this.params.uuid}).backgroundColor(Color.White).layoutWeight(1)
}.width('100%') }.width('100%')
.height('100%').backgroundColor($r('app.color.top_bg')) .height('100%').backgroundColor($r('app.color.top_bg'))
} }

View File

@ -10,6 +10,7 @@ import {
} from '@polyvharmony/media-player-sdk'; } from '@polyvharmony/media-player-sdk';
import {PLVMediaDownloadSetting} from '@polyvharmony/media-player-sdk-addon-cache-down'; import {PLVMediaDownloadSetting} from '@polyvharmony/media-player-sdk-addon-cache-down';
const mockAuthentication: PLVVodMainAccountAuthentication = { const mockAuthentication: PLVVodMainAccountAuthentication = {
userId: "cfb7a69a75", userId: "cfb7a69a75",
secretKey: "4KtJhl9EqU" secretKey: "4KtJhl9EqU"
@ -20,8 +21,8 @@ const mockAuthentication: PLVVodMainAccountAuthentication = {
// } // }
const mockViewerParam: PLVViewerParam = { const mockViewerParam: PLVViewerParam = {
viewerId: "123", viewerId:'',
viewerName: "123" viewerName: ""
} }
export class PLVMockMediaResourceData { export class PLVMockMediaResourceData {
@ -54,9 +55,9 @@ export class PLVMockMediaResourceData {
return this.mediaResources return this.mediaResources
} }
public setupMediaResourcesFromLocal(vid:string):Promise<PLVMediaResource[]> { public setupMediaResourcesFromLocal(vid:string,param:PLVViewerParam):Promise<PLVMediaResource[]> {
return this.mediaResources = Promise.resolve([ return this.mediaResources = Promise.resolve([
vod(vid) vod(vid,param)
// vod("e97dbe3e648aefc2eb6f68b96db9db6c_e"), // vod("e97dbe3e648aefc2eb6f68b96db9db6c_e"),
// vod("e97dbe3e6401ea8f76617bafe32f57e9_e"), // vod("e97dbe3e6401ea8f76617bafe32f57e9_e"),
// vod("e97dbe3e64ed6e0aac558e43787df1b4_e"), // vod("e97dbe3e64ed6e0aac558e43787df1b4_e"),
@ -87,21 +88,22 @@ export class PLVMockMediaResourceData {
} }
private setupMediaResourcesFromServer() { private setupMediaResourcesFromServer() {
this.mediaResources = PLVGeneralApiManager.getVodVideoList(mockAuthentication, 1, 20) // this.mediaResources = PLVGeneralApiManager.getVodVideoList(mockAuthentication, 1, 20)
.then(result => { // .then(result => {
return result.data!.map(video => vod(video!.vid!)) // return result.data!.map(video => vod(video!.vid!))
}) // })
} }
} }
function vod(videoId: string): PLVVodMediaResource { function vod(videoId: string,param:PLVViewerParam): PLVVodMediaResource {
// 默认下载路径 // 默认下载路径
const defaultDownloadRoot = PLVMediaDownloadSetting.defaultSetting(PLVMediaPlayerAppContext.getInstance().appContext!).downloadRootDirectory const defaultDownloadRoot = PLVMediaDownloadSetting.defaultSetting(PLVMediaPlayerAppContext.getInstance().appContext!).downloadRootDirectory
return { return {
videoId: videoId, videoId: videoId,
authentication: mockAuthentication, authentication: mockAuthentication,
viewerParam: mockViewerParam, viewerParam:param,
// viewerParam: mockViewerParam,
scene: "vod", scene: "vod",
localVideoSearchPaths: [defaultDownloadRoot] localVideoSearchPaths: [defaultDownloadRoot]
} }

View File

@ -1,5 +1,5 @@
import { runCatching, seconds } from '@polyvharmony/media-player-sdk'; import { runCatching, seconds ,PLVViewerParam} from '@polyvharmony/media-player-sdk';
import { BasicConstant } from '@itcast/basic' import { BasicConstant,authStore,preferenceStore } from '@itcast/basic'
import { promptAction, router } from '@kit.ArkUI'; import { promptAction, router } from '@kit.ArkUI';
import { PLVMockMediaResourceData } from '../polyv/PLVMockMediaResourceData' import { PLVMockMediaResourceData } from '../polyv/PLVMockMediaResourceData'
import { import {
@ -9,10 +9,15 @@ import HashMap from '@ohos.util.HashMap';
import { hdHttp, HdResponse ,logger} from '@itcast/basic/Index' import { hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
import { BusinessError } from '@kit.BasicServicesKit'; import { BusinessError } from '@kit.BasicServicesKit';
import { VideoDetailModel } from '../model/VideoDetailModel' import { VideoDetailModel } from '../model/VideoDetailModel'
const mockViewerParam: PLVViewerParam = {
viewerId:preferenceStore.getItemString(BasicConstant.POLVID),
viewerName: authStore.getUser().realName
}
class VideoTools { class VideoTools {
hashMap: HashMap<string, string> = new HashMap(); hashMap: HashMap<string, string> = new HashMap();
getVideoDetail(video_uuid:string) getVideoDetail(video_uuid:string)
{ {
this.hashMap.clear(); this.hashMap.clear();
this.hashMap.set('video_uuid', video_uuid) this.hashMap.set('video_uuid', video_uuid)
hdHttp.httpReq<string>(BasicConstant.videoDetail,this.hashMap).then(async (res: HdResponse<string>) => { hdHttp.httpReq<string>(BasicConstant.videoDetail,this.hashMap).then(async (res: HdResponse<string>) => {
@ -61,7 +66,7 @@ class VideoTools {
async goPLVMediaPlayerSingleVideoPage(vid:string,video_uuid:string) async goPLVMediaPlayerSingleVideoPage(vid:string,video_uuid:string)
{ {
const mediaResourcesResult = await runCatching(PLVMockMediaResourceData.getInstance().setupMediaResourcesFromLocal(vid)) const mediaResourcesResult = await runCatching(PLVMockMediaResourceData.getInstance().setupMediaResourcesFromLocal(vid,mockViewerParam))
if (mediaResourcesResult.success === false) { if (mediaResourcesResult.success === false) {
promptAction.showToast({ promptAction.showToast({
message: `'视频数据初始化失败': ${mediaResourcesResult.error}`, message: `'视频数据初始化失败': ${mediaResourcesResult.error}`,

View File

@ -2,7 +2,7 @@ import { VideoPage,VideoGandan } from 'home'
import { MyHomePage } from 'mypage' import { MyHomePage } from 'mypage'
import { TabBarCompModel } from '../../models/TabBarCompModel' import { TabBarCompModel } from '../../models/TabBarCompModel'
import { TabBarItems } from '../../contants/TabBarItems' import { TabBarItems } from '../../contants/TabBarItems'
import { BasicConstant } from '@itcast/basic' import { BasicConstant,AESEncryptionDecryption,authStore,preferenceStore } from '@itcast/basic'
import mediaquery from '@ohos.mediaquery'; import mediaquery from '@ohos.mediaquery';
@Component @Component
@ -17,11 +17,20 @@ export struct TabBarComp {
@Provide @Provide
toTop:boolean=false; toTop:boolean=false;
aboutToAppear() { aboutToAppear() {
this.getPolyid()
this.listenerScreen.on('change', (mediaQueryResult) => { this.listenerScreen.on('change', (mediaQueryResult) => {
this.isLandscape = mediaQueryResult.matches this.isLandscape = mediaQueryResult.matches
}) })
} }
async getPolyid()
{
let mobile =authStore.getUser().mobile
let mobile_encryption = mobile +BasicConstant.polvId;
let signs =await AESEncryptionDecryption.aesEncrypt(mobile_encryption,"deoep09_klodLdAo")
preferenceStore.setItemString(BasicConstant.POLVID,signs)
}
@Builder @Builder
TabBarBuilder(item: TabBarCompModel, index: number) { TabBarBuilder(item: TabBarCompModel, index: number) {
Column({ space: BasicConstant.SPACE_SM }) { Column({ space: BasicConstant.SPACE_SM }) {