views:

34

answers:

1

I am creating a program which requires me to change a setting in the program when the video reaches specific points (at 1/3 of the video's completion, 2/3's and on completion). Android has a built in callback method for completion so performing an action at that point in time is not difficult. However, I don't know how to go about checking when the video has reached 1/3 and 2/3's of completion.

A: 

Using a MediaPlayer control you will get the total duration of your media file in milliseconds:

 myMediaPlayer.getDuration()

you will implement a thread that check every second for the current position at 1/3, 2/3 and 3/3 of the videos completion, with

myMediaPlayer.getCurrentPosition(); //***current Position in milliseconds.
Jorgesys