Refactor video streaming feature and update dependencies
- 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.
This commit is contained in:
30
management-dashboard-web-app/src/shared/api/video.ts
Normal file
30
management-dashboard-web-app/src/shared/api/video.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
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}` : ''}`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user