# netStream

**URL:** https://forum.kirupa.com/t/netstream/56847
**Category:** flash
**Created:** [July 8, 2004, 2:53am UTC](https://forum.kirupa.com/t/netstream/56847 "2004-07-08T02:53:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![chapster](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@chapster](https://forum.kirupa.com/u/chapster)
#### Post date: [July 8, 2004, 2:53am UTC](https://forum.kirupa.com/t/netstream/56847/1 "2004-07-08T02:53:12Z")

</div>

Is there a way when you load an flv and use the netConection and then netStream to find out the end frame of the flv when it has loaded in?  
Basically the last frame of the video.

The reason for this is if the video is finished I want it to go back to the first frame.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 8, 2004, 5:23am UTC](https://forum.kirupa.com/t/netstream/56847/2 "2004-07-08T05:23:54Z")

</div>

There is no property .\_totalframes or method like onComplete for video, but may be you can calculate this with little Math.

currentFrame = my\_ns.currentFps \* my\_ns.time  
lastFrame = my\_ns.currentFps \* videoLength

also you can check the same with (time \>= videoLength)

note that video doen’t have Length property like sound.duration, but this can be get it from any vedio player or Editing software.

Hope this will help you.  
Regards  
Ajo.k.jose

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 8, 2004, 5:28am UTC](https://forum.kirupa.com/t/netstream/56847/3 "2004-07-08T05:28:03Z")

</div>

currentFrame = my\_ns.currentFps \* my\_ns.time  
lastFrame = currentFps \* videoLength

also you can check the same with (time \>= videoLength)

WHERE ARE YOU GETTING THESE VARIABLES FROM  
videoLength  
currentFps  
???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 8, 2004, 5:36am UTC](https://forum.kirupa.com/t/netstream/56847/4 "2004-07-08T05:36:56Z")

</div>

.currentFps and .time are not variables proptities of netStream class

.currentFps - The number of frames per second being displayed.  
.time - Read-only; the position of the playhead, in seconds.

for more info please see NetStream class or Communicationserver documentation

videoLength is a variable, that store total time of vedio in seconds.

any furthere doubts please feel free to ask  
Ajo K Jose

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 8, 2004, 9:41pm UTC](https://forum.kirupa.com/t/netstream/56847/5 "2004-07-08T21:41:18Z")

</div>

var nConnection:NetConnection = new NetConnection ();  
nConnection.connect(null);  
var nStream:NetStream = new NetStream (nConnection);  
vVideo.attachVideo (nStream);  
nStream.play(“name\_of\_ur\_flv.flv”);  
nStream.onStatus = function (vInfo:Object):Void {

```
if (vInfo.code == "NetStream.Play.Stop") {
//if u want to play the video again u can use:
       this.seek(0);

```

}  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 8, 2004, 9:44pm UTC](https://forum.kirupa.com/t/netstream/56847/6 "2004-07-08T21:44:43Z")

</div>

Ah that works great  
[AS]nStream.onStatus = function (vInfo:Object):Void {  
if (vInfo.code == “NetStream.Play.Stop”) {  
}  
}  
[/AS]

Thanks so much

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 8, 2004, 9:59pm UTC](https://forum.kirupa.com/t/netstream/56847/7 "2004-07-08T21:59:48Z")

</div>

hehehe…great! 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 9, 2004, 3:24am UTC](https://forum.kirupa.com/t/netstream/56847/8 "2004-07-09T03:24:19Z")

</div>

offline it works fine !! But g-shock, when stream is down or stoped coz of low bandwidth .code return “NetStream.Play.Stop” . isn’t it? and that doesn’t mean that video completely Over. Please clear my Doubt.
