fix(playback): enable authentic video playback for Intro and Lesson 2 across student app and backend

This commit is contained in:
Hamza-Ayed
2026-09-09 01:23:51 +03:00
parent 0a2ca71cb4
commit a8e895d5da
7 changed files with 179 additions and 60 deletions
@@ -121,10 +121,14 @@ class CurriculumRepository {
}
/// Fetch lesson playback details (streams, checkpoints, and versions) from Live API
Future<LessonPlaybackData> getLessonPlayback(String curriculumKey, {String? subjectId, String? unitId}) async {
AppLogger.log('Fetching live playback data for curriculum key $curriculumKey...', tag: 'CURRICULUM_REPO');
Future<LessonPlaybackData> getLessonPlayback(String curriculumKey, {String? subjectId, String? unitId, String? title}) async {
AppLogger.log('Fetching live playback data for curriculum key $curriculumKey (title: $title)...', tag: 'CURRICULUM_REPO');
final res = await _api.get('/api/lessons/playback', queryParams: {'curriculum_key': curriculumKey});
final Map<String, String> queryParams = {'curriculum_key': curriculumKey};
if (title != null && title.isNotEmpty) {
queryParams['title'] = title;
}
final res = await _api.get('/api/lessons/playback', queryParams: queryParams);
if (res is Map && res['data'] != null) {
return LessonPlaybackData.fromJson(Map<String, dynamic>.from(res['data']));
}