diff --git a/app/src/main/java/com/futo/platformplayer/casting/ChomecastCastingDevice.kt b/app/src/main/java/com/futo/platformplayer/casting/ChomecastCastingDevice.kt index e2c711ce..f6582055 100644 --- a/app/src/main/java/com/futo/platformplayer/casting/ChomecastCastingDevice.kt +++ b/app/src/main/java/com/futo/platformplayer/casting/ChomecastCastingDevice.kt @@ -561,7 +561,6 @@ class ChromecastCastingDevice : CastingDevice { _transportId = transportId; requestMediaStatus(); - playVideo(); } } } @@ -641,6 +640,12 @@ class ChromecastCastingDevice : CastingDevice { stopVideo(); } } + + val needsLoad = statuses.length() == 0 || (statuses.getJSONObject(0).getString("playerState") == "IDLE") + if (needsLoad && _contentId != null && _mediaSessionId == null) { + Logger.i(TAG, "Receiver idle, sending initial LOAD") + playVideo() + } } else if (type == "CLOSE") { if (message.sourceId == "receiver-0") { Logger.i(TAG, "Close received.");