Do not call playVideo on reconnects, but instead check MEDIA_STATUS.

This commit is contained in:
Koen J 2025-07-24 13:05:28 +02:00
commit 3d7b347e49

View file

@ -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.");