Skip to main content
Participant
February 13, 2013
Question

Livestream cuepoint insertion with FMS 4.5

  • February 13, 2013
  • 1 reply
  • 1453 views

Hi,

I'd like to insert cuepoints into a livestream(h.264) / trigger functions directly in my flashplayer with FMS 4.5.

Can I trigger directly a function in my Flashplayer with a Netconnection from FMS?

Has anyone a example for this or some explanations on this topic?

Thanks!

This topic has been closed for replies.

1 reply

February 14, 2013

In the following example, the application Broadcaster.fla is inserting CUEPOINT in the server side recording and the application Watcher.fla is watching that recorded stream and is able to trace the value "now" in doSomething method.

Here the data sent through Nestream.send() method gets stored in the FLV.

Broadcaster.fla :

// Start publishing live feed.

function onNCStatus(event:NetStatusEvent):void {

logs.text += "Publisher Connection Status: " + event.info.code + "\n";

if (event.info.code=="NetConnection.Connect.Success") {

  pub_ns = new NetStream(nc);

  pub_ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  pub_ns.publish(stream_name.text);

 

}

}

function doSend(e:MouseEvent) {

trace("Sending the cuepoint for stream : " + stream_name.text);

pub_ns.send("doSomething","now");

}

Server Side script :

application.onConnect=function(clientObj){

trace("          on connect ");

return true;

};

application.onDisconnect=function(clientObj){

trace("          on disconnect ");

};

application.onPublish = function( client, stream )

{

trace("In application.onPublish : Client published a live stream named - " + stream.name + ".");

stream.record("record");

}

application.onUnpublish = function(clientObj,streamObj){

trace("          on unpublish : " + streamObj.type + ":" + streamObj.name);

streamObj.record(false);

}

Watcher.fla :

function ncStatus(event:NetStatusEvent):void{

  if(info.code=="NetConnection.Connect.Success"){

  ns = new NetStream(nc);

  ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  client = new Object();

  ns.client = client;

  client.doSomething = onDoSomething;   

}

}

function onDoSomething(value):void

{

if(value == "now")

  trace("done");

}

Also, about your 2nd question, you can call a function on the client side from server side code using Client.call() method. The following link has an example for the same:

http://help.adobe.com/en_US/flashmediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7ec3SSASLR.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7fc8SSASLR

tooltippsAuthor
Participant
February 22, 2013

Hi thank you very much for your help.

My questions are:

- Broadcaster.fla is a own Flash Application which is connected to my FMS, correct?

- Why do I have to Record the Stream on my FMS?

I'd like to use it like:

FMLE Push to -> FMS Push to-> CDN

And the Broadcaster.fla Flashapplication is connected to my FMS and inserting these cuepoints.

But I've not a real cuepoint because it's a method I've to trigger in my clients flashplayer.

Thank you very much.

Participant
February 26, 2013

that ay work to have the ns send data go through, other option is from FLA do a NC call to FMS then on the republish to CDN stream add the ns.send to get the data out