Adam Styrc
Adam Styrc

Reputation: 1537

Two VideoView overlapping

I am making workout sample app. When one exercise is getting close to finish I would like to show small trailer of next exercise like below:

enter image description here

To accomplish that, I had to call:

videoViewTrailer.setZOrderMediaOverlay(true)

However when I hide trailer view I find myself left with frozen frame from trailer video which ruins my current exercise video. Here it is: enter image description here

I already tried a lot of combination with using

VideoView.setZOrderMediaOverlay(true)
VideoView.setTranslationZ()
VideoView.setZOrderOnTop()

on both videoViews - and even calling:

View.invalidate()

but nothing seems to help.

How can I totally remove trailer video from my visible layout ?

PS. Mind I already offered nice views for help in advance :)

Upvotes: 1

Views: 573

Answers (1)

Adam Styrc
Adam Styrc

Reputation: 1537

I managed to solve the problem by removing and readding trailer VideoView from parent ViewGroup! It turns out manipuating visibility or Z overlay param is not enought.

Upvotes: 1

Related Questions