会议回放,观看直播与会议

This commit is contained in:
XiuYun CHEN
2025-05-19 16:42:50 +08:00
parent f44649d8dc
commit f821535e18
25 changed files with 725 additions and 55 deletions
+2
View File
@@ -5,3 +5,5 @@ export { VideoPage } from './src/main/ets/pages/VideoPage';
export { PlayBack } from './src/main/ets/pages/PlayBack';
export { VideoMore } from './src/main/ets/pages/VideoMore'
export { VideoDetailModel } from './src/main/ets/model/VideoDetailModel'
@@ -1,6 +1,6 @@
import { runCatching, seconds } from '@polyvharmony/media-player-sdk';
import { MeetingItemModel,ItemModel } from '../model/ItemModel'
import { BasicConstant } from '@itcast/basic'
import { BasicConstant,DataWebModels } from '@itcast/basic'
import { promptAction, router } from '@kit.ArkUI';
import { PLVMockMediaResourceData } from '../polyv/PLVMockMediaResourceData'
import {
@@ -59,26 +59,30 @@ export struct ItemComp {
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.border({ width:1, color:Color.White })
.backgroundColor($r('app.color.22000000'))
.borderRadius(30)
}
}
.height(162).backgroundColor(Color.Orange)
.height(162).backgroundColor(Color.White)
.margin({top:10,right:5}).clip(true).id('rr')
.onClick(async()=>{
const mediaResourcesResult = await runCatching(PLVMockMediaResourceData.getInstance().setupMediaResourcesFromLocal('e97dbe3e648aefc2eb6f68b96db9db6c_e'))
if (mediaResourcesResult.success === false) {
promptAction.showToast({
message: `'视频数据初始化失败': ${mediaResourcesResult.error}`,
duration: seconds(3).toMillis()
})
.onClick(()=>{
if(this.item.status=='3')
{
return
}
const mediaResource = mediaResourcesResult.data[0]
let paramsInfo: DataWebModels = {
url:this.item.liveurl ,
title:'肝胆直播',
type:'live'
};
router.pushUrl({
url:'pages/VideoPage/PLVMediaPlayerSingleVideoPage',
params: new PLVMediaPlayerSingleVideoPageParam(mediaResource)
url: 'pages/WebView/LivebroadcastPages', // 目标url
params: paramsInfo // 添加params属性,传递自定义参数
})
})
}
Row(){
@@ -108,11 +112,19 @@ export struct ItemComp {
}.width('100%').height(this.heightss).clip(true).
backgroundColor(Color.White).borderRadius(5)
.onClick(()=>{
router.pushUrl({
url: 'pages/WebView/WebPage',
params: { url: this.item.path ,title:'会议详情'}
});
})
}.backgroundColor($r('app.color.e4e4e4'))
.width('100%').padding({left:10,right:10}).clip(true)
}
getTime(str1:string, str2:string) {
@@ -47,7 +47,7 @@ export struct ItemCompBack {
}
}
.height(162).backgroundColor(Color.Orange)
.height(162).backgroundColor(Color.White)
.margin({top:10,right:5}).clip(true).id('rr')
Row(){
Image($r('app.media.meetingtime')).width(13).height(13)
@@ -0,0 +1,96 @@
import { runCatching, seconds } from '@polyvharmony/media-player-sdk';
import { VideoMore } from '../model/VideoMoreModel'
import { BasicConstant } from '@itcast/basic'
import { promptAction, router } from '@kit.ArkUI';
import { PLVMockMediaResourceData } from '../polyv/PLVMockMediaResourceData'
import {
PLVMediaPlayerSingleVideoPageParam
} from 'media-player-common';
import HashMap from '@ohos.util.HashMap';
import { hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
import { BusinessError } from '@kit.BasicServicesKit';
import { VideoDetailModel } from '../model/VideoDetailModel'
@Preview
@Component
export struct ItemCompVideo {
@Prop item: VideoMore ;
hashMap: HashMap<string, string> = new HashMap();
@State heightss:Length=247
aboutToAppear(): void {
}
build() {
Column() {
Image(BasicConstant.urlHtml+this.item.imgpath).width('100%').height(102)
.objectFit(ImageFit.Fill)
Text(this.item.name).maxLines(2).fontSize(15).fontColor('app.color.666666').textAlign(TextAlign.Start).height(36)
.textOverflow({ overflow: TextOverflow.Ellipsis }).id('title').width('100%').margin({top:10}).padding({left:10,right:10})
Row(){
Text(this.item.public_name).fontSize(14)
.fontColor($r('app.color.999999'))
Blank()
Image($r('app.media.video_look')).width(18).height(11)
Text(this.item.readnum+'').fontSize(14)
.fontColor($r('app.color.999999'))
}
.padding({left:10,right:10,bottom:10})
.width('100%')
.margin({top:6})
}.backgroundColor(Color.White)
.borderRadius(5)
.onClick(()=>{
this.getVideoDetail(this.item.uuid)
})
.width('100%').clip(true)
}
getVideoDetail(video_uuid:string)
{
this.hashMap.clear();
this.hashMap.set('video_uuid', video_uuid)
hdHttp.httpReq<string>(BasicConstant.videoDetail,this.hashMap).then(async (res: HdResponse<string>) => {
logger.info('Response videoDetail'+res);
let json:VideoDetailModel = JSON.parse(res+'') as VideoDetailModel;
this.goPLVMediaPlayerSingleVideoPage(json.video.polyv_uuid,video_uuid)
}).catch((err: BusinessError) => {
})
}
async goPLVMediaPlayerSingleVideoPage(vid:string,video_uuid:string)
{
const mediaResourcesResult = await runCatching(PLVMockMediaResourceData.getInstance().setupMediaResourcesFromLocal(vid))
if (mediaResourcesResult.success === false) {
promptAction.showToast({
message: `'视频数据初始化失败': ${mediaResourcesResult.error}`,
duration: seconds(3).toMillis()
})
return
}
const mediaResource = mediaResourcesResult.data[0]
router.pushUrl({
url:'pages/VideoPage/PLVMediaPlayerSingleVideoPage',
params: {
video_uuid:video_uuid,
param:new PLVMediaPlayerSingleVideoPageParam(mediaResource)
}
})
}
}
@@ -0,0 +1,89 @@
import { ItemCompVideo } from './ItemCompVideo'
import { VideoMoreModel,VideoMore } from '../model/VideoMoreModel'
import { HdGrid, HdListController,BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
import { promptAction, router } from '@kit.ArkUI'
import { BusinessError } from '@kit.BasicServicesKit';
import HashMap from '@ohos.util.HashMap';
@Component
export struct ListCompVideo {
@Prop
type_uuid:string=''
@State
list: VideoMore[] = []
controller = new HdListController()
@State
page: number = 1
@State
keyword: string = ''
hashMap: HashMap<string, string> = new HashMap();
onRefresh() {
this.page = 1
this.initData(0)
}
initData(type:number)
{
this.hashMap.clear();
this.hashMap.set('page', this.page+"")
this.hashMap.set('typeUuid', this.type_uuid)
hdHttp.httpReq<string>(BasicConstant.videoByTypeNew,this.hashMap).then(async (res: HdResponse<string>) => {
logger.info('Response videoByTypeNew'+res);
let json:VideoMoreModel = JSON.parse(res+'') as VideoMoreModel;
if(type==0)
{
this.controller.refreshed()
}
else
{
this.controller.loaded()
}
if(this.page==1&&json.data.list!=null&&json.data.list.length>0)
{
this.list = json.data.list
}
else if(this.page>1)
{
this.list.push(...json.data.list)
}
if (this.page >= json.data.totalPage) {
this.controller.finished()
} else {
this.page++
}
}).catch((err: BusinessError) => {
})
}
build() {
HdGrid({
lw: 1,
controller: this.controller,
onRefresh: () => {
this.onRefresh()
},
onLoad: () => {
this.initData(1)
}
}) {
ForEach(this.list, (items: VideoMore) => {
GridItem() {
ItemCompVideo({ item:items })
}
})
}
}
}
@@ -0,0 +1,21 @@
export interface VideoDetailModel{
code:string;
video:VideoModel;
message:string;
}
export interface VideoModel{
note:string;
path:string;
readnum:string;
imgpath:string;
name:string;
isCollection:number;
polyv_uuid:string;
uuid:string;
public_name:string;
content:string;
point:number;
tags:string;
}
@@ -0,0 +1,29 @@
export interface VideoMoreModel {
code:string;
data:VideoMoreData;
message:string;
}
export interface VideoMoreData{
totalPage:number;
pageNumber:number;
pageSize:number;
totalRow:number;
list: VideoMore[] ;
}
export interface VideoMore{
type_uuid:string;
public_name:string;
imgpath:string;
sort:string;
uuid:string;
create_date:string;
status:string;
name:string;
path:string;
readnum:string;
note:string;
video_type_name:string;
tags:string;
}
+12 -12
View File
@@ -1,19 +1,19 @@
import router from '@ohos.router';
import { HdNav } from '@itcast/basic'
import { ListCompVideo } from '../components/ListCompVideo'
@Component
export struct VideoMore {
@State message: string = 'Hello World';
@State params:Record<string, string> = router.getParams() as Record<string, string>;
build() {
Row() {
Column() {
Text(this.message)
.fontSize($r('app.float.page_text_font_size'))
.fontWeight(FontWeight.Bold)
.onClick(() => {
this.message = 'Welcome';
})
}
.width('100%')
}
.height('100%')
HdNav({ title: this.params.title, showRightIcon: false, showLeftIcon: true,showRightText:true,rightText:'精选' })
Text('').height(1).width('100%')
.backgroundColor($r('app.color.1a000000'))
.margin({bottom:10})
ListCompVideo({type_uuid:this.params.uuid}).padding({bottom:20,left:10,right:10}).backgroundColor($r('app.color.top_bg'))
}.width('100%')
.height('100%').backgroundColor($r('app.color.top_bg'))
}
}
@@ -10,14 +10,14 @@ import {
} from '@polyvharmony/media-player-sdk';
import {PLVMediaDownloadSetting} from '@polyvharmony/media-player-sdk-addon-cache-down';
// const mockAuthentication: PLVVodMainAccountAuthentication = {
// userId: "cfb7a69a75",
// secretKey: "4KtJhl9EqU"
// }
const mockAuthentication: PLVVodMainAccountAuthentication = {
userId: "e97dbe3e64",
secretKey: "zMV29c519P"
userId: "cfb7a69a75",
secretKey: "4KtJhl9EqU"
}
// const mockAuthentication: PLVVodMainAccountAuthentication = {
// userId: "e97dbe3e64",
// secretKey: "zMV29c519P"
// }
const mockViewerParam: PLVViewerParam = {
viewerId: "123",
@@ -32,6 +32,10 @@
"name": "e4e4e4",
"value": "#e4e4e4"
},
{
"name": "1a000000",
"value": "#1a000000"
},
{
"name": "333333",
"value": "#333333"
@@ -55,6 +59,14 @@
{
"name": "999999",
"value": "#999999"
},
{
"name": "666666",
"value": "#666666"
},
{
"name": "22000000",
"value": "#22000000"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -1,4 +1,4 @@
import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore, ChangeUtil,hdHttps } from '@itcast/basic'
import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore, ChangeUtil } from '@itcast/basic'
import HashMap from '@ohos.util.HashMap'
import { BusinessError } from '@kit.BasicServicesKit';
import { promptAction, router } from '@kit.ArkUI'
@@ -202,7 +202,7 @@ export struct EditUserDataComp {
controller:this.officePickerDialog,
officeSelected: (name:string , uuid:string) => {
this.officeName = name;
hdHttps.post<null>(this.updateDataUrl, {
hdHttp.post<null>(this.updateDataUrl, {
officeName: name,
officeUuid:uuid,
type:'2',