# Flv stops randomly

**URL:** https://forum.kirupa.com/t/flv-stops-randomly/268824
**Category:** Uncategorized
**Created:** [August 19, 2008, 12:36pm UTC](https://forum.kirupa.com/t/flv-stops-randomly/268824 "2008-08-19T12:36:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)
#### Post date: [August 19, 2008, 12:36pm UTC](https://forum.kirupa.com/t/flv-stops-randomly/268824/1 "2008-08-19T12:36:03Z")

</div>

Hello fellow coders!

I’m trying to load an flv but it randomly stops… sometimes it plays until the end fine, and sometimes it stops after a few seconds.

Any tip on what could be doing that?

TIA 😉

Code inside a function:

```auto

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
target.attachNetStream(ns);

var listener:Object = new Object();
listener.onMetaData = function(infoObject:Object){
     if(infoObject.duration != null){
          //trace("our video is "+infoObject.duration+" seconds long");
     }

     if(infoObject.height != null && infoObject.width != null){
          //trace("our video is "+infoObject.height+"x"+infoObject.width+" pixels");
		target.width = infoObject.width;
		target.height = infoObject.height;
     }
}

ns.bufferTime = 2;
ns.client = listener;

ns.play(url);

```
