• How to control Stream class streams dynamically (ModuleStreamControl)

    This module can be used to control Stream class streams and playlists. It can be used to dynamically create, set up, and start new live Stream class streams from static and live sources, and add sources to existing Stream class streams. It uses a custom Flash client as a user interface to the module.

    You can also use this module alongside the StreamPublisher to provide extra control.

    • Care must be taken if you use ModuleStreamControl in conjunction with the StreamPublisher. Any changes made by either module may not be picked up in the other module.

    • This module uses internal ApplicationInstance properties to store references to streams and playlists. Do not use the same name for a stream and a playlist. Using the same name for both will have unexpected results because the last object defined (either the stream or the playlist) will be stored in the properties and will overwrite what is already there.
    A compiled version of this module is included in the Wowza Modules Collection.


    To enable this module, add the following module definition to your application. See Configure modules for details.

    Fully Qualified Class Name
    ModuleStreamControl Controls Stream class streams and playlists. com.wowza.wms.plugin.collection.module.ModuleStreamControl

    Flash Client Example

    The following Actionscript 3 code shows the client-side Flash functions that can be used to interact with the module.
    public function addNewStream():void
    public function addNewPlaylist():void
    public function stopStream():void
    public function openPlaylistOnStream():void
    public function nextItem():void
    public function addItemToPlaylist():void
    	var obj:Object = new Object();
    	obj.playListName = playlist.text;
    	obj.itemName = itemName.text;
    	obj.itemStart = itemStart.text;
    	obj.itemDuration = itemDuration.text;
    Following is a modified version of the Wowza LiveVideoStreaming player with these commands added.

    To operate, use the buttons and text input prompted below the the video display.

    1. Enter a stream (for example: StreamNew), then click add stream.

    2. Enter a playlist (for example: playlistNew), then click add playlist.

    3. Add at least one item to the playlist (for example: mp4:sample.mp4 with start=0 and length=-1), then click add Item to playlist.

    4. Click open playlist on stream.

    5. In the main player Stream Name text box, enter the stream name, StreamNew, and then click Play.

    • To add a new item to an existing playlist, enter a new video name with start and length, and then click add item to playlist. The stream will not be updated until the playlist is opened on the stream.

    • To change the playlist on a stream or to update a stream with an existing playlist, enter the stream name and playlist name, and then click open playlist on stream. This will reset the stream and load the new playlist.

    • The Stream Control application module and client provide no feedback or listing of active streams. If you are using with the StreamPublisher, then you have to know what stream name and playlist name to use.

    • To add a live source to a playlist, enter -2 for video start. You can mix live sources and static content.

    • It's best to set the buffer to 0 for playback in the player that is monitoring the stream. Buffer time in the client significantly impacts what the user sees when streams switch sources.

    Wowza media server software and all components, including modules, source code, and other related items offered on this page, are copyrighted (c) 2006-2014 by Wowza Media Systems, LLC, all rights reserved, and are licensed pursuant to the Wowza Media Software End User License Agreement.
    Updated: For Wowza Streaming Engine 4.0.6 on 08-11-2014.

    If you're having problems or want to discuss this article, post in our forum.