Class ModuleCore


  • public class ModuleCore
    extends ModuleBase

    ModuleCore includes all the basic commands support by the NetStream and NetConnection client side objects. Any of these methods can be overwritten in a custom module. Below is an example of custom module that overrides the play method to modify the name of the file to be played:

    package com.wowza.wms.plugin.overrideexample;
    
    import com.wowza.wms.amf.*;
    import com.wowza.wms.client.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.request.*;
    
    public class ModuleOverrideExample extends ModuleBase
    {
            public void play(IClient client, RequestFunction function, AMFDataList params)
            {
                    if (params.get(PARAM1).getType() == AMFData.DATA_TYPE_STRING)
                    {
                            String playName = params.getString(PARAM1);
                            params.set(PARAM1, new AMFDataItem(playName+"_newname"));
                    }
                    this.invokePrevious(client, function, params);
            }
    }
    
    • Constructor Detail

      • ModuleCore

        public ModuleCore()
    • Method Detail

      • createStream

        public static void createStream​(IClient client,
                                        com.wowza.wms.request.RequestFunction function,
                                        AMFDataList params)
        Create new server side NetStream object (internal to Flash workings).
        Parameters:
        client - client
        function - function
        params - parameters (no params)
      • initStream

        public static void initStream​(IClient client,
                                      com.wowza.wms.request.RequestFunction function,
                                      AMFDataList params)
        Create new server side NetStream object (internal to Flash workings).
        Parameters:
        client - client
        function - function
        params - parameters (streamIndex, boolean)
      • releaseStream

        public static void releaseStream​(IClient client,
                                         com.wowza.wms.request.RequestFunction function,
                                         AMFDataList params)
      • getLastStreamId

        public static void getLastStreamId​(IClient client,
                                           com.wowza.wms.request.RequestFunction function,
                                           AMFDataList params)
        Get the id for the last created stream NetConnection.call("getLastStreamId", resultObj);
        Parameters:
        client - client
        function - client
        params - params (no params)
      • deleteStream

        public static void deleteStream​(IClient client,
                                        com.wowza.wms.request.RequestFunction function,
                                        AMFDataList params)
        Delete server side stream object (internal to Flash workings).
        Parameters:
        client - client
        function - function
        params - params
      • publish

        public static void publish​(IClient client,
                                   com.wowza.wms.request.RequestFunction function,
                                   AMFDataList params)
        Server side implementation of NetStream.publish(name : String [, howToPublish : String]);
        Parameters:
        client - client
        function - function
        params - params (name [if name = "false" or "null" stop publishing], howToPublish ["record", "live", "append"])
      • setBandwidthLimit

        public static void setBandwidthLimit​(IClient client,
                                             com.wowza.wms.request.RequestFunction function,
                                             AMFDataList params)
      • play2

        public static void play2​(IClient client,
                                 com.wowza.wms.request.RequestFunction function,
                                 AMFDataList params)
        Server side implementation of NetStream.play(playOptions : NetStreamPlayOptions);
        Parameters:
        client -
        function -
        params -
      • play

        public static void play​(IClient client,
                                com.wowza.wms.request.RequestFunction function,
                                AMFDataList params)
        Server side implementation of NetStream.play(name : Object [,start : Number[, len : Number[, reset : Object]]]);
        Parameters:
        client - client
        function - function
        params - params (name, start, len, reset)
      • closeStream

        public static void closeStream​(IClient client,
                                       com.wowza.wms.request.RequestFunction function,
                                       AMFDataList params)
        Server side implementation of NetStream.close();
        Parameters:
        client - client
        function - function
        params - params (no params)
      • seek

        public static void seek​(IClient client,
                                com.wowza.wms.request.RequestFunction function,
                                AMFDataList params)
        Server side implementation of NetStream.seek(offset : Number);
        Parameters:
        client - client
        function - function
        params - params (offset)
      • pause

        public static void pause​(IClient client,
                                 com.wowza.wms.request.RequestFunction function,
                                 AMFDataList params)
        Server side implementation of NetStream.pause([ flag : Boolean]);
        Parameters:
        client - client
        function - function
        params - params (flag)
      • setBufferTime

        public static void setBufferTime​(IClient client,
                                         com.wowza.wms.request.RequestFunction function,
                                         AMFDataList params)
        Server side implementation of NetStream.setBufferTime(bufferTime : Number);
        Parameters:
        client - client
        function - function
        params - params (bufferTime)
      • getClientID

        public static void getClientID​(IClient client,
                                       com.wowza.wms.request.RequestFunction function,
                                       AMFDataList params)
        Get the clientId for a client connection NetConnection.call("getClientID", resultObj);
        Parameters:
        client - client
        function - function
        params - params (no params)
      • getVersion

        public static void getVersion​(IClient client,
                                      com.wowza.wms.request.RequestFunction function,
                                      AMFDataList params)
        Get the Wowza Pro server version and build number NetConnection.call("getVersion", resultObj);
        Parameters:
        client - client
        function - function
        params - params (no params)
      • setLiveStreamPacketizer

        public static void setLiveStreamPacketizer​(IClient client,
                                                   com.wowza.wms.request.RequestFunction function,
                                                   AMFDataList params)
        Set the live stream packetizer for a stream
        Parameters:
        client - client
        function - function
        params - params (liveStreamPacketizer)
      • initLiveStreamRepeating

        public static void initLiveStreamRepeating​(IClient client,
                                                   com.wowza.wms.request.RequestFunction function,
                                                   AMFDataList params)
        Initialize a stream for live stream repeating
        Parameters:
        client - client
        function - function
        params - params (liveStreamPacketizer, liveStreamRepeater)
      • getLiveStreamPacketizer

        public static void getLiveStreamPacketizer​(IClient client,
                                                   com.wowza.wms.request.RequestFunction function,
                                                   AMFDataList params)
        Get the live stream packetizer list for a client connection NetConnection.call("getLiveStreamPacketizer", resultObj);
        Parameters:
        client - client
        function - function
        params - params (no params)
      • setStreamType

        public static void setStreamType​(IClient client,
                                         com.wowza.wms.request.RequestFunction function,
                                         AMFDataList params)
        Set the default stream type for a client connection NetConnection.call("setStreamType", null, streamType);
        Parameters:
        client - client
        function - function
        params - params (streamType)
      • getStreamType

        public static void getStreamType​(IClient client,
                                         com.wowza.wms.request.RequestFunction function,
                                         AMFDataList params)
        Get the default stream type for a client connection NetConnection.call("getStreamType", resultObj);
        Parameters:
        client - client
        function - function
        params - params (no params)
      • receiveAudio

        public static void receiveAudio​(IClient client,
                                        com.wowza.wms.request.RequestFunction function,
                                        AMFDataList params)
        Server side implementation of NetStream.receiveAudio(receive : Boolean);
        Parameters:
        client - client
        function - function
        params - params (receive)
      • receiveVideo

        public static void receiveVideo​(IClient client,
                                        com.wowza.wms.request.RequestFunction function,
                                        AMFDataList params)
        Server side implementation of NetStream.receiveVideo(receive : Boolean | FPS : Number); FPS does not work the same as FMS. Wowza Pro accepts the following values:
        • true: Send all video frames
        • false: Send no video
        • -1: Send all video frames
        • -2: Send half the frames (remove B frames) (Note: only works with Sorenson Spark video with B-frames)
        • -3: Send only key frames
        Parameters:
        client - client
        function - function
        params - params (receive | FPS)
      • getStreamBitrate

        public void getStreamBitrate​(IClient client,
                                     com.wowza.wms.request.RequestFunction function,
                                     AMFDataList params)
        Get stream bitrate in bits-per-second for a video on demand stream (will not work for live). To call, NetConnection.call("getStreamBitrate", resultObj, streamName);
        Parameters:
        client - client
        function - function
        params - params (streamName:String)
      • getStreamLength

        public static void getStreamLength​(IClient client,
                                           com.wowza.wms.request.RequestFunction function,
                                           AMFDataList params)
        Get stream length in seconds NetConnection.call("getStreamLength", resultObj, streamName); If you pass in an array of streamNames it will return an array of durations.
        Parameters:
        client - client
        function - function
        params - params (streamName:String or streamNames:Array)
      • getRepeaterOriginUrl

        public static void getRepeaterOriginUrl​(IClient client,
                                                com.wowza.wms.request.RequestFunction function,
                                                AMFDataList params)
        Get the Repeater Origin URL for this client
        Parameters:
        client - client
        function - function
        params - params
      • setRepeaterOriginUrl

        public static void setRepeaterOriginUrl​(IClient client,
                                                com.wowza.wms.request.RequestFunction function,
                                                AMFDataList params)
        Set the Repeater Origin URL for this client
        Parameters:
        client - client
        function - function
        params - params (repeaterOriginUrl)
      • FCPublish

        public static void FCPublish​(IClient client,
                                     com.wowza.wms.request.RequestFunction function,
                                     AMFDataList params)
        FCPublish method called by FME 2.5
        Parameters:
        client - client
        function - function
        params - params
      • FCUnPublish

        public static void FCUnPublish​(IClient client,
                                       com.wowza.wms.request.RequestFunction function,
                                       AMFDataList params)
        FCUnpublish method called by FME 2.5
        Parameters:
        client - client
        function - function
        params - params
      • FCUnpublish

        public static void FCUnpublish​(IClient client,
                                       com.wowza.wms.request.RequestFunction function,
                                       AMFDataList params)
      • pauseRaw

        public static void pauseRaw​(IClient client,
                                    com.wowza.wms.request.RequestFunction function,
                                    AMFDataList params)
        pauseRaw method introduced in Flash player 10
        Parameters:
        client - client
        function - function
        params - params
      • getReferrer

        public static void getReferrer​(IClient client,
                                       com.wowza.wms.request.RequestFunction function,
                                       AMFDataList params)
        getReferrer returns the referrer from the onConnect metadata
        Parameters:
        client - client
        function - function
        params - params
      • getPageUrl

        public static void getPageUrl​(IClient client,
                                      com.wowza.wms.request.RequestFunction function,
                                      AMFDataList params)
        getPageUrl returns the pageUrl from the onConnect metadata
        Parameters:
        client - client
        function - function
        params - params
      • FCSubscribe

        public static void FCSubscribe​(IClient client,
                                       com.wowza.wms.request.RequestFunction function,
                                       AMFDataList params)
        FCSubscribe subscribes to a live stream (if origin edge will start the stream from the origin to the edge)
        Parameters:
        client - client
        function - function
        params - params (streamName:String, [mediaCasterType:String])
      • FCUnsubscribe

        public static void FCUnsubscribe​(IClient client,
                                         com.wowza.wms.request.RequestFunction function,
                                         AMFDataList params)
        FCUnSubscribe to a live stream
        Parameters:
        client - client
        function - function
        params - params (streamName:String)
      • FCUnSubscribe

        public static void FCUnSubscribe​(IClient client,
                                         com.wowza.wms.request.RequestFunction function,
                                         AMFDataList params)
      • startTransmit

        public static void startTransmit​(IClient client,
                                         com.wowza.wms.request.RequestFunction function,
                                         AMFDataList params)
      • stopTransmit

        public static void stopTransmit​(IClient client,
                                        com.wowza.wms.request.RequestFunction function,
                                        AMFDataList params)
      • getMediaList

        public static void getMediaList​(IClient client,
                                        com.wowza.wms.request.RequestFunction function,
                                        AMFDataList params)