Do not clear the timeline after the Cast receiver disconnects

The goal is to enable the app to fetch the timeline after a
disconnection in order to prepare and resume local playback.

PiperOrigin-RevId: 671022044
This commit is contained in:
aquilescanta 2024-09-04 10:39:59 -07:00 committed by Copybara-Service
parent 87bd9ba585
commit a00c446529
2 changed files with 4 additions and 5 deletions

View File

@ -42,6 +42,8 @@
* MIDI extension:
* Leanback extension:
* Cast Extension:
* Stop clearning the timeline after the CastSession disconnects, which
enables the sender app to resume playback locally after a disconnection.
* Test Utilities:
* Demo app:
* Remove deprecated symbols:

View File

@ -1283,11 +1283,8 @@ public final class CastPlayer extends BasePlayer {
remoteMediaClient.registerCallback(statusListener);
remoteMediaClient.addProgressListener(statusListener, PROGRESS_REPORT_PERIOD_MS);
updateInternalStateAndNotifyIfChanged();
} else {
updateTimelineAndNotifyIfChanged();
if (sessionAvailabilityListener != null) {
sessionAvailabilityListener.onCastSessionUnavailable();
}
} else if (sessionAvailabilityListener != null) {
sessionAvailabilityListener.onCastSessionUnavailable();
}
}