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
(cherry picked from commit a00c446529)
This commit is contained in:
aquilescanta 2024-09-04 10:39:59 -07:00 committed by Iván Budnik
parent 4e305729a0
commit 4e8f17a7cb
2 changed files with 5 additions and 5 deletions

View file

@ -118,6 +118,9 @@ This release includes the following changes since the
* Playback is enabled with a stereo layout as well as 5.1 with * Playback is enabled with a stereo layout as well as 5.1 with
spatialization together with optional head tracking enabled, but spatialization together with optional head tracking enabled, but
binaural playback support is currently not available. binaural playback support is currently not available.
* Cast Extension:
* Stop clearning the timeline after the CastSession disconnects, which
enables the sender app to resume playback locally after a disconnection.
* Test Utilities: * Test Utilities:
* `DataSourceContractTest` now includes tests to verify: * `DataSourceContractTest` now includes tests to verify:
* Input stream `read position` is updated. * Input stream `read position` is updated.

View file

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