469,306 Members | 1,879 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Looping video with a netstream

126 Expert 100+
I'm currently loading flv videos in swf using the NetStream, NetConnect(null) and Video objects, but how do I set the video to autorepeat? I can't find a method for it in any of the APIs for the above, and I don't really want to write code to wait the length of the video before replaying.

Any suggestions will be greatly appreciated, thank-you.
Nov 20 '07 #1
1 7605
Stwange
126 Expert 100+
I'm currently loading flv videos in swf using the NetStream, NetConnect(null) and Video objects, but how do I set the video to autorepeat? I can't find a method for it in any of the APIs for the above, and I don't really want to write code to wait the length of the video before replaying.

Any suggestions will be greatly appreciated, thank-you.
If anyone else has the same problem, you can do the following, where stream is the name of the NetStream object:
Expand|Select|Wrap|Line Numbers
  1. //thanks to http://www.tomontheweb2.ca/MakingFireworks/Part3.cfm for the majority of this code. 
  2. stream.addEventListener(NetStatusEvent.NET_STATUS, loop);
  3. function loop(event:NetStatusEvent):void{
  4.     switch (event.info.code){
  5.     case"NetStream.Play.Stop":
  6. stream.seek(0);
  7. }};
Nov 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by triplejump24 | last post: by
8 posts views Thread by Oscar Arreyano | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.