activerecordlive-streamingflash-media-serverplaying

Flash Media Server doesn't play recorded video


It is recording perfectly to the server with this method:

liveStream.publish("test", "record");

But when I want to play like so:

at NetStream.Record.Stop handler

var vd:Video = new Video(cameraWidth, cameraHeight);
vd.attachNetStream(liveStream);
liveStream.play("test");
addChild(vd);

Sometimes it is playing well, but usually it doesn't play and nothing happens.


Solution

  • i solved my problem.

    before i was adding metadata to my recorded video in "NetStream.Publish.Start" handler like so:

        case "NetStream.Publish.Start":
    var metaData:Object = new Object(); 
    metaData.title = "test"; 
    metaData.width = cameraWidth; 
    metaData.height = cameraHeight; 
    liveStream.send("@setDataFrame" , "onMetaData", metaData);
        break;
    

    And changed "NetStream.Record.Start" instead "NetStream.Publish.Start". Now it works fine for me.

    I think if you want to playback any recorded stream, when your live stream triggers "Netstream.Record.Start", it is avaible to adding metadata.