Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- }
- }
- videoView.setOnPreparedListener(new OnPreparedListener() {
- @Override
- public void onPrepared(MediaPlayer mp) {
- mp.setLooping(true);
- }
- });
- MediaPlayer.setLooping(true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement