Example: flex_rtmp_receive_stream

This is an example of a manually enhanced script that pauses the streaming download and seeks a new location to continue the play.

flex_rtmp_send("send_step3",
    "ConnectionID=6",
    "Snapshot=tRTMP1944.inf",
    MESSAGE,
    "DataType=command message amf0",
    "ChunkStreamID=8",
    "MessageStreamID=1",
    "Argument="
        "<arguments>"
            "<string>play</string>"
            "<number>0</number>"
            "<null></null>"
            "<string>mp4:sample2_1000kbps.f4v</string>"
            "<number>0</number>"
            "<number>-1000</number>"
        "</arguments>",
    MESSAGE,
    "DataType=user control message",
    "EventType=set buffer length",
    "MessageStreamID=1",
    "BufferLength=100",
    LAST);
// Read the stream until at least 15 seconds of media
// have been downloaded.

flex_rtmp_receive_stream("recv_stream_step0", 
    "ConnectionID=6", 
    "Snapshot=tRTMP1945.inf", 
    "ContinueToNextStepAfter=15000", 
    LAST);
// Seek the 35 second point in the media.

flex_rtmp_send(
    "send_step_custom0",
    "ConnectionID=6",
    MESSAGE,
    "DataType=command message amf0",
    "ChunkStreamID=8",
    "MessageStreamID=1",
    "Argument="
        "<arguments>"
            "<string>seek</string>"
            "<number>0</number>"
            "<null></null>"
            "<number>35000</number>"
        "</arguments>",
    LAST);
// Continue reading the stream after the seek.

flex_rtmp_receive_stream("recv_stream_step1", 
    "ConnectionID=6", 
    LAST);
// Close the stream.

flex_rtmp_send(
    "send_step5",
    "ConnectionID=6",
    "Snapshot=tRTMP1948.inf",
    MESSAGE,
    "DataType=command message amf0",
    "ChunkStreamID=8",
    "MessageStreamID=1",
    "Argument="
        "<arguments>"
            "<string>closeStream</string>"
            "<number>0</number>"
            "<null></null>"
        "</arguments>",
    LAST);