i've got a simple videoview. I've made a stop button with:
myVideoView.stopPlayback();
but when it stops it keeps the last scene of the video in the videoview.
How can i reset the videoview after the video has been stopped?
Related
I am using VideoView to play a video and have some difficulties to stop it and keep the last frame after video finishes playing. Currently I am stuck with black last frame after video ends.
Is there a way to accomplish that? Thank you.
To get the last frame of a video you can skip to its end by using:
video.seekTo(video.getDuration());
When I play a video file using a VideoView on Android, I can hear the sound fine, but the video does not show.
So, when I use :
myVideoView.setZOrderOnTop(true);
then the video shows fine, however, then my TextView is behind the VideoView and I need it to be in front.
Therefore, I either need a solution so that the video is played without using setZOrderOnTop, or I need a way to get the text in front of the video while using setZOrderOnTop.
videoView.setBackgroundColor(Color.TRANSPARENT);
I have a videoView which is playing both audio and video streams ,but when I am playing audio I dont want screen to be blank instead I want to show an image or thumbnail ,how can I achieve this task ?
Hello
i have a surfaceview and a videview in a framlayout. if i start the video in oncreate, i see all perfectly, the video playing while the camera plays in background.
but if i start the video after oncreate, for example in onpreviewframe, i can only hear the video, but it's like behind the camera, and all i see is the camera view.
any help?
You Need to Merge both layouts... see the Example.
I have an app that displays a video using VideoView. The layout consists of a Clock and a VideoView laid out in a simple vertical LinearLayout.
Here's my code snippet that I use:
VideoView mVideoView = new VideoView(this);
mVideoView.setVideoPath(myVideoURL);
mVideoView.requestFocus();
mVideoView.start();
Since the buffering of the video takes about 8-10 seconds, the layout comes up with the Clock, but the VideoView stays blank. What I want to achieve is this:
-- Display an ImageView for the 10s while the video is buffering
-- Detect when the video is ready to be played (onPrepared?)
-- Show the Clock and VideoView and start the Video
Anyone have pointers on how to go about this?
Thanks
Chris
MediaPlayer will let you register an OnPreparedListener callback which you can use to determine when the video is ready to be started. So you would show your ImageView instead of your VideoView first, then when your callback gets called, change to the VideoView and start playing.