Results 1 to 6 of 6

Thread: Application.xml/StreamType per ApplicationInstance

  1. #1

    Default Application.xml/StreamType per ApplicationInstance

    Is there a way to choose between "liverepeater-edge" and "live-rtp" in my module?

    Something like that:

    Code:
    public class AliasRepeater extends ModuleBase implements IMediaStreamNameAliasProvider {
    	
    	...
    
    	public void play(IClient client, RequestFunction function, AMFDataList params) {
    		if(params.get(PARAM1).getType() == AMFData.DATA_TYPE_STRING) {
    			String playName = params.getString(PARAM1);
    			String streamName = resolveStreamAlias(client.getAppInstance(), playName);
    			
    			if(streamName.startsWith("rtsp://")) {
    				// Choose rtp-live stream
    				getLogger().info("AliasRepeater.play["+playName+"]: "+"rtp-live");
    			} else {
    				// Choose liverepeater-edge stream
    				getLogger().info("AliasRepeater.play["+playName+"]: "+"riverepeater-edge");
    			}
    		}
    		this.invokePrevious(client, function, params);
    	}
    }
    Last edited by sjerzy; 04-20-2010 at 02:13 AM.

  2. #2
    Join Date
    Dec 2007
    Posts
    25,655

    Default

    You have to do in the client, like this:

    Code:
    // do this first
    netconnection.call("setStreamType","rtp-live");
    
    // then create a new NetStream object with the above netconnection
    var rtpliveNetstream:NetStream = new NetStream(netconnection)
    Richard

  3. #3

    Default

    Quote Originally Posted by rrlanham View Post
    You have to do in the client, like this:

    Code:
    // do this first
    netconnection.call("setStreamType","rtp-live");
    
    // then create a new NetStream object with the above netconnection
    var rtpliveNetstream:NetStream = new NetStream(netconnection)
    Richard
    I can't control client player. StreamAlias works well with rtp-live and liverepeater streams separately, but I want to use it in one application.

  4. #4
    Join Date
    Dec 2007
    Posts
    25,655

    Default

    But it's too late to change StreamType in the server-side play command.

    Richard

  5. #5

    Default

    Quote Originally Posted by rrlanham View Post
    But it's too late to change StreamType in the server-side play command.

    Richard
    Good, when it is not too late?

  6. #6
    Join Date
    Dec 2007
    Posts
    25,655

    Default

    I am unable to test this right now, but try this:

    Code:
    public void onConnect(IClient client, RequestFunction function,
    			AMFDataList params) {	
    	client.getAppInstance().setStreamType("live");
    }
    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •