config.ts 1.6 KB
import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { CameraConfig } from './index'
import cloneDeep from 'lodash/cloneDeep'

export enum VideoPlayerType {
  m3u8 = 'application/x-mpegURL',
  mp4 = 'video/mp4',
  webm = 'video/webm',
  flv = 'video/x-flv',
}

export enum sourceTypeEnum {
  CUSTOM = 'custom',
  PLATFORM = 'platform'
}

export enum sourceTypeNameEnum {
  CUSTOM = '自定义',
  PLATFORM = '平台获取'
}

export interface datasetList {
  url: string | null
  sourceType: string
  organization: string
  autoPlay: boolean
  className?: string[] & string,
  sty?: Recordable
}

export enum AccessModeEnum {
  ManuallyEnter = 0, //手动输入
  Streaming = 1, //流媒体
  GBT28181 = 2 //GBT28181
}

export interface GBT28181Params {
  channelNo: string
  deviceId: string
  deviceName: string
}

export interface videoList {
  name: string
  accessMode: number
  id: string
  videoUrl: string
  label: string
  value: string
  sn: string
  channelId: string
  deviceId: string
  customUrl: string
  params: GBT28181Params
}

export const option = {
  autoSwitch: false, //开启切换
  interval: 2000, // 自动播放的间隔(ms)
  dataset: [
    {
      id: null,
      url: null,
      sourceType: sourceTypeEnum.CUSTOM,
      organization: '',
      autoPlay: true,
      accessMode:'', channelId:'', deviceId:'', customUrl:''
    }
  ],
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = CameraConfig.key
  public chartConfig = cloneDeep(CameraConfig)
  public option = cloneDeep(option)
}