textureview onSurfaceTextureAvailable never called inside relativelayout inside fragment

后端 未结 7 1418
走了就别回头了
走了就别回头了 2020-12-10 10:52

onSurfaceTextureAvailable in VideoView is never called...
I have this view that is holding the textureview.

public class MyMediaPlayer extends RelativeLa         


        
相关标签:
7条回答
  • 2020-12-10 11:36

    You need to enable hardware acceleration to use TextureView. If you don't, its callback methods will not be called. Just pout that in your activity's onCreate method:

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
    

    It worked for me.

    0 讨论(0)
提交回复
热议问题