Code example for MediaController.MediaPlayerControl

Methods: getDuration

0
    } 
 
    private OnSeekBarChangeListener seekListener = new OnSeekBarChangeListener() {
        long duration; 
        public void onStartTrackingTouch(SeekBar bar) { 
            duration = videoControl.getDuration(); 
        } 
        public void onProgressChanged(SeekBar bar, int progress, boolean fromtouch) { 
        	 
            if (fromtouch) { 
            	Log.d(TAG, "onProgressChanged started: progress=" + paths.get(playIndex)+ progress + "; tounch=" + fromtouch) ; 
                dragging = true; 
                duration = videoControl.getDuration(); 
                long newposition = (duration * progress) / 1000L; 
                videoControl.seekTo( (int) newposition); 
                if (currentTime != null) 
                    currentTime.setText(stringForTime( (int) newposition)); 
                 
                dragging = false; 
                Log.d(TAG, "onProgressChanged ended") ; 
            }