How to show thumbnail while playing audio in VideoView? - android

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 ?

Related

Stop the video on last frame

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());

No video, only sound with VideoView

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);

How to change Android VideoView content color when data isn't ready

I'm working on a video player app, and I'm using a VideoView to show the videos. The videos are obtained from a url like so
videoView.setVideoURI(videoUri);
videoView.start();
When there's no internet connection, the videoView just looks all black on the screen. I would like to change this default black screen to another image.
Any tips on how to accomplish this would be much appreciated.
Thanks!
Now when your video is playing hide the placeholder and when your network is off hide the videoview

SurfaceView is not showing play/pause/backward/forward icon with media player while playing video

I am using media player and surface view to play video, but while playing video there is no icon to play or pause as we get with video view play or pause icon while playing video, is there any method which should i call to get these icon, or i have to place manually for surface view. Please guide me
You need to use the Media controller along with your media player
by calling the setMedaiController method

Android Show image while video is buffering?

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.

Categories

Resources