Looping video with a netstream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stwange
    Recognized Expert New Member
    • Aug 2007
    • 126

    Looping video with a netstream

    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.
  • Stwange
    Recognized Expert New Member
    • Aug 2007
    • 126

    #2
    Originally posted by Stwange
    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:
    Code:
    //thanks to http://www.tomontheweb2.ca/MakingFireworks/Part3.cfm for the majority of this code. 
    stream.addEventListener(NetStatusEvent.NET_STATUS, loop);
    function loop(event:NetStatusEvent):void{
    	switch (event.info.code){
    	case"NetStream.Play.Stop":
    stream.seek(0);
    }};

    Comment

    Working...