google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.71k stars 6.02k forks source link

I can't Invalidate StyledPlayerView Widget #10447

Closed sajjadshahbazi closed 2 years ago

sajjadshahbazi commented 2 years ago

ExoPlayer Version

2.17.1

Devices that reproduce the issue

all devices

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

I want to play an mp4 link and after playing that, I want to clear the StyledPlayerView view. but StyledPlayerView keeps the last frame of the mp4 link. I can't invalidate the StyledPlayerView widget.

mp4 link : https://res.namava.ir/709-147fb5722f543315ad5388d415afd0e8.mp4

Expected result

I expect when Invalidate StyledPlayerView Widget, the view of StyledPlayerView to be black. same as the state of before assign exoPlayer.

Actual result

I invalidate the StyledPlayerView widget, but StyledPlayerView keeps the last frame of the mp4 link.

Media

https://res.namava.ir/709-147fb5722f543315ad5388d415afd0e8.mp4

Bug Report

ojw28 commented 2 years ago

If you want to reset the view back to how it was before the player was assigned, you should either:

  1. Detach the player from the view by calling playerView.setPlayer(null);

or

  1. Reset the player by calling player.stop(); followed by player.clearMediaItems();
sajjadshahbazi commented 2 years ago

thank you