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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user