• How to override play to remap a stream name

    Code:
    package com.wowza.wms.example.module;
    
    import com.wowza.wms.amf.*;
    import com.wowza.wms.client.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.request.*;
    
    public class ModuleOverridePlayRemapStream extends ModuleBase {
    	
    	public void play(IClient client, RequestFunction function,
    	        AMFDataList params) {
    		getLogger().info("Overriding Play");
    		
    		String streamName = getParamString(params, PARAM1);
    		
    		if (streamName.equalsIgnoreCase("test"))
    				params.set(PARAM1, "sample.mp4");
    		
    		invokePrevious(client, function, params);
    	}
    }

    Comments 11 Comments
    1. EdsonSantoro -
      Sorry for this dumb question, BTW, what is it for? How can I use that?
    1. rrlanham -
      If a Flash client does netstream.play("someStream"), you can play "anotherStream" instead.

      Richard
    1. EdsonSantoro -
      May I use this to restart my smil playlist after a live stream? Because, I'm using a linear 24/7 stream to my website with stream name "LiveVideo". When I run Wirecast for a real live streaming, I use the same name "LiveVideo", so it is remaped, or overwriten, all good at now. After the end of the this real live streaming, the flash player says: "Can not connect to this stream", of course, because the smil playlist was overwriten, but, this code 'override play, remap stream' can help me?

      Thanks

      Quote Originally Posted by rrlanham View Post
      If a Flash client does netstream.play("someStream"), you can play "anotherStream" instead.

      Richard
    1. rrlanham -
      No, it won't work for that.

      Richard
    1. Billgates -
      Suppose if we have muliple live Stream what we used instead of "Extremists.flv"?
    1. s.ali.abbas.raza -
      not working for http only working for rtmp. Any help?
    1. rrlanham -
      This method only works for Flash/RTMP clients.

      Take a look at StreamNameAlias:
      http://www.wowzamedia.com/forums/con...e-alias-module

      Richard
    1. nitinkaplan -
      HI Richard,

      We want to remap live stream to vod. For eg the flash client requests this stream:

      rtmp://23.21.133.234/live/xyz.sdp

      we want to respond back with this:

      rtmp://23.21.133.234/vod/mp4:ms.mp4

      How to get this working?

      Rgds
      Nitin
    1. rrlanham -
      There are different approaches, this examples is one but there is the problem of StreamType. Please explain what you are trying to accomplish exactly so I know which way to point.

      What playback clients are you supporting? Is it Flash RTMP clients only, or other client types?

      Richard
    1. nitinkaplan -
      We want to give a feature to our customer through which they can enable / disable a VOD message played back on their flash players. So when they disable the message, the rtmp link will not be redirected and the live stream will continue playback. At times when they enable the setting, the rtmp link should be redirected to the vod link ms.mp4. The vod file is a 1-2 min clip that they play once.

      We need this only for rtmp clients. Unfortunately we don't have access to their third party flash player.
    1. rrlanham -
      I don't exactly follow, but there is no way to do that kind of thing in a Flash RTMP client without access to it.

      Richard