Failed to load application instance publishLive/live.
Complete log error is (_defaultRoot_, _defaultVHost_) : Failed to load application instance publishLive/live.. Flash Admin Server and Flash Media Server are running on local machine. When testing I get [object NetConnection]: NetConnection.Connect.Failed. When I remove the main.asc file it works...what's going on there? I had this working at one point...my main.asc is below.
var nc;
var ns;
var nsr;
// Called when a client connects
application.onConnect = function(client) {
// accept the new client's connection
application.acceptConnection(client);
// send a message
trace(client.id + " is connected");
}
// Called when a client disconnects
application.onDisconnect = function(client) {
trace(client.id + "disconnecting at " + new Date());
}
// Called when the client publishes
application.onPublish = function(client, livestream) {
trace(livestream.name + " is publishing into application " + application.name);
// This is an example of using the multi-point publish feature to republish
// streams to another application instance on the local server.
if (application.name == "publishLive/live"){
trace("Republishing the stream into ustream");
nc = new NetConnection();
nc.connect( "rtmp://1.616528.fme.ustream.tv/ustreamVideo/616528" );
ns = new NetStream(nc);
// called when the server NetStream object has a status
ns.onStatus = function(info) {
trace("Stream Status: " + info.code)
if (info.code == "NetStream.Publish.Start") {
trace("The stream is now publishing");
}
}
ns.setBufferTime(2);
ns.attach(livestream);
ns.publish( livestream.name, "live" );
}
}
application.onUnpublish = function( client, livestream ) {
trace(livestream.name + " is unpublishing");
}
// RECORDING
application.onAppStart = function() {
this.nsr = Stream.get("livestreamSS"); " <-- this is the server-side instance name
this.nsr.play("livestream", -1, -1); " <-- this is the published instance name
this.nsr.onStatus = function(info){
if(info.code == "NetStream.Play.PublishNotify"){
application.startRecording();
}
if(info.code == "NetStream.Play.UnPublishNotify"){
application.stopRecording();
}
for(var i in info){
trace("i: " + i);
trace("info: " + info);
}
}
}
application.startRecording = function() {
var infoObject = Stream.getOnMetaData("livestream");
trace("Metadata for myVideo.flv:");
for( i in infoObject ){
if infoObject == "record" {
trace("start recording");
this.nsr.record();
}
}
}
application.stopRecording = function() {
trace("stop recording");
this.nsr.record(false);
}
