version 1.0.0 #67

已合并
Seil0 2022-10-12 15:36:39 +02:00 将 137 次代码提交从 develop 合并至 master
共有 89 个文件被更改,包括 4319 次插入2150 次删除
仅显示提交 8eb737a831 的更改 - 显示所有提交

查看文件

@ -85,8 +85,6 @@ class PlayerActivity : AppCompatActivity() {
hideBars() // Initial hide the bars hideBars() // Initial hide the bars
playerBinding = ActivityPlayerBinding.bind(findViewById(R.id.player_root)) playerBinding = ActivityPlayerBinding.bind(findViewById(R.id.player_root))
println(findViewById(R.id.player_controls_root))
controlsBinding = PlayerControlsBinding.bind(findViewById(R.id.player_controls_root)) controlsBinding = PlayerControlsBinding.bind(findViewById(R.id.player_controls_root))
model.loadMediaAsync( model.loadMediaAsync(

查看文件

@ -32,10 +32,7 @@ import com.google.android.exoplayer2.ExoPlayer
import com.google.android.exoplayer2.MediaItem import com.google.android.exoplayer2.MediaItem
import com.google.android.exoplayer2.Player import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.*
import kotlinx.coroutines.joinAll
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.mosad.teapod.R import org.mosad.teapod.R
import org.mosad.teapod.parser.crunchyroll.* import org.mosad.teapod.parser.crunchyroll.*
import org.mosad.teapod.preferences.Preferences import org.mosad.teapod.preferences.Preferences
@ -276,7 +273,8 @@ class PlayerViewModel(application: Application) : AndroidViewModel(application)
val playhead = (player.currentPosition / 1000) val playhead = (player.currentPosition / 1000)
if (playhead > 0 && Preferences.updatePlayhead) { if (playhead > 0 && Preferences.updatePlayhead) {
viewModelScope.launch { Crunchyroll.postPlayheads(currentEpisode.id, playhead.toInt()) } // don't use viewModelScope here. This task may needs to finish, when ViewModel will be cleared
CoroutineScope(Dispatchers.IO).launch { Crunchyroll.postPlayheads(currentEpisode.id, playhead.toInt()) }
Log.i(javaClass.name, "Set playhead for episode ${currentEpisode.id} to $playhead sec.") Log.i(javaClass.name, "Set playhead for episode ${currentEpisode.id} to $playhead sec.")
} }