feat: enhance streaming functionality with format support and fallback mechanism

- Added support for an optional 'format' query parameter in the streaming endpoint to allow raw file retrieval.
- Implemented a fallback mechanism in the VideoPlayer to automatically switch to raw file playback when HLS streaming fails.
- Improved error handling and logging for HLS playback issues, ensuring better user feedback and recovery attempts.
- Updated the Indeehub API service to accommodate the new format parameter in the streaming URL request.
This commit is contained in:
Dorian
2026-02-14 10:56:37 +00:00
parent 0ae2638af9
commit 674c9f80c5
4 changed files with 129 additions and 55 deletions

View File

@@ -130,16 +130,22 @@ class IndeehubApiService {
}
/**
* Get streaming URL for a content item
* Returns different data based on deliveryMode (native vs partner)
* Get streaming URL for a content item.
* Returns different data based on deliveryMode (native vs partner).
*
* @param contentId - The content or project ID
* @param format - Optional format override. Pass 'raw' to skip HLS and
* get a presigned URL to the original file (useful as a
* fallback when HLS decryption fails).
*/
async getStreamingUrl(contentId: string): Promise<{
async getStreamingUrl(contentId: string, format?: string): Promise<{
url: string
deliveryMode: 'native' | 'partner'
keyUrl?: string
drmToken?: string
}> {
const response = await this.client.get(`/contents/${contentId}/stream`)
const params = format ? { format } : undefined
const response = await this.client.get(`/contents/${contentId}/stream`, { params })
return response.data
}