• How to use the MediaCaster API

    This is a snippet of code for starting and stopping a stream using methods that are part of the IApplicationInstance interface. It is a couple of utility methods that can be used to simplify starting/stopping a stream:

    Code:
    IApplicationInstance.startMediaCasterStream(streamName, mediaCasterType);
    IApplicationInstance.stopMediaCasterStream(streamName)
    Example uses:

    Code:
    Start an IP camera stream with the stream name camera.stream (file contains RTSP URL):
    appInstance.startMediaCasterStream("camera.stream", "rtp");
    
    Start a SHOUTcast stream with the stream name radio.stream (file contains SHOUTcast URL):
    appInstance.startMediaCasterStream("radio.stream", "shoutcast");
    
    Start pull a stream from another Wowza or FMS server with the stream name rtmp.stream (file contains full RTMP URL):
    appInstance.startMediaCasterStream("rtmp.stream", "liverepeater");

    Comments 10 Comments
    1. cloudsurfin -
      Is there a complete javascript/jquery example demonstrating this? Seems like all the examples are flash.
    1. BitBuilder -
      Quote Originally Posted by cloudsurfin View Post
      Is there a complete javascript/jquery example demonstrating this? Seems like all the examples are flash.
      These are Server side code examples (Java), not client side examples.

      -bb
    1. evilpenguin -
      I want to start a liverepeater stream only if the stream is not already started. Any client watching the stream could start the liverepeater and hence the mediacaster call is not needed.

      Is there a way I can check if the stream is already started by another method, before starting it with mediacaster? Something like:

      Code:
      if (appInstance.getStreams().getStream(lowStreamName)!=null) appInstance.startMediaCasterStream(lowStreamName, "liverepeater");
      Am I at least close?
    1. rrlanham -
      There is one way this works and you don't need any code but it is limited to Flash clients: Use StreamType "rtp-live"

      If you have HTTP clients (iOS, Silverlight or Flash HTTP), starting the streams as necessary with the MediaCaster API won't work. So either use StreamType "rtp-live" and Flash clients only, or use StreamType "live" and pre-start streams.

      Richard
    1. michael401 -
      Can you give an example of using the mediacaster api to start the dvr version of a stream?
    1. ScottKell -
      Quote Originally Posted by michael401 View Post
      Can you give an example of using the mediacaster api to start the dvr version of a stream?
      If you mean you want to start a stream that will be DVR-ed, you just use it the same way and have your application.xml configured to record the DVR.

      If you mean to start a pre-recorded DVR, you cannot do that.
    1. ztatic -
      I don't understand how I would go about using this code.. can someone provide that kind of context? a link maybe?
    1. randall -
      You would need to familiarize yourself with making modules in the Wowza IDE: http://www.wowza.com/ide.html

      You could just pick a random module and compile it to start with: http://www.wowza.com/forums/content....tching-example
    1. gsudipta -
      It seems that in all cases we need to have a <<streamName>>.stream file in the content directory....
      Is it possible to start stop MediaCaster stream without having that .stream file?
      Currently I am creating a .stream file dynamically using wowza plugin. So in all cases the streamName finally becomes XXX.stream. I don't want to keep the .stream in the stream name.

      Please help...
    1. rrlanham -
      You can use the StreamNameAlias addon or the API

      http://www.wowza.com/forums/content....ameAlias-AddOn

      http://www.wowza.com/forums/content....der2-Interface

      Richard