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 17adfcddf..08fde815b 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 @@ -106,6 +106,7 @@ class EncodedVideoUnitViewModel( CastContext.getSharedInstance(context, executor).addOnCompleteListener { it.result?.let { castContext -> castPlayer = CastPlayer(castContext) + isUpdatedMutable.value = 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 63425ffec..0360d9dc6 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 @@ -40,9 +40,9 @@ open class VideoUnitViewModel( val currentVideoTime: LiveData get() = _currentVideoTime - private val _isUpdated = MutableLiveData(true) + protected val isUpdatedMutable = MutableLiveData(true) val isUpdated: LiveData - get() = _isUpdated + get() = isUpdatedMutable private val _currentIndex = MutableStateFlow(0) val currentIndex = _currentIndex.asStateFlow() @@ -63,9 +63,9 @@ open class VideoUnitViewModel( viewModelScope.launch { notifier.notifier.collect { if (it is CourseVideoPositionChanged && videoUrl == it.videoUrl) { - _isUpdated.value = false + isUpdatedMutable.value = false _currentVideoTime.value = it.videoTime - _isUpdated.value = true + isUpdatedMutable.value = true isPlaying = it.isPlaying } else if (it is CourseSubtitleLanguageChanged) { transcriptLanguage = it.value