我有以下代碼將視頻作爲原始資源,啓動視頻並循環播放,但我需要視頻在截至剪輯結束時以無縫方式循環播放,並啓動剪輯再次之間的過渡導致閃爍一瞬間,這是我真的不能爲我的應用程序。無縫視頻循環與VideoView
public class Example extends Activity {
VideoView vv;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
vv = (VideoView)findViewById(R.id.VideoView01);
//Video Loop
vv.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
vv.start(); //need to make transition seamless.
}
});
Uri uri = Uri.parse("android.resource://com.example/"
+ R.raw.video);
vv.setVideoURI(uri);
vv.requestFocus();
vv.start();
}
}
該剪輯只有22秒長,但被創建爲無縫,因此可以毫不拖延地工作。
仍然拒絕每一個循環,它不像以前的方法那樣流暢 – Pencilcheck 2013-12-29 21:04:15