From 0368c3bb2564ca4d381d8ab019f3b46e90174124 Mon Sep 17 00:00:00 2001 From: Farhan Arshad <43750646+farhan-arshad-dev@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:36:23 +0500 Subject: [PATCH] fix: issue to load the video through chrome-cast device (#83) fixes: LEARNER-10350 --- .../course/presentation/unit/video/EncodedVideoUnitViewModel.kt | 1 + .../course/presentation/unit/video/VideoUnitViewModel.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/course/src/main/java/org/openedx/course/presentation/unit/video/EncodedVideoUnitViewModel.kt b/course/src/main/java/org/openedx/course/presentation/unit/video/EncodedVideoUnitViewModel.kt index 4ef854592..ab3e3e60d 100644 --- a/course/src/main/java/org/openedx/course/presentation/unit/video/EncodedVideoUnitViewModel.kt +++ b/course/src/main/java/org/openedx/course/presentation/unit/video/EncodedVideoUnitViewModel.kt @@ -120,6 +120,7 @@ class EncodedVideoUnitViewModel( val executor = Executors.newSingleThreadExecutor() CastContext.getSharedInstance(context, executor).addOnSuccessListener { castContext -> castPlayer = CastPlayer(castContext) + _isUpdated.value = true }.addOnFailureListener { logger.e(it, true) } diff --git a/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitViewModel.kt b/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitViewModel.kt index f753c9cef..42dbf5be9 100644 --- a/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitViewModel.kt +++ b/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitViewModel.kt @@ -42,7 +42,7 @@ open class VideoUnitViewModel( val currentVideoTime: LiveData get() = _currentVideoTime - private val _isUpdated = MutableLiveData(true) + protected val _isUpdated = MutableLiveData(true) val isUpdated: LiveData get() = _isUpdated