Hi Guys, 

I was trying to play two videos gapless using the setNextMediaPlayer of 
API16. 
I see the video&audio of the first, but then only the audio of the second 
one. 

I assume it is coz the first MediaPlayer still has access to the 
SurfaceHolder/SurfaceView.
Why doesn't the second MediaPlayer get access to this display after the 
first MediaPlayer is completed? 
How do i specify this release of resources?. 
If i do it explicitly on the OnCompletionListener of the first video, then 
I am going to introduce a delay of release of resource, which is the main 
reason I am trying to use an API like setNextMediaPlayer

thanks

Shankar

code:

mp0 = new MediaPlayer();
mp1 = new MediaPlayer();
try {
mp0.setDataSource("/mnt/sdcard/39.mp4");
mp0.setDisplay(holder);
mp0.prepare();
} catch (Exception e) {
}
mp0.setOnPreparedListener(this);
mp0.setOnCompletionListener(this);
mp0.start();
mp0.setAudioStreamType(AudioManager.STREAM_MUSIC);
try{
mp1.setDataSource("/mnt/sdcard/40.mp4");
mp1.prepare();
mp1.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
Log.d("VideoLoop", "Adding as next player");
mp0.setNextMediaPlayer(mp1);
}
});



-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to