Android Open Source - android-video-sync Video Forward Activity






From Project

Back to project page android-video-sync.

License

The source code is released under:

GNU General Public License

If you think the Android project android-video-sync listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.ramuta.videosynctest;
//  w  ww.j av a2 s .c o  m
import android.app.ActionBar;
import android.app.Activity;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.VideoView;

import java.util.Calendar;


public class VideoForwardActivity extends Activity {
    private ActionBar actionBar;

    private int currentVideo;

    private VideoView videoView;
    private Button forward;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_forward);

        actionBar = getActionBar();
        actionBar.hide();

        videoView = (VideoView) findViewById(R.id.videoForwardView);
        String path = "android.resource://" + getPackageName() + "/" + R.raw.tl;
        videoView.setVideoURI(Uri.parse(path));
        videoView.start();

        videoView.setOnPreparedListener(new OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mp) {
                mp.setLooping(true);
            }
        });

        forward = (Button) findViewById(R.id.video_forward_button);
        forward.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Logga.i("forward button");
                videoView.seekTo(5000);
                videoView.start();
            }
        });
    }

    @Override
    public void onPause() {
        super.onPause();
        videoView.stopPlayback();
    }

    @Override
    protected void onStop() {
        super.onStop();
        videoView.stopPlayback();
    }
}




Java Source Code List

me.ramuta.videosynctest.ApplicationTest.java
me.ramuta.videosynctest.Logga.java
me.ramuta.videosynctest.MainActivity.java
me.ramuta.videosynctest.SntpClient.java
me.ramuta.videosynctest.VideoActivity.java
me.ramuta.videosynctest.VideoForwardActivity.java