Skip to main content
Participant
June 23, 2006
Question

Stream class problem

  • June 23, 2006
  • 3 replies
  • 343 views
I am new to Flash, Flash Media Server and so on, and I just don't understand some things.
I need to create an application that will be broadcasting some videos as if they are from web cams.
I need some way to syncronize all opened streams. What I am trying:
fms/application/video_broadcast/main.asc:
===
load( "components.asc" );
application.onAppStart = function() {
application.streampos = 0;
setInterval(function() { application.streampos = (application.streampos + 10) % 10000; }, 10);
}

application.onConnect = function( newClient, username, password ) {
trace( application.name + ":onConnect");
application.acceptConnection(newClient);
var gstream = Stream.get("lost");
gstream.onStatus = function(info) {
trace(application.name + ".gstream.onStatus: " + info.code + "; level = " + info.level);
}
gstream.play("lost",application.streampos,-1,newClient);
}
===
But FMS says: Sending error message: /opt/macromedia/fms/applications/video_broadcast/main.asc: line 11: TypeError: gstream has no properties -

I have /opt/macromedia/fms/applications/video_broadcast/streams/_definst_/lost.flv in place, I can see it without main.asc (application: "rtmp://192.168.2.3/video_broadcast" and stream name: "lost") in flash player.

Give me a clue please what to look for.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    June 24, 2006
    I've never used it, but I'm pretty sure the date class is available in SSAS just as it is in CSAS
    June 23, 2006
    var gstream = Stream.get("foo");
    gstream.play("lost",application.streampos,-1,newClient);

    Don't make a stream out of an flv. Create a new stream, and play the flv over it. In this case, the client subscribes to foo.
    Participant
    June 23, 2006
    Ok, I got it. I have a second dumb question: how can FMS application know the current time (on the server)?