I am a new developer working on Samsung Galaxy tab (model SM-T210R, Android version 4.4.2.
I'd like to develop an app with two media players alternatively playing but only one shown on the screen.
Currently, I am able to alternatively play two video files (one pause and the other play and then switch) by mainly following the good example from user MH (thanks) in How to play multiple video files simultaneously in one layout side by side in different view in Android. I am using a linear layout.
However, two surfaceviews are being shown on the screen all the time, including the one from the media player being paused.
Could anyone instruct how to show on the screen only the one from the active media player? Thanks a lot.
I have tried the following but they did not work (maybe I missed something?): (a) Overlap one surface view on the top of the other and set the top one transparent - However, once the media player associated with the top surface view is being played, the top surface view is not transparent anymore. Is there a way to set it to transparent in that scenario? Also, can I dynamically turn on and off the transparency setting?
(b) Use ViewSwitch class - Unfortunately, I cannot change from one surface view to another.
(c) I also tried the one in How to display two videos simultaneously with surface view. In this case, I see two video views but I wanted to have one.
(d) I also tried this one android how to resize video width and height in surface view for media player. It cannot solve my two surface view into one display problem.
Thanks