# Video position and length?

**URL:** https://forum.kirupa.com/t/video-position-and-length/242880
**Category:** Uncategorized
**Created:** [October 31, 2007, 10:51am UTC](https://forum.kirupa.com/t/video-position-and-length/242880 "2007-10-31T10:51:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ancide](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@Ancide](https://forum.kirupa.com/u/Ancide)
#### Post date: [October 31, 2007, 10:51am UTC](https://forum.kirupa.com/t/video-position-and-length/242880/1 "2007-10-31T10:51:56Z")

</div>

Hi everyone!

I have a question about getting the position and length of a video.  
This is how I would do it with a sound file if I want to have a progress bar:

```php

var estimatedLength:int = Math.ceil(snd.length / (snd.bytesLoaded / snd.bytesTotal));
var playbackPercent:uint = Math.round(100 * (channel.position / estimatedLength));
progressBar.width = playbackPercent;

```

But how does it work with video?

I know that netStream.bytesLoaded and netStream.bytesTotal work, but netStream.position and netStream.length doesn’t.

Thanks
