# Video Player showing incorrect time

**URL:** https://forum.kirupa.com/t/video-player-showing-incorrect-time/310598
**Category:** flash
**Created:** [June 14, 2010, 5:58pm UTC](https://forum.kirupa.com/t/video-player-showing-incorrect-time/310598 "2010-06-14T17:58:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tampham](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tampham](https://forum.kirupa.com/u/tampham)
#### Post date: [June 14, 2010, 5:58pm UTC](https://forum.kirupa.com/t/video-player-showing-incorrect-time/310598/1 "2010-06-14T17:58:03Z")

</div>

Hi,

My video player keeps on showing the incorrect video time of the movie (see image below to what I’m referring to). The seconds are correct, but it keeps rounding the minutes to 1 instead of being 0 minutes. Below is the script. Any help/thoughts is greatly appreciated. Thanks!

* * *

onEnterFrame = function () {  
// Get video stream bytes loaded  
percentage = Math.round(ns.bytesLoaded/ns.bytesTotal);  
controls\_mc.progress\_mc.buffer\_mc.\_xscale = percentage;

```
// Get video time
ns_seconds = ns.time;
minutes = Math.floor(ns_seconds/60);
seconds = Math.floor(ns_seconds%60);

if (seconds &lt; 10) {
    seconds = "0"+seconds;

}

controls_mc.sound_time_mc.time_txt.text = minutes+":"+seconds+" / "+durationDisplay;

// Progress bar position
if (ns.time&gt;=duration && duration != undefined) {
    controls_mc.progress_mc.played_mc._xscale = 100;
    if (videoEnd == false) {
        controls_mc.bttnPlay.icon_mc.gotoAndStop(2);
        videoEnd = true;
    }  
} else {
    controls_mc.progress_mc.played_mc._xscale = Math.floor(ns.time/duration);
    videoEnd = false;
}

```

## }; stop();

![](http://dnabeta.com/screencap.png)
