Prior to this change, the only way to switch SimpleExoPlayerView
was to do:
oldView.setPlayer(null);
newView.setPlayer(player);
This would cause the video renderer to have to transition through
oldSurface->noSurface->newSurface, which is inefficient (noSurface
requires platform decoders to be fully released).
After this change we support:
newView.setPlayer(player);
oldView.setPlayer(null);
This results in direct oldSurface->newSurface transitions, which are
seamless on Android M and above. The change also adds some robustness
against developers ending up with strange behavior as a result of
clearing the player from a view in a different ordering than we expect
w.r.t. registering of other listeners.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154044976