mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-09-10 11:51:58 +02:00
ChromecastListener has always implemented CastStateListener, but nothing ever registered it. Whether a receiver was reported as available hung entirely on the media router callback, which does not always fire - and then the cast button never appears even though devices are there. The framework's own signal is registered now and the current state is reported straight away. It is not taken at face value in one direction: the framework drops back to NO_DEVICES_AVAILABLE when a session ends, because it stops discovering at that point, which would hide the button right after someone stops casting. The devices the media router still knows decide that case. The listener is dropped again when the activity goes.