Dear Friends,

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

Dear Friends,

Postby rgv_82 » Tue Sep 18, 2007 6:36 am

Here i made a video to play on the screen,I need to keep a slider bar on the video. Do you have any concepts to calculate the video timing and with the timing how to keep the slider thread.

Posts: 15
Joined: Wed Sep 12, 2007 6:05 am

Postby DevelopmentTeam » Tue Sep 18, 2007 7:31 am

This code will draw the progress bar
totalTime - video duration
elapseTime - current duration of the video player
barWidth - progressbar width
barHeight - progressbar height

Code: Select all
int percentageCompleted = ((totalTime - elapseTime) * 100)/totalTime;

g.setColor(0, 255, 0);
g.fillRect(10, 10, (percentageCompleted * barWidth) /100, barHeight);
g.setColor(0, 0, 0);
g.drawRect(10, 10, barWidth, barHeight);

User avatar
Site Admin
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Return to J2ME Games

Who is online

Users browsing this forum: No registered users and 1 guest