// lib/media.js // Copyright (C) 2024 DTP Technologies, LLC // All Rights Reserved 'use strict'; import mongoose from 'mongoose'; const Schema = mongoose.Schema; const EPISODE_STATUS_LIST = [ 'starting', // the stream is connecting 'live', // the stream is live 'ending', // the stream has ended, queued for processing 'processing', // the stream is being processed for DVR 'replay', // the stream is available on the DVR 'expired', // the stream is expired (removed) ]; const VIDEO_STATUS_LIST = [ 'new', // the video (original) is on storage / queued 'processing', // the video is being processed for distribution 'live', // the video is available for distribution 'removed', // the video has been removed ]; const ROOM_STATUS_LIST = [ 'starting', // the room is starting a call 'live', // the room has a live call 'shutdown', // the room is closing it's live call 'expired', // the room has failed to check in 'crashed', // the room's worker or server has crashed ]; const MediaMetadataSchema = new Schema({ type: { type: String }, size: { type: Number }, bitRate: { type: Number }, duration: { type: Number }, video: { width: { type: Number }, height: { type: Number }, fps: { type: Number }, }, }); const AudioMetadataSchema = new Schema({ type: { type: String }, size: { type: Number }, bitRate: { type: Number }, duration: { type: Number }, audio: { codecName: { type: String }, sampleFormat: { type: String }, sampleRate: { type: Number }, bitsPerSample: { type: Number }, channelCount: { type: Number }, }, }); export { EPISODE_STATUS_LIST, VIDEO_STATUS_LIST, ROOM_STATUS_LIST, MediaMetadataSchema, AudioMetadataSchema, };