Skip to content

VLCVideoLayout with textureView cannot resume playback

Description

I'm trying to run example from libvlc-android-sample but with libvlc-all updated to latest version (3.3.10) and with USE_TEXTURE_VIEW set to true. The video plays just fine but if I go to the home screen (or to recent apps - anything that would cause onStop() to be invoked) and get back to the app, the video is frozen and I cannot make it play again.

It seems that the surface state is marked as READY only when we get a onSurfaceTextureAvailable callback while when we're resuming the app that callback is fired before the listener is even set and there is no option to get it invoked later. Maybe the surface should be set also in onSurfaceTextureUpdated callback (if not set bafore)?

It works just fine if I don't use TextureView.

Comparing with the old flow, it seems that this problem may be connected to this change in AWindow class: ec2b3edf

Expected behavior

We should be able to resume the playback once we get back to the app.

Actual behavior

The stream is frozen with no option to resume it.

Steps to reproduce

  1. Download https://code.videolan.org/videolan/libvlc-android-samples
  2. Change dependency to implementation 'org.videolan.android:libvlc-all:3.3.10'
  3. Set USE_TEXTURE_VIEW in JavaActivity to true.
  4. Run the app. (video plays normally)
  5. Send app to the background.
  6. Resume the app. (video is frozen)
Edited by Aleksandra Krzemień