Results 1 to 5 of 5

Thread: event for all stream watchers

  1. #1
    Join Date
    May 2012
    Posts
    4

    Question event for all stream watchers

    Hello!
    Please help me!
    When broadcast is switch to pay mode of viewing content there need to be special event executed for all who are watching this stream
    For Example:

    public class SomeModule extends ModuleBase{
    
    // publisher's method for switch on pay mode (call from client) public void payMode(IClient client, RequestFunction function, AMFDataList params) {
    String allowedEncoder; Boolean isPublisher; String flashver = client.getFlashVer(); allowedEncoder = client.getAppInstance().getProperties().getPropertyStr("AllowEncoder"); isPublisher = flashver.startsWith(allowedEncoder); if (isPublisher){
    // call event for all who watch this publisher //..............
    }
    }
    // Event for watchers public void onPayMode(...............){
    Boolean isPublisher; String flashver = client.getFlashVer(); allowedEncoder = client.getAppInstance().getProperties().getPropertyStr("AllowEncoder"); isPublisher = flashver.startsWith(allowedEncoder);
    if (!isPublisher){ // some code }
    }
    }
    }
    How can I call onPayMode method from payMode method for all (and only for) watchers who watch this stream?

    Thank you!!!

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Do it like this:

    client.getAppInstance().broadcastMsg("clientsideCallBackFunction", "someDataForTheClient");
    client-side:
    var clientObj:Object = new Object();
    clientObj.clientsideCallBackFunction(data:String):void
    {
    trace(data);
    });
    
    netconnection.client = clientObj;
    netconnection.connect("rtmp://[wowza-address]:1935/[app-name]");
    Richard

  3. #3
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Also, take a look at the ServerSideModules example that ships with Wowza in the examples folder. This is a working reference of Flash RTMP <> Wowza communications.

    Richard

  4. #4
    Join Date
    May 2012
    Posts
    4

    Default

    Hi, Richard
    It seems that you did not get me. All operaions shoud be executed only on the server side without participation of the client. Wowza creates class instance for each connected client. My programm code is working inside this class instance. The problem is how to run event in other processes being inside another. That processes are connected to the same stream which executed an event

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Take a look at getStreamClientIds in this example as a starting place:

    http://www.wowza.com/forums/content....nce-and-stream

    Richad

Similar Threads

  1. How to re-stream live event?
    By Nuramon in forum General Forum
    Replies: 10
    Last Post: 11-13-2013, 10:43 AM
  2. Im using the VOD FlashHTTPPlayer example, but cannot use any stream event
    By miroslav88 in forum Video On Demand Streaming Discussion
    Replies: 12
    Last Post: 08-02-2013, 07:54 AM
  3. Trigger an Event once a live stream starts
    By alphacino in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 01-09-2012, 07:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •