* ISSUES THAT IGNORE THIS TEMPLATE WILL BE CLOSED WITHOUT INVESTIGATION *
Fill out the sections below, leaving the headers but replacing the content. If
you're unable to provide certain information, please explain why in the relevant
section. We may close issues if they do not include sufficient information.
Describe the issue in detail, including observed and expected behavior.
Describe how the issue can be reproduced, ideally using the ExoPlayer demo app.
Provide a link to media that reproduces the issue. If you don't wish to post it
publicly, please submit the issue, then email the link to
dev.[email protected] including the issue number in the subject line.
Specify the absolute version number. Avoid using terms such as "latest".
Specify the devices and versions of Android on which the issue can be
reproduced, and how easily it reproduces. If possible, please test on multiple
devices and Android versions.
Capture a full bug report using "adb bugreport". Output from "adb logcat" or a
log snippet is NOT sufficient. Please attach the captured bug report as a file.
If you don't wish to post it publicly, please submit the issue, then email the
bug report to dev.[email protected] including the issue number in the subject
line.
please test it on my exoplayer demo application (https://github.com/vishnuganta22/exoPlayerDemo)
while testing using my application please place two video with name's 1.mp4 and 2.mp4 in Download directory
Please let me know if you find any work around this issue
This issue is being closed because it does not adhere to our issue template, and/or because it omits information requested in the issue template that is required for us to investigate the problem efficiently. The issue template can be found here.
If you鈥檙e able to provide complete information as requested in the issue template, please do so below and we鈥檒l re-open the issue. Thanks!
@ojw28 @andrewlewis We have faced the same issue. We have a player application which needs to loop a slideshow of videos. The views are dynamically constructed based on the dimension config and then attached. The first video may need to play in a full screen and the second one might play in 500 * 500 square.
For every file playback, a new SimpleExoPlayerView and new Player instances are created. The previous player instance is stopped and released.
The last frame of the first video appears as a static image in the second player view and the second video continues playing only the audio.
Everything absolutely works using android videoview and media player. We are planning to migrate to ExoPlayer and stuck with this issue. Can you please help us out?
@ojw28 and @andrewlewis
While playing multiple videos in SimpleExoplayerView using different dimension configs, the last frame of the first video is overlapping on the second video, But Still, we are able to hear the audio of the second video.
1.Play a video in SimpleExoplayerView [Width: 100% and Height: 100 %] and after the video is completed release the player and change the visibility view to GONE.
2.play another video in a new SimpleExolayerView with different dimensions may be [Width: 50% and Height: 100%] then you will see the last frame of the first video being overlapped on the second video
But still, you can able to hear the audio of the second video
My Demo Application source code is available in this link https://github.com/vishnuganta22/exoPlayerDemo
If you try installing my demo application on your device then you need to place any two videos named 1.mp4 and 2.mp4 in Downloads Folder. I have also screen recorded my device. You can watch this video for a better understanding of the behavior https://vimeo.com/229082192
Exoplayer Version: r2.5.1
Android Version: 5.1.1
Device: Minix Neo X9
@ojw28 Can you please reopen the issue?
The description is quite hard to follow and we don't really have time to debug your application's code for managing views/players. It sounds like something is getting reused in the second playback (a view or player).
Please could you provide a minimal patch to the ExoPlayer demo app that reproduces the issue?
@andrewlewis Thanks for reopening the issue. I will try to send a patch on your demo app
Here is the clear problem description,
The application needs to play a slideshow of items. The item types are video and a custom designed view template which can have a slideshow within.
This is how it's implemented -
The layout has a dedicated main SimpleExoPlayerView which can play videos.
The template is constructed dynamically(new relative layout with a SimpleExoPlayer and some other views) and attached to the main layout on demand.
The visibility of the main SimpleExoPlayerView is reset as below before attaching the template view.
public static void resetSimpleExoPlayerView(@NonNull SimpleExoPlayerView videoView) {
ExoPlayer player = videoView.getPlayer();
if (player != null) {
player.stop();
player.release();
videoView.setPlayer(null);
}
videoView.setBackground(null);
videoView.setVisibility(View.GONE);
}
Whenever the template view is active (attached and visible) the new exoplayer view instead of playing the respective slideshow video, it just shows up the previos main video last frame and only play the audio.
Please watch this recorded video https://vimeo.com/229082192
@andrewlewis @vishnuganta22 Adding this line to resetSimplExoPlayerView() method have solved the issue.
videoView.getVideoSurfaceView().setVisibility(GONE)
But at the start of playback the video region flickers in black colour on every transition which is a little noise for the user.
Are you saying that simpleExoPlayerView.setVisibility(View.GONE); doesn't hide the first player, but simpleExoPlayerView.getVideoSurfaceView().setVisibility(View.GONE) does hide it?
For the flickering issue, I wonder whether this is due to the shutter background color (see #3172).
@andrewlewis setting simpleExoPlayerView.getVideoSurfaceView().setVisibility(View.GONE) fixed our issue
@andrewlewis may be setVisibility() of SimpleExoPlayerView should be overridden such that simpleExoPlayerView.setVisibility(View.GONE); will setVisibility to the whole viewgroup
simpleExoPlayerView is a parent of the SurfaceView, so the SurfaceView should be hidden when you hide its parent player view (hiding a view group hides its children). This is the behavior I see in the demo app if I hide the player view, but it's not consistent with the behavior you've described.
If you snapshot the view hierarchy after hiding the player view do you see its child SurfaceView still set to be visible?
Able to replicate the same issue on Android 7.0 using a Moto G5 plus. Same version of Exoplayer.
Please could someone provide a simple patch to our demo app that makes it possible to reproduce the problem (without us spending a lot of effort)? It definitely shouldn't be necessary to manually set the visibility of the child video surface.
@ojw28 @andrewlewis
Made a simple patch on your demo App link
Steps to Reproduce on DemoApp
1.Just play the Custom Playlist
I can reproduce this, thanks. This looks like a platform bug related to SurfaceView, since it doesn't reproduce using TextureView. It also doesn't reproduce on a device I have running Oreo, so I'm guessing it's been fixed. was fixed in the platform.
We'll add a workaround that explicitly propagates the visibility set on SimpleExoPlayerView to its child surfaceView (which is identical to what you're doing, but done internally).
This fix actually caused a problem in my app. I have a still ImageView and an SimpleExoPlayerView. When a video has loaded (onPlayerStateChanged with STATE_READY), the still image is hidden and the video is displayed.
imageView.setVisibility(GONE);
simpleExoPlayerView.setVisibility(View.VISIBLE);
simpleExoPlayer.setPlayWhenReady(true);
When the user navigates to the next video, the video is hidden and the still image is displayed.
simpleExoPlayerView.setVisibility(View.GONE);
imageView.setVisibility(VISIBLE);
This repeats for every video.
With ExoPlayer r2.5.1, the transitions between the still image and the video are seamless. WIth r2.5.2+, there is a black flash for a frame or so when hiding the image and displaying the video.
This black flash is caused by the workaround aboe for this issue. I can fix the black flash by changing the second code block above to the following:
simpleExoPlayerView.setVisibility(View.GONE);
simpleExoPlayerView.getVideoSurfaceView().setVisibility(View.VISIBLE);
imageView.setVisibility(VISIBLE);
Most helpful comment
@ojw28 and @andrewlewis
Issue description
While playing multiple videos in SimpleExoplayerView using different dimension configs, the last frame of the first video is overlapping on the second video, But Still, we are able to hear the audio of the second video.
Reproduction steps
1.Play a video in SimpleExoplayerView [Width: 100% and Height: 100 %] and after the video is completed release the player and change the visibility view to GONE.
2.play another video in a new SimpleExolayerView with different dimensions may be [Width: 50% and Height: 100%] then you will see the last frame of the first video being overlapped on the second video
But still, you can able to hear the audio of the second video
Link to test content
My Demo Application source code is available in this link https://github.com/vishnuganta22/exoPlayerDemo
If you try installing my demo application on your device then you need to place any two videos named 1.mp4 and 2.mp4 in Downloads Folder. I have also screen recorded my device. You can watch this video for a better understanding of the behavior https://vimeo.com/229082192
Version of ExoPlayer being used
Exoplayer Version: r2.5.1
Device(s) and version(s) of Android being used
Android Version: 5.1.1
Device: Minix Neo X9