Unable set animation_enabled="true" for StyledPlayerView (crashing on Android 4)
ExoPlayer Version
2.18.1
Devices that reproduce the issue
Devices that reproduce the issue: Samsung SM-T110 Android 4.2.2 Sony C2305 Android 4.2.2
App is crashing when I use StyledPlayerView attributes by default.
with
app:animation_enabled="false" animation is disabled and bug is going away
Devices that do not reproduce the issue
Real devices on Android 8+
Reproducible in the demo app?
Not tested
Reproduction steps
Implement StyledPlayerView on the xml-layout
<com.google.android.exoplayer2.ui.StyledPlayerView android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="true" app:resize_mode="zoom" app:animation_enabled="false" app:controller_layout_id="@layout/custom_tv_layout_player" android:id="@+id/view_player"/>
Expected result
Player and animation for controller works
Actual result
Playback crashes when called method prepare() of ExoPlayer instance.
2022-09-21 16:43:03.727 23862-23862/mobi.zona E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NullPointerException at android.animation.PropertyValuesHolder.setupSetterAndGetter(PropertyValuesHolder.java:505) at android.animation.ObjectAnimator.initAnimation(ObjectAnimator.java:392) at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:502) at android.animation.ValueAnimator.start(ValueAnimator.java:913) at android.animation.ValueAnimator.start(ValueAnimator.java:923) at android.animation.ObjectAnimator.start(ObjectAnimator.java:370) at android.animation.AnimatorSet$DependencyListener.startIfReady(AnimatorSet.java:709) at android.animation.AnimatorSet$DependencyListener.onAnimationStart(AnimatorSet.java:678) at android.animation.ValueAnimator.notifyStartListeners(ValueAnimator.java:881) at android.animation.ValueAnimator.start(ValueAnimator.java:916) at android.animation.ValueAnimator.start(ValueAnimator.java:923) at android.animation.AnimatorSet.start(AnimatorSet.java:511) at com.google.android.exoplayer2.ui.StyledPlayerControlViewLayoutManager.showAllBars(StyledPlayerControlViewLayoutManager.java:513) at com.google.android.exoplayer2.ui.StyledPlayerControlViewLayoutManager.show(StyledPlayerControlViewLayoutManager.java:359) at com.google.android.exoplayer2.ui.StyledPlayerControlView.show(StyledPlayerControlView.java:932) at com.google.android.exoplayer2.ui.StyledPlayerView.showController(StyledPlayerView.java:1251) at com.google.android.exoplayer2.ui.StyledPlayerView.maybeShowController(StyledPlayerView.java:1229) at com.google.android.exoplayer2.ui.StyledPlayerView.updateControllerVisibility(StyledPlayerView.java:1382) at com.google.android.exoplayer2.ui.StyledPlayerView.access$700(StyledPlayerView.java:169) at com.google.android.exoplayer2.ui.StyledPlayerView$ComponentListener.onPlaybackStateChanged(StyledPlayerView.java:1540) at com.google.android.exoplayer2.ExoPlayerImpl.lambda$updatePlaybackInfo$21(ExoPlayerImpl.java:1924) at com.google.android.exoplayer2.ExoPlayerImpl$$ExternalSyntheticLambda6.invoke(D8$$SyntheticClass) at com.google.android.exoplayer2.util.ListenerSet$ListenerHolder.invoke(ListenerSet.java:281) at com.google.android.exoplayer2.util.ListenerSet.lambda$queueEvent$0(ListenerSet.java:190) at com.google.android.exoplayer2.util.ListenerSet$$ExternalSyntheticLambda1.run(D8$$SyntheticClass) at com.google.android.exoplayer2.util.ListenerSet.flushEvents(ListenerSet.java:211) at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:1955) at com.google.android.exoplayer2.ExoPlayerImpl.prepare(ExoPlayerImpl.java:519)
Media
Any media.
Bug Report
- [ ] You will email the zip file produced by
adb bugreportto [email protected] after filing this issue.