Skip to content

Commit ddcb57d

Browse files
fix: issue to load the video through chrome-cast device (#83) (#436)
fixes: LEARNER-10350 Co-authored-by: Farhan Arshad <[email protected]>
1 parent 0156743 commit ddcb57d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

course/src/main/java/org/openedx/course/presentation/unit/video/EncodedVideoUnitViewModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class EncodedVideoUnitViewModel(
106106
CastContext.getSharedInstance(context, executor).addOnCompleteListener {
107107
it.result?.let { castContext ->
108108
castPlayer = CastPlayer(castContext)
109+
isUpdatedMutable.value = true
109110
}
110111
}
111112
}

course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitViewModel.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ open class VideoUnitViewModel(
4040
val currentVideoTime: LiveData<Long>
4141
get() = _currentVideoTime
4242

43-
private val _isUpdated = MutableLiveData(true)
43+
protected val isUpdatedMutable = MutableLiveData(true)
4444
val isUpdated: LiveData<Boolean>
45-
get() = _isUpdated
45+
get() = isUpdatedMutable
4646

4747
private val _currentIndex = MutableStateFlow(0)
4848
val currentIndex = _currentIndex.asStateFlow()
@@ -63,9 +63,9 @@ open class VideoUnitViewModel(
6363
viewModelScope.launch {
6464
notifier.notifier.collect {
6565
if (it is CourseVideoPositionChanged && videoUrl == it.videoUrl) {
66-
_isUpdated.value = false
66+
isUpdatedMutable.value = false
6767
_currentVideoTime.value = it.videoTime
68-
_isUpdated.value = true
68+
isUpdatedMutable.value = true
6969
isPlaying = it.isPlaying
7070
} else if (it is CourseSubtitleLanguageChanged) {
7171
transcriptLanguage = it.value

0 commit comments

Comments
 (0)