- Replaced npm ci with npm install in docker-compose for better package management. - Introduced remote component loading for the VideoStreamingPage with error handling. - Updated the title in index.html to "Experiments Dashboard" for clarity. - Added new video remote service configuration in docker-compose for improved integration. - Removed deprecated files and components related to the video streaming feature to streamline the codebase. - Updated package.json and package-lock.json to include @originjs/vite-plugin-federation for module federation support.
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import { apiClient } from './client'
|
|
import type { VideoListParams, VideoListResponse } from '../types/video'
|
|
|
|
const BASE = (import.meta as any).env?.VITE_VISION_API_URL || '/api'
|
|
|
|
export const videoApi = {
|
|
async list(params: VideoListParams = {}): Promise<VideoListResponse> {
|
|
const search = new URLSearchParams()
|
|
Object.entries(params).forEach(([k, v]) => {
|
|
if (v !== undefined && v !== null) search.append(k, String(v))
|
|
})
|
|
const qs = search.toString()
|
|
return apiClient.get(`${BASE}/videos/${qs ? `?${qs}` : ''}`)
|
|
},
|
|
streamingUrl(fileId: string): string {
|
|
return `${BASE}/videos/${fileId}/stream`
|
|
},
|
|
thumbnailUrl(fileId: string, params: { timestamp?: number; width?: number; height?: number } = {}): string {
|
|
const search = new URLSearchParams()
|
|
Object.entries(params).forEach(([k, v]) => {
|
|
if (v !== undefined && v !== null) search.append(k, String(v))
|
|
})
|
|
const qs = search.toString()
|
|
return `${BASE}/videos/${fileId}/thumbnail${qs ? `?${qs}` : ''}`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|