1.0.0-alpha.43 • Published 2 years ago

tingwu-meeting-ui-components v1.0.0-alpha.43

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

tingwu-meeting-sdk

阿里巴巴达摩院语音实验室听悟会议 UI 组件

安装

npm install tingwu-meeting-ui-components -S

TingwuMeetingClient

参数

参数说明类型
server域名,暂用听悟服务地址。string
notLoginListener未登陆监听(非必需)() => void

方法

参数说明类型默认
setMeetingInfo设置会议信息(meetinInfo: MeetingInfo) => voidnull
setLivMeetingInfo设置当前进行中的会议信息(livMeetingInfo: LivMeetingInfo) => voidnull

MeetingList

听悟会议纪要列表 UI 组件

参数

参数说明类型默认
onStartMeeting点击开始会议的回调()=>voidnull
onGotoDetail前往会议详情的回调(meetingInfo: MeetingInfo)=>voidnull
onGotoLiving前往实时会议的回调(meetingInfo: MeetingInfo)=>voidnull
onGoback标题栏后退按钮的回调(...args: any[])=>voidnull
deviceStatus设备状态准备是否就绪boolean true 为准备就绪true
loading开启会议 loading 状态boolean true 为加载中false
listHeightValue控制列表页整体高度string100vh

MeetingLive

听悟会议转写直播 UI 组件

参数

参数说明类型默认
mc拉取会议内容接口所需入参stringnull
onPauseRecord执行暂停的回调(transId: number)=>voidnull
onResumeRecord执行恢复的回调(transId: number)=>voidnull
onFinishRecord执行结束的回调(transId: number)=>voidnull
onChangeTitle执行修改标题的回调(transId: number)=>voidnull
onGoback标题栏后退按钮的回调(...args: any[])=>voidnull
onMeetingCreated进入实时会议组件后抛出组件信息的回调(livMeetingInfo: LivMeetingInfo)=>voidnull
liveHeightValue控制列表页整体高度string100vh

MeetingDetail

听悟会议纪要详情页 UI 组件

参数

参数说明类型默认
summaryInfo.buttonText整理纪要的按钮文案anynull
summaryInfo.onSummaryCilck整理/查看纪要的回调(transId: number)=>voidnull
onDigest摘取纪要的回调(paragraphValue: string, info: ParagraphType)=>voidnull
onGoback标题栏后退按钮的回调(...args: any[])=>voidnull
fileHeightValue离线页面的最外层高度number/string100vh
getVideoUrl获取视频 URL(playbackIdentifier: string) => Promise<{ status: 0 / 1 / 2, videoUrl?: string, nextTime?:number }>status: (0 计算中 1 成功 2 失败); nextTime(下次拉取时间): 默认10s
onFullScreen放大视频(videoInfo: { title: string; url: string }) => voidnull

使用

import React from 'react';
import TingwuMeetingClient from 'tingwu-meeting-ui-components';
import "tingwu-meeting-ui-components/dist/style.css"

interface IProps {}

interface IState {}

class TinwuMeetingSdkTest extends React.Component<IProps, IState> {
  tingwuMeetingSdk: TingwuMeetingClient;

  constructor(props: IProps) {
    super(props);
    this.tingwuMeetingSdk = new TingwuMeetingClient({
      server: '',
      notLoginListener:()=>{}
    });
  }

  render() {
    const { MeetingLive, MeetingList, MeetingDetail } = this.tingwuMeetingSdk;
    return (
      <div
        style={{
          width: 310,
          height: 1000,
          margin: '0 auto',
          border: '1px solid gray',
        }}
      >
        <MeetingList
          onStartMeeting={() => {}}
          onGotoDetail={() => {}}
          onGoback={()=>{}}
          deviceStatus = {false || true}
          loading = {false || true}
          listHeightValue = '100vh'
        />
        <MeetingLive
          meetingTime={0}
          onResumeRecord={() => {}}
          onFinishRecord={() => {}}
          onPauseRecord={() => {}}
          onChangeTitle={()=>{}}
          onGoback={()=>{}}
          onMeetingCreated={()=>{}}
          liveHeightValue = '100vh'
        />
        <MeetingDetail
          transId={0}
          summaryInfo={{
             buttonText: '';
             onSummaryCilck: (transId: number) => {};
          }}
          onDigest={(paragraphValue: string, info: ParagraphType)=>{}}
          onGoback={()=>{}}
          onFullScreen={(videoInfo: { title: string; url: string })=>{}}
          fileHeightValue={`calc(100vh + ${headerHegith})`}
          // fileHeightValue={1038}
          getVideoUrl={(playbackIdentifier: string) => {
          return new Promise((resolve, reject) => {
            resolve({
              status: 1,
              videoUrl: '',
              nextTime: 10000,
            });
          })
        }}
        />
      </div>
    );
  }
}

export default TinwuMeetingSdkTest;