How to Buffering one video in background while playing one? - android

I have one activity where i got two video URL.So, once the activity started i have set one progress dialog which spins till the first video is prepared.So once first video started , i want to buffer the second video in background(First Video is still playing in foreground).Right now i am showing one progress dialog till the video prepared.So once the first video is finished ,i want to immediately start the second one.So user feels like that its an one video.
Any help will be appreciated....
Thanks in Advance....

Related

YouTube Player next prev buttons aren't visible for the first video

I'm trying to implement built-in YouTube player in my app (API: https://developers.google.com/youtube/android/player/)
I load more than one video id for playback (list of video IDs)
youTubePlayer.loadVideos(idList)
But when player starts prev and next buttons aren't available until the first video finishes and switches to the next one, only then buttons appears and I can switch between videos from my video list
Whenever you got the answer.... please lemme know
It started to work normally after some time

mediaplayer.pause() not working

I am playing audios in a gridview.I am having issue that once the audio starts it not pausing or stopping.On clicking on pause button I see the pause image changing to play but still the audio keeps playing.If i click on another item's play button then multiple audio plays.I failed to understand why mp.pause() not working?
You are creating a MediaPlayer for each item of your GridView. If you scroll, it will mess up the references to your view and you won't be able to handle your MediaPlayer. You should use only one MediaPlayer, like the one you already have declared mMediaPlayer. Try using it instead of creating one for each item.

Android VideoView Update Subtitles

I'm trying to make a video player with VideoView that supports subtitles using a TextView on top of it.
I've already parsed the subtitles but now i need an event that runs every time a frame changes or so to update the subtitles with the current playing position.
I tried making a thread but I am not able to change my TextView in that separate thread. Is there an event on VideoView/MediaPlayer that runs every frame change that I can override to call my updateSubtitle method?
Starting with Android 4.4 , you can put subtitles from within the VideoView itself:
https://www.youtube.com/watch?v=hCRGc2PcmB8#t=130
Coming to your first question, there is no event that happens each video frame. Having said that there are ways of getting current time and synchronize subtitles to the current time. Below links might be of help
A white paper on how to support subtitles in Android

How do I set spinning ProgressBar to Media?

I'm creating a soundboard application. Im new to developing but I have my whole app running perfectly exept for one last thing. I have it so I have multiple buttons and each button plays a different sound. I want to have a spinning progressbar on my button while the sound is playing, but then dissappear when the sound is done. How would I do this easily?
so i'm not sure how you're playing your sounds, whether its just one line of code that actually PLAYS the sound. In my opinion, you have two options
If your method returns something once the sound stops playing, I'd do something like
while (myapp.playSound() != -1){ //implement spin bar }
Or you can use AsyncTask -- http://developer.android.com/reference/android/os/AsyncTask.html
AsyncTask would probably be your best bet
Add a OnCompletionListener to the mediaplayer, so when you play the sound (or click the button) start the progress bar, and when the track is complete remove/stop it.

how to draw black screen during pause state in video view

Hello
our tester want to stop function in video player.
so I add stop button and call seekto(0) and pause when user press stop key.
but I has one problem. videoview is not clear play screen.
please help me.
instead of using video view try media player present in android.mediaplayer.mediaplayer so when you need to stop the player you can just call mediaplayerobject.stop() and then mediaplayerobject.release() thats all it will be easy

Categories

Resources