// playback public Playback(SurfaceView surfaceview, int playerMode) { mmediaplayer = new MediaPlayer(); msurfaceholder = surfaceview.getHolder(); msurfaceholder.addCallback(this); // msurfaceholder.setFixedSize(surfaceview.getWidth(), // surfaceview.getHeight()); msurfaceholder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); mmediaplayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mmediaplayer.setDisplay(msurfaceholder); mmediaplayer.setOnErrorListener(errListener); mmediaplayer.setOnPreparedListener(preListener); mmediaplayer.setOnCompletionListener(completeListener); mmediaplayer.setOnSeekCompleteListener(seekListener); mPlayStatus = VideoConst.PLAY_STATUS_UNKNOW; if (playerMode == VideoConst.PLAYER_MODE_MMP) { videopl = PlayList.getPlayList(); mcurPath = videopl.getCurrentPath(Const.FILTER_VIDEO); } mplayerMode = playerMode; pb = this; }
private int getSavedProgress() { if (previewMode == true) { return 0; } else { vidman = VideoManager.getInstance(); String path = videopl.getCurrentPath(Const.FILTER_VIDEO); return vidman.getFileInfo().getSavedProgress(path); } }
private void saveProgress(int progress) { if (previewMode == true) { return; } else { vidman = VideoManager.getInstance(); String path = videopl.getCurrentPath(Const.FILTER_VIDEO); String info = "progress = " + Integer.toString(progress); MmpTool.LOG_DBG(info); if (progress > 0 && progress < getDuration()) { vidman.getFileInfo().saveProgress(path, progress); } else { vidman.getFileInfo().saveProgress(path, 0); } } }