O
O
Oleg Dolgih2014-10-02 07:32:36
Android
Oleg Dolgih, 2014-10-02 07:32:36

How to show video in dialog box?

There was a problem with displaying the VideoView in the dialog (android.app.Dialog)
Before this, the video was played in the Activity and everything was fine, but when you try to display it in the dialog, everything breaks.
this is how the video is displayed in the activity ,
Screen%20Shot%202014-10-01%20at%206.33.3
and this is how the dialog
Screen%20Shot%202014-10-01%20at%206.49.1
is created in the dialog, a VideoView is placed on it, but the video content itself is not visible, it just becomes transparent.
At the same time, clicks on the VideoView are processed.
Well, the question is: how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur Glyzin, 2015-02-18
@forceLain

VideoView uses a SurfaceView internally, which has a tricky display logic: surfaceview takes its place in the layout, but to display the video it creates a new Window above the place where it is located. Try using a TextureView which honestly shows its content in the same window.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question