Results 1 to 6 of 6

Thread: Listener for rtp mediacasters?

  1. Default Listener for rtp mediacasters?

    I need to add a listener for rtp mediacasters, but it seems that applicationInstance.addMediaCasterListener() doesnt do the job.

    Is there somewhere else I need listen for creation of mediacasters when the source is an rtsp stream pulled from an IP cam?


  2. #2
    Join Date
    Dec 2007

  3. Default

    Thanks Richard.

    For my use case, I need to catch tje creation of the rtpmediacaster from outside of the application the mediacaster is created in (the app I'm building is intended to monitor other apps, which I may or may not have written.

    Is there a listener I can add to the IApplication instance ( or server or vhost would do just as well) that will notify of new rtpmediacasters?

  4. Default

    Any chance IVHost.getRtpContext().getSessions().addSessionListener() would work in this case?

  5. Default

    I found that my initial approach to adding a mediacaster listener on the application instance works... just not as I expected.

    When an application uses appInstance.startMediaCasterStream(url, "rtp") in the onAppStart method, the mediaCaster can be created before all IApplicationInstanceNotify instances listening for the application to start have fired. In that case, my IMediaCasterNotify2 may not have started listening on the IApplicationInstance in time to catch the IMediaCasterNotify2.onMediaCasterCreate() event.

    If I delay the call to appInstance.startMediaCasterStream so it happens after the onAppStart completes, everything works as expected.

  6. #6
    Join Date
    Dec 2007



    There is a new recommended API to start MediaCaster streams

    And there is IApplicationInstanceNotify that should help:

    // in onAppStart:
    appInstance.getApplication().addApplicationInstanceListener(new AppInstanceListener());
    // Add the class:
    class AppInstanceListener implements IApplicationInstanceNotify
    	public void onApplicationInstanceCreate(
    			IApplicationInstance applicationInstance) {
    		// TODO Auto-generated method stub
    	public void onApplicationInstanceDestroy(
    			IApplicationInstance applicationInstance) {
    		// TODO Auto-generated method stub
    		applicationInstance.addClientListener(new ClientNotifier());

Similar Threads

  1. listener clases
    By jasonp in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 01-24-2013, 07:27 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