# Video coding question

**URL:** https://forum.kirupa.com/t/video-coding-question/222851
**Category:** Uncategorized
**Created:** [April 17, 2007, 2:57pm UTC](https://forum.kirupa.com/t/video-coding-question/222851 "2007-04-17T14:57:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![theWolfe](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thewolfe/32/3523_2.png) [@theWolfe](https://forum.kirupa.com/u/theWolfe)
#### Post date: [April 17, 2007, 2:57pm UTC](https://forum.kirupa.com/t/video-coding-question/222851/1 "2007-04-17T14:57:19Z")

</div>

Hey guys,  
I’ve been looking at this forum for a while, and this is my first post.

I am calling an FLV, progressively downloading, and I want to display the time of the video. I can get the time to display in milliseconds, but I can convert it to min:seconds. I think I have the code very close, but any help would be fantastic!

```auto
var listenerObject:Object = new Object();
mainVideo.playheadUpdateInterval = 1000;

listenerObject.playheadUpdate = function(eventObject:Object):Void {
now.text = eventObject.playheadTime;
};
mainVideo.addEventListener("playheadUpdate", listenerObject);

//Converting time to seconds.....
var minutes:Number = 0;
var seconds:Number = 0;
this.onEnterFrame = function() {
  minutes = Math.floor(eventObject.playheadTime / 1000 / 60);
  seconds = Math.floor(eventObject.playheadTime / 1000) % 60;
  now.text = minutes + ":" + seconds;
};

mainVideo.contentPath = "testVid.flv";

//controls...
mainVideo.playPauseButton = mcPlayPause;
mainVideo.volumeBar = mcVolume;
mainVideo.seekBar = mcSeek;

```

Thanks!
