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:
Dorian
2026-02-13 00:04:53 +00:00
parent 0da83f461c
commit 7e9a35a963
9 changed files with 706 additions and 262 deletions

View File

@@ -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`)
}
/**