# Video in Flash

**URL:** https://forum.kirupa.com/t/video-in-flash/150663
**Category:** Uncategorized
**Created:** [June 9, 2005, 12:13pm UTC](https://forum.kirupa.com/t/video-in-flash/150663 "2005-06-09T12:13:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flash1810](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@flash1810](https://forum.kirupa.com/u/flash1810)
#### Post date: [June 9, 2005, 12:13pm UTC](https://forum.kirupa.com/t/video-in-flash/150663/1 "2005-06-09T12:13:27Z")

</div>

Hi there.

I am working on a small flash project and i have to include some video in it.

I have managed to embed the video and play it.

The only problem is that the video is not playing smoothly, it freezes and then it speeds up!

Thats the code i am using:

var netConn = new NetConnection();  
netConn.connect(null);  
var netStream = new NetStream(netConn);  
netStream.onStatus = function(infoObject) {  
switch (infoObject.code) {  
case “NetStream.Play.Stop” :  
if (this.time\>=this.duration-0.2) {  
trace(“loop!”);  
}  
netStream.seek(0);  
[//vc.controller.oPlaypause.pause](https://vc.controller.oPlaypause.pause)();  
break;  
case “NetStream.Play.Start” :  
//trace(“Netstream start”);  
break;  
case “NetStream.Buffer.Empty” :  
[//vc.controller.oPlaypause.pause](https://vc.controller.oPlaypause.pause)();  
break;  
case “NetStream.Buffer.Full” :  
[//vc.controller.oPlaypause.play](https://vc.controller.oPlaypause.play)();  
picture.\_x = 700;  
indicator.\_x = 700;  
break;  
}  
}

netStream.onMetaData = function(infoObject) {  
//trace(infoObject.duration);  
//trace (obj.height);  
this.duration = infoObject.duration;  
}  
my\_video.attachVideo(netStream);  
netStream.setBufferTime(5);  
netStream.play(“mms.flv”);  
this.createEmptyMovieClip(“flv\_mc”, this.getNextHighestDepth());  
flv\_mc.attachAudio(netStream);  
var audio\_sound = new Sound(flv\_mc);  
audio\_sound.setVolume(0);

I have tried to set different timings for the buffer but nothing changes.

If anyone knows it 'll be great.  
Thanks.
