Video và offline
Upload video
Browser init upload -> presigned URL -> PUT object storage -> confirm
-> video asset -> ingest job -> Shaka package -> playback manifest
Các file liên quan:
PresignedUploadUseCaseUploadCleanupSchedulerVideoAssetIngestServiceVideoIngestJob*adaptive-video-player
Playback
LMS dùng Shaka Player để phát HLS/DASH adaptive streaming. Ý tưởng chính:
- Nhiều profile bitrate/resolution.
- Browser tự chọn chất lượng theo mạng/thiết bị.
- Media có thể đi qua
media.holilihu.onlinevà edge auth.
ABR/ARB trong Shaka
Thuật ngữ đúng là ABR: adaptive bitrate. Nếu gõ nhầm là ARB trong search, docs vẫn dẫn về phần này. Khi cần chỉnh logic chọn chất lượng video, mở:
fe/src/app/features/learning/presentation/components/adaptive-video-playerfe/src/app/core/services/offline-video.service.ts- Backend video asset/playback và
ShakaPackagerService
Không nên nói ABR là tự tăng chất lượng cố định. Cách nói đúng: player quan sát mạng, buffer và thiết bị để chọn rendition phù hợp trong manifest HLS/DASH.
Offline/PWA
Offline không phải chỉ cache HTML. Nó gồm:
| Phần | Công nghệ | Vai trò |
|---|---|---|
| App shell | Angular Service Worker | Mở app khi mất mạng |
| Metadata | IndexedDB/Dexie | Lưu course/lesson/progress local |
| Video offline | Offline profiles | File/video phù hợp tải về |
| Sync queue | Offline sync service | Đẩy progress khi online lại |
File cần mở:
fe/src/app/core/db/lms-offline.db.tsfe/src/app/core/services/course-download.service.tsfe/src/app/core/services/offline-video.service.tsfe/src/app/core/services/offline-sync.service.tsfe/ngsw-config.json
Trang liên quan
- Interactive video và storage health: hotspot, fill blank, drag drop, storage reset/quota/corruption.
- Runtime và deploy: dedicated video worker, R2, media domain edge auth.
- Troubleshooting: lỗi PWA/service worker/offline storage thường gặp.