Code example for VideoView

Methods: isPlaying

0
 
    Handler mHandler = new Handler();
 
    Runnable mPlayingChecker = new Runnable() {
        public void run() { 
            if (mVideoView.isPlaying()) { 
                mProgressView.setVisibility(View.GONE); 
            } else { 
                mHandler.postDelayed(mPlayingChecker, 250); 
            } 
        } 
    }; 
 
    public static String formatDuration(final Context context, int durationMs) {
        int duration = durationMs / 1000;
        int h = duration / 3600;
        int m = (duration - h * 3600) / 60;
        int s = duration - (h * 3600 + m * 60);
        String durationValue;
        if (h == 0) {
            durationValue = String.format(context.getString(Res.string.details_ms), m, s);