how to loop play a FLV file in FMS

Ask a Question related to Macromedia Flash Flashcom, Design and Development.

  1. #1

    Default how to loop play a FLV file in FMS

    hello,everyone,i wanna fms play a recorded flv file again and again,but i don't
    know how to do it.
    i try directly use "Stream.play",failed.
    then i try PLAY again after i got the "NetStream.Play.Stop" status info code
    when the 1st time playing over.then its really can loop play now,however,the
    Stream object didn't clear up,since one new PLAY function called,new Stream
    created,and the old Stream object kept.over and over,they took lots of memory.
    i just wanna FMS can loop play a single FLV file....
    can anyone help me? thx very much.

    minzojian Guest

  2. Similar Questions and Discussions

    1. fms ns.play(file, -2) Vs ns.play(stream, -2)
      Hi, I have a very strange problem. I have created an application on fms. on the streams/_definst_/instance directory there is a sample flv...
    2. Flash Player 8 plugin lacks loop and play options
      Up to flash player 8, there were play and loop menu items on the right click of a player plugin. In 8, they are gone. So, short of adblocking...
    3. How do I play an effect loop
      Has anyone got an elegent way to repeat an effect while the mouse is over something, like a fade in and out.
    4. Can a film loop play once, then loop on the last frame(s)?
      I need a film loop to play once, then loop playback on the last frame so I can keep the LOOP of the film loop set. This will allow the tell commands...
    5. Using Film Loop For Mouse Over - Why does it play only once?
      If you change the member rather than just hiding the sprite the film loop will restart each time. Something like. property spritenum on...
  3. #2

    Default Re: how to loop play a FLV file in FMS

    It would be helpful if you post your code. There's no reason you shouldn't be able to replay a stream from it's onStatus event handler, so it's probably a syntax issue.
    JayCharles Guest

  4. #3

    Default Re: how to loop play a FLV file in FMS

    var _nc:NetConnection = new NetConnection();
    _nc.connect("rtmp://localhost/test/test/");
    _nc.onStatus = function(_info) {
    trace("Level: "+_info.level+" Code: "+_info.code)
    if (_info.code == "NetConnection.Connect.Success")
    trace("connected to: "+this.uri);
    };

    var _ns:NetStream = new NetStream(_nc);
    _ns.connect(_nc);
    _ns.setBufferTime(5);
    video.attachVideo(_ns);
    _ns.play("test"); // no test.flv
    _ns.onPlayStatus = function(_info) {
    for(var prop in _info) {
    trace(prop+' '+_info[prop]);
    }
    if(_info.code =="NetStream.Play.Complete")
    _ns.play("test"); // no test.flv
    }



    Be CooL

    oalekdesign Guest

  5. #4

    Default Re: how to loop play a FLV file in FMS

    thx.
    what i mean is FMS play a FLV file and brocast as a defined stream name.check
    what am i do.
    application.onAppStart = function() {
    this.videofile = "test1";//one FLV file named test1.flv
    this.videoname="foo"
    this.newstream = Stream.get(this.videoname);
    if (this.newstream) {
    application.newstream.play(application.videofile, 0, -1);}
    }
    AS these codes,one flv file named test1.flv will be play and brocast as a
    stream named foo when the application start.however,this one can only play once.
    if i add a onStatus handler to call the play functionn again when the first
    time playing over.like this...

    application.newstream.onStatus = function(info) {
    trace(info.code);
    (info.code == "NetStream.Play.StreamNotFound") {//do nothing...
    }
    else if (info.code == "NetStream.Play.Stop") {//try to stop play the last
    stream...in order to clear the steam objct,but not work...
    if (application.newstream.play(false)) { application.newstream = null;
    }
    }
    else if (info.code == "NetStream.Unpublish.Success") {
    //when the last one unpublish success,publish a new one again.
    application.newstream = Stream.get(application.videoname);
    if (application.newstream)
    { application.newstream.play(application.videofile, 0, -1);
    }
    }
    };
    that's all.scripts r only for server side,don't care about the client side.
    i can loop play that flv file with these script,however,the stream object
    can't be clear up automaticly.u can check this situation in the fm2_console
    application.


    minzojian Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139