Results 1 to 4 of 4

Thread: Stream Manager MediaCaster API

  1. #1

    Default Stream Manager MediaCaster API

    Previously I have used the MediaCaster API to reset the active streams.

    Using the knowledge of this threads
    http://www.wowza.com/forums/content.php?166 - How to use the MediaCaster API
    http://www.wowza.com/forums/showthre...Stream-Manager - using the Richard's post

    Now I'm trying to create method to start the stream and I encounter the following issue.

    First using the Engine Manager an application is created.
    When I call my method for starting the stream

    IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT); IApplication app = vhost.getApplication(appName); try
    {
    IApplicationInstance applicationInstance = application.getAppInstance(application.getAppInstanceNames().get(0)); applicationInstance.startMediaCasterStream(streamName, mediaCasterType); } catch (Exception e) { // }
    A null pointer exception happens where I try to get the appInstance (application.getAppInstance(application.getAppInstanceNames().get(0)), same happens with (app.getAppInstance("_definst_");), because the instance hasn't been created yet.

    If I manually start the stream from stream manager it does start and after using my method can start second stream without problem after the instance is created, but I can't use this because if I have to manually start the instance then I won't need this method.

    How is the stream started using the stream manager, how it can start it without the instance (_definst_) being already created?

    Regards,

  2. #2

    Default

    Hello.

    Please take a look at this HTTPProvider. The second example shows how to do this:
    How to parse post or get variables in an HTTPProvider

    Kind regards,

    Salvadore

  3. #3

    Default

    Hi Salvadore,

    Thank you for replying to the thread.
    I'm already using HTTPProvider to call the API method, that part of the configuration is already working. In the example choosing the app instance is again done with
    (app.getAppInstance("_definst_");) which also does not work if the instance is not active.

    I fixed the problem with starting the application prior to selecting the app instance and the null pointer exception is gone.
    Current code is:


    IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
    vHost.startApplicationInstance(appName);
    
    IApplication app = vhost.getApplication(appName);
    
    IApplicationInstance applicationInstance = application.getAppInstance(application.getAppInstanceNames().get(0));
    applicationInstance.startMediaCasterStream(streamName, mediaCasterType);
    Regards,

  4. #4

    Default

    That's great news. Thanks for the update and glad you got this sorted out.

    Kind regards,

    Salvadore

Similar Threads

  1. Mediacaster API question
    By haydenm315 in forum Server-side Modules and Code Samples Discussion
    Replies: 0
    Last Post: 11-19-2014, 04:58 PM
  2. API call behind stream manager
    By dr.gigabit in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 01-08-2013, 04:24 AM
  3. MediaCaster API / Shoutcast whithout radiostation.stream file
    By ghost_amm in forum Server-side Modules and Code Samples Discussion
    Replies: 5
    Last Post: 12-29-2011, 07:23 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
  •