Thursday, November 24, 2011

[android-developers] Re: Calculate percentage of a video file

Oh for crying out loud... Look at your code!

You have "current" as the total video duration, and "total" as the
current position.

Swap the values of the variables.

Then get back to us with an Android specific issue...


On Nov 24, 6:15 pm, Naveen <kumarnaveen.si...@gmail.com> wrote:
> Hello Sir,
>
> I am playing a video file , i want to calculate percentage of video
> file . using this code
>
> int current=video.getDuration();
> int total= video.getCurrentPosition();
> int per = (current/total)*100;
>
> This way is wrong behave please confirm me this is right or wrong.
>
> which is easiest way solve my issue.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment