Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class EncodedVideoUnitViewModel(
CastContext.getSharedInstance(context, executor).addOnCompleteListener {
it.result?.let { castContext ->
castPlayer = CastPlayer(castContext)
isUpdatedMutable.value = true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ open class VideoUnitViewModel(
val currentVideoTime: LiveData<Long>
get() = _currentVideoTime

private val _isUpdated = MutableLiveData(true)
protected val isUpdatedMutable = MutableLiveData(true)
val isUpdated: LiveData<Boolean>
get() = _isUpdated
get() = isUpdatedMutable

private val _currentIndex = MutableStateFlow(0)
val currentIndex = _currentIndex.asStateFlow()
Expand All @@ -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
Expand Down