Skip to content

release build: v04.06.00

Compare
Choose a tag to compare
@warren-bank warren-bank released this 17 May 19:42
· 42 commits to 04-webcast-filename since this release
bug fix: uncaught exception when CastSession ends in "CAST_ONLY" mode
-------------------------------------------------------------------

issue:
  * uncaught exception leads to crash

steps to reproduce:
  * pause "VideoActivity"
  * click "stop" on TV remote control to end CastSession

-------------------------------------------------------------------

CastPlayer:
===========

onSessionEnded()
 -> setRemoteMediaClient(null)
    -> sessionAvailabilityListener.onCastSessionUnavailable()

VideoManager:
=============

onCastSessionUnavailable()
 -> release(false)
    -> release_castPlayer(false)
       -> castPlayer.release()

CastPlayer:
===========

release()
 -> sessionManager.endCurrentSession(false)
    -> ERROR: because this entire chain of events started when the current session ended..

solution:
=========

in: VideoManager
in: -> onCastSessionUnavailable
old:   -> release(false)
new:   -> release(true)  // retain_cast_session

-------------------------------------------------------------------

old:
====

  @Override
  public void onCastSessionUnavailable() {
    if (castPlayer == null) return;

    if (playbackMode == PlaybackMode.CAST_ONLY) {
      setPlaybackMode(PlaybackMode.RELEASED);
    }
    else {
      setCurrentPlayer(exoPlayer);
    }
  }

new:
====

  @Override
  public void onCastSessionUnavailable() {
    if (castPlayer == null) return;

    if (playbackMode == PlaybackMode.CAST_ONLY) {
      setPlaybackMode(PlaybackMode.RELEASED_ALL_BUT_CAST_SESSION);
    }
    else {
      setCurrentPlayer(exoPlayer);
    }
  }

-------------------------------------------------------------------