Moves the prepare video call to IO
This commit is contained in:
+2
-2
@@ -64,7 +64,7 @@ fun GetVideoController(
|
|||||||
if (controllerId.needsController()) {
|
if (controllerId.needsController()) {
|
||||||
// If there is a connection, don't wait.
|
// If there is a connection, don't wait.
|
||||||
if (!onlyOnePreparing.getAndSet(true)) {
|
if (!onlyOnePreparing.getAndSet(true)) {
|
||||||
scope.launch {
|
scope.launch(Dispatchers.IO) {
|
||||||
Log.d("PlaybackService", "Preparing Video ${controllerId.id} ${mediaItem.src.videoUri}")
|
Log.d("PlaybackService", "Preparing Video ${controllerId.id} ${mediaItem.src.videoUri}")
|
||||||
PlaybackServiceClient.prepareController(
|
PlaybackServiceClient.prepareController(
|
||||||
mediaControllerState = controllerId,
|
mediaControllerState = controllerId,
|
||||||
@@ -172,7 +172,7 @@ fun GetVideoController(
|
|||||||
// if the controller is not null, just continue playing what the controller was playing
|
// if the controller is not null, just continue playing what the controller was playing
|
||||||
if (controllerId.needsController()) {
|
if (controllerId.needsController()) {
|
||||||
if (!onlyOnePreparing.getAndSet(true)) {
|
if (!onlyOnePreparing.getAndSet(true)) {
|
||||||
scope.launch(Dispatchers.Main) {
|
scope.launch(Dispatchers.IO) {
|
||||||
Log.d("PlaybackService", "Preparing Video from Resume ${controllerId.id} ${mediaItem.src.videoUri} ")
|
Log.d("PlaybackService", "Preparing Video from Resume ${controllerId.id} ${mediaItem.src.videoUri} ")
|
||||||
PlaybackServiceClient.prepareController(
|
PlaybackServiceClient.prepareController(
|
||||||
mediaControllerState = controllerId,
|
mediaControllerState = controllerId,
|
||||||
|
|||||||
Reference in New Issue
Block a user