# Video duration problem

**URL:** <https://forum.kirupa.com/t/video-duration-problem/258487>\
**Category:** Uncategorized\
**Created:** [April 24, 2008, 2:04pm UTC](https://forum.kirupa.com/t/video-duration-problem/258487 "2008-04-24T14:04:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navarone](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Navarone](https://forum.kirupa.com/u/Navarone)\
**Post date:** [April 24, 2008, 2:04pm UTC](https://forum.kirupa.com/t/video-duration-problem/258487/1 "2008-04-24T14:04:28Z")

</div>

I have an flv that I am streaming into my flash project using the netStream object. It has a obj.duration of 15.03 seconds using the code below rounds off the value to 15 seconds. Oddly enough, this rounding off cuts out like the very last frame of the video and consequently produces a unfinished appearance.

My question is, is there any other way to code this so that the video plays its entire length?

```auto

_root.stop();
var netConn = new NetConnection();
netConn.connect(null);
var ns = new NetStream(netConn);
my_video.attachVideo(ns);
ns.setBufferTime(5);
ns.play("videos/indenial_25p_VP6_768K360_Stream.flv");
//ns.play("videos/indenial_25p_VP6_768K_Stream_001.flv");
//
getTotalTime = function () {
 ns.onMetaData = function(obj) {
  _global.videoDuration = obj.duration;
  trace(obj.duration);
 };
};
// monitors the current position of the playhead against the total playing time
onEnterFrame = function () {
 getTotalTime();
 totalPlayingTime = Math.round(_global.videoDuration);
 currentPlayingTime = Math.round(ns.time);
 //totalPlayingTime = _global.videoDuration;
 //currentPlayingTime = ns.time;
 //trace(totalPlayingTime)
 //trace(currentPlayingTime)
 if (totalPlayingTime == currentPlayingTime) {  
  //ns.seek(0);
  // ns.pause();
   ns.close();
  // ns.play()
   gotoAndPlay("end_denial");
 }
};

```
