Android Open Source - VideoPlayer Videos Manager






From Project

Back to project page VideoPlayer.

License

The source code is released under:

MIT License

If you think the Android project VideoPlayer 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 net.ralphpina.famigo.videoplayer.app;
/*from  ww  w .  ja  v a2 s.  c  om*/
import java.util.ArrayList;
import java.util.List;

/**
 * Created by ralphpina on 4/19/14.
 */
public class VideosManager {

    // list of videos to populat ListView of play
    private List<Video> mVideos = new ArrayList<Video>();
    private int mCurrentVideo = 0;

    private static VideosManager mInstance;

    private VideosManager() {
    }

    public static VideosManager getInstance() {
        if (mInstance == null) {
            mInstance =  new VideosManager();
            return mInstance;
        }

        return mInstance;
    }

    public List<Video> getVideos() {
        return mVideos;
    }

    public void setVideos(List<Video> videos) {
        this.mVideos = videos;
    }

    public void addVideo(Video video) {
        mVideos.add(video);
    }

    public Video getCurrentVideo() {
        return mVideos.get(mCurrentVideo);
    }

    public void setCurrentIndex(int currentVideo) {
        this.mCurrentVideo = currentVideo;
    }

    public Video getNextVideo() {
        if (++mCurrentVideo >= mVideos.size()) {
            mCurrentVideo = 0;
        }
        return mVideos.get(mCurrentVideo);
    }

    public Video getPreviousVideo() {
        if (--mCurrentVideo < 0) {
            mCurrentVideo = (mVideos.size() - 1);
        }
        return mVideos.get(mCurrentVideo);
    }
}




Java Source Code List

net.ralphpina.famigo.videoplayer.app.MainActivity.java
net.ralphpina.famigo.videoplayer.app.VideoListAdapter.java
net.ralphpina.famigo.videoplayer.app.VideoListFragmentFragment.java
net.ralphpina.famigo.videoplayer.app.VideoPlayingActivity.java
net.ralphpina.famigo.videoplayer.app.VideoService.java
net.ralphpina.famigo.videoplayer.app.Video.java
net.ralphpina.famigo.videoplayer.app.VideosManager.java
net.ralphpina.famigo.videoplayer.app.util.SystemUiHiderBase.java
net.ralphpina.famigo.videoplayer.app.util.SystemUiHiderHoneycomb.java
net.ralphpina.famigo.videoplayer.app.util.SystemUiHider.java