I'm writing an app which displays cutscenes. Currently, the way it works is that (because surface views / video views can't typically be placed on top of each other) I remove the VideoView from the layout the instant the app runs. Then, when I want to display a cutscene, I add the VideoView back into the layout and, once the animation is ready to play, remove the SurfaceView (if done right, there is no "black flash" prior to the video starting. This works successfully.) However, when the video ends, I can do one of two things:
- Remove VideoView, followed by adding the SurfaceView back to the layout. This causes a black flash on the screen while the SurfaceView is being added back.
- Add the SurfaceView back, followed by removing the VideoView once the SurfaceView is prepared to render.
Likewise, I chose the second option to eliminate the black flash on screen. However, this causes a different issue. For some reason, After a VideoView has begun a playback, if a SurfaceView is added on top of that whose canvas is then drawn on, there are dark vertical stripes which run down the screen from top to bottom.
Once the VideoView is removed, the stripes disappear. However, there is, understandably, about a quarter of a second or so of lag time between the SurfaceView being added back and the VideoView being removed from the layout. During this period, the stripes are clearly visible.
Is there any way around this?
Note that I am using Vitamio to render AVI videos.