try this
mediaFileLength = mediaPlayer.getDuration();
realtimeLength = mediaFileLength;
mediaPlayer.start();
finalTime = mediaPlayer.getDuration();
startTime = mediaPlayer.getCurrentPosition();
updateSeekBar();
Related Contents:
- SeekBar and media player in android
- Android background music service
- Android – styling seek bar
- Play audio file from the assets directory
- Media Player called in state 0, error (-38,0)
- Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions
- Should have subtitle controller already set Mediaplayer error Android
- How to put media controller button on notification bar?
- Getting access to media player cache
- How to play multiple video files simultaneously in one layout side by side in different view in Android
- MediaPlayer stutters at start of mp3 playback
- Why MediaPlayer throws NOT present error when creating instance of it?
- Simple mediaplayer play mp3 from file path?
- Play sound on button click android
- Streaming Audio from A URL in Android using MediaPlayer?
- Why does it take so long for Android’s MediaPlayer to prepare some live streams for playback?
- How to stop other apps playing music from my current activity?
- Doze mode and foreground service
- Android – play sound on button click – Null pointer exception
- Android MediaPlayer/VideoView error (1, -2147483648)
- MediaPlayer error (1, -1004) aka MEDIA_ERROR_IO trying to stream music on Samsung S3
- Android: How to integrate a decoder to multimedia framework
- Android MediaPlayer Problems :”Error (-38 , 0) ” and “stop called in state 1”
- How to solve NullPointerException error in Android?
- Streaming Youtube Videos
- Changing step values in seekbar?
- Change app language programmatically in Android
- How to crop circular area from bitmap in Android
- Android Studio – local path doesn’t exist
- No shadow by default on Toolbar?
- How to interface with the BadgeProvider on Samsung phones to add a count to the app icon?
- In android app Toolbar.setTitle method has no effect – application name is shown as title
- Why do I get access denied to data folder when using adb?
- How do you create a transparent demo screen for an Android app?
- Android webview & localStorage
- Android: HTTP communication should use “Accept-Encoding: gzip”
- Android Studio: Gradle sync failed: Could not HEAD ‘…’. Received status code 502 from server: Bad Gateway [closed]
- VectorDrawable – is it available somehow for pre-Lollipop versions of Android? [closed]
- React Native Android Fetch failing on connection to local API
- How do I set ANDROID_SDK_HOME environment variable?
- Using adb logcat with a real phone (and not the emulator)
- HorizontalScrollView: auto-scroll to end when new Views are added?
- Stop handler.postDelayed()
- App and website saved password is not sync
- How to start an Android application from the command line? [duplicate]
- run-as Package ‘a.b.c’ is unknown – Galaxy S4 Jellybean or Android 4.3
- achartengine – can’t figure how to use dates as x axis – the file I save is empty
- how do you display map (Google) on a phonegap android application
- How to replace the activity’s fragment from the fragment itself?
- Firebase Database Permission denied with read/write permissions set to true