Results 1 to 2 of 2

Thread: WMSProperties on isTranscodeResult()

  1. #1
    Join Date
    Jul 2012
    Posts
    3

    Default WMSProperties on isTranscodeResult()

    Hi

    How do I get an IApplication object on an transcoded stream. stream.getClient().getApplication() is not working
    stream.getStreams().getAppInstance() either.
    I need to get some WMSProperties on an transcoded stream that's the goal.

    My Code:

    public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {


    if (stream.isTranscodeResult()) {
    IApplicationInstance appInstance = stream.getStreams().getAppInstance();
    WMSProperties videostreamPublishList = (WMSProperties) appInstance.getProperties().get(Config.VIDEOSTREAM_PUBLISHERS);
    // videostreamPublishList is Null here and it shouldn't
    } else {
    IApplication app = stream.getClient().getApplication();
    WMSProperties videostreamPublishList = (WMSProperties) app.getProperties().get(Config.VIDEOSTREAM_PUBLISHERS);
    // this is working
    }
    }

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    It works for me:
    package test;
    
    import com.wowza.wms.stream.*;
    import com.wowza.wms.stream.livetranscoder.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.application.*;
    
    public class ModuleTranscoderControlByStream extends ModuleBase
    {
    	class TranscoderControl implements ILiveStreamTranscoderControl
    	{
    		public boolean isLiveStreamTranscode(String transcoder, IMediaStream stream)
    		{
    			IApplicationInstance appInstance = stream.getStreams().getAppInstance();
    			appInstance.getProperties().setProperty("test", "this");
    			
    			return true;
    		}
    	}
    	
    	public void onAppStart(IApplicationInstance appInstance)
    	{
    		appInstance.setLiveStreamTranscoderControl(new TranscoderControl());
    	}
    }
    You can also set WMSProperties on the stream:
    stream.getProperties().setProperty("var", "val");
    Richard

Similar Threads

  1. Why to sync on WmsProperties
    By yevgune2 in forum General Forum
    Replies: 1
    Last Post: 10-15-2013, 07:44 AM

Posting Permissions

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