|
|
|
@ -53,8 +53,8 @@ class TVViewModel(private var tv: TV) : ViewModel() { |
|
|
|
val videoIndex: LiveData<Int> |
|
|
|
val videoIndex: LiveData<Int> |
|
|
|
get() = _videoIndex |
|
|
|
get() = _videoIndex |
|
|
|
|
|
|
|
|
|
|
|
private val _logo = MutableLiveData<String>() |
|
|
|
private val _logo = MutableLiveData<Any>() |
|
|
|
val logo: LiveData<String> |
|
|
|
val logo: LiveData<Any> |
|
|
|
get() = _logo |
|
|
|
get() = _logo |
|
|
|
|
|
|
|
|
|
|
|
private val _pid = MutableLiveData<String>() |
|
|
|
private val _pid = MutableLiveData<String>() |
|
|
|
@ -73,11 +73,8 @@ class TVViewModel(private var tv: TV) : ViewModel() { |
|
|
|
val ready: LiveData<Boolean> |
|
|
|
val ready: LiveData<Boolean> |
|
|
|
get() = _ready |
|
|
|
get() = _ready |
|
|
|
|
|
|
|
|
|
|
|
private var mMinimumLoadableRetryCount = 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var seq = 0 |
|
|
|
var seq = 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun addVideoUrl(url: String) { |
|
|
|
fun addVideoUrl(url: String) { |
|
|
|
if (_videoUrl.value?.isNotEmpty() == true) { |
|
|
|
if (_videoUrl.value?.isNotEmpty() == true) { |
|
|
|
if (_videoUrl.value!!.last().contains("cctv.cn")) { |
|
|
|
if (_videoUrl.value!!.last().contains("cctv.cn")) { |
|
|
|
@ -114,10 +111,6 @@ class TVViewModel(private var tv: TV) : ViewModel() { |
|
|
|
_videoIndex.value = videoIndex |
|
|
|
_videoIndex.value = videoIndex |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setLogo(url: String) { |
|
|
|
|
|
|
|
_logo.value = url |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
init { |
|
|
|
_id.value = tv.id |
|
|
|
_id.value = tv.id |
|
|
|
_title.value = tv.title |
|
|
|
_title.value = tv.title |
|
|
|
@ -197,10 +190,6 @@ class TVViewModel(private var tv: TV) : ViewModel() { |
|
|
|
mHeaders = headers |
|
|
|
mHeaders = headers |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setMinimumLoadableRetryCount(minimumLoadableRetryCount: Int) { |
|
|
|
|
|
|
|
mMinimumLoadableRetryCount = minimumLoadableRetryCount |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* (playerView?.player as ExoPlayer).setMediaSource(tvViewModel.buildSource()) |
|
|
|
* (playerView?.player as ExoPlayer).setMediaSource(tvViewModel.buildSource()) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|