Add HLS.js support and enhance content streaming logic
- Integrated HLS.js version 1.6.15 into the project for improved video streaming capabilities. - Updated the ContentsController to check for HLS manifest availability and fall back to presigned URLs for original files if not found. - Enhanced the VideoPlayer component to handle loading and error states more effectively, improving user experience during streaming. - Refactored content service methods to return detailed streaming information, including HLS and DASH manifest URLs.
This commit is contained in:
@@ -57,10 +57,15 @@ class ContentService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get streaming URL for content (requires subscription or rental)
|
||||
* Get streaming URLs for content (requires subscription or rental).
|
||||
* Returns the HLS / DASH / FairPlay manifest URLs from the backend.
|
||||
*/
|
||||
async getStreamingUrl(contentId: string): Promise<{ url: string; drmToken?: string }> {
|
||||
return apiService.get<{ url: string; drmToken?: string }>(`/contents/${contentId}/stream`)
|
||||
async getStreamInfo(contentId: string): Promise<{
|
||||
file: string
|
||||
widevine: string
|
||||
fairplay: string
|
||||
}> {
|
||||
return apiService.get(`/contents/${contentId}/stream`)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user