Results 1 to 3 of 3

Thread: IMediaStreamActionNotify3 listener not getting initialized fast enough

  1. #1

    Default IMediaStreamActionNotify3 listener not getting initialized fast enough

    I ran into an interesting problem. It seems my listener for streams isn't getting initialized fast enough for the onPlay call to fire. Here is what I'm doing:

    @SuppressWarnings("unchecked")
    	public void onStreamCreate(IMediaStream stream) 
    	{
    		log("StreamManager onStreamCreate start");
    		IMediaStreamActionNotify actionNotify  = new StreamListener();
    		
    		WMSProperties props = stream.getProperties();
    		synchronized(props)
    		{
    			props.put("streamActionNotifier", actionNotify);
    		}
    		stream.addClientListener(actionNotify);
    		log("StreamManager onStreamCreate finish");
    	}
    	
    	public void onStreamDestroy(IMediaStream stream) 
    	{
    		IMediaStreamActionNotify actionNotify = null;
    		WMSProperties props = stream.getProperties();
    		synchronized(props)
    		{
    			actionNotify = (IMediaStreamActionNotify) stream.getProperties().get("streamActionNotifier");
    		}
    		if (actionNotify != null)
    		{
    			stream.removeClientListener(actionNotify);
    		}
    	}
    class StreamListener implements IMediaStreamActionNotify3
    	{
    		public void onPlay(IMediaStream stream, String streamName, double playStart, double playLen, int playReset) 
    		{
    			log("onPlay: "+stream.getName());
    		}
    		public void onMetaData(IMediaStream stream, AMFPacket metaDataPacket) 
    		{
    		}
    		
    		public void onPauseRaw(IMediaStream stream, boolean isPause, double location) 
    		{
    		}
    
    		public void onSeek(IMediaStream stream, double location)
    		{
    			log("onSeek: "+stream.getName()+" to: "+Double.toString(location));
    		}
    		
    		public void onStop(IMediaStream stream)
    		{
    			log("onStop: "+stream.getName());
    		}
    		
    		public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
    		{
    			log("onUnPublish: "+streamName);
    		}
    
    		public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
    		{
    			log("onPublish: "+streamName);
    		}
    		
    		public void onPause(IMediaStream stream, boolean isPause, double location)
    		{
    			log("onPause: "+stream.getName()+" at: "+Double.toString(location));
    		}
    		
    		@Override
    		public void onCodecInfoAudio(IMediaStream arg0, MediaCodecInfoAudio arg1) 
    		{
    		}
    		
    		@Override
    		public void onCodecInfoVideo(IMediaStream arg0, MediaCodecInfoVideo arg1) 
    		{
    		}
    	}
    The matching logs look like this:
    2012-09-05 23:12:43 UTC setstreamtype application INFO 200 default - - - - 6.083 - - - - - - - - - - - - - - - - - - - - - - - - -
    2012-09-05 23:12:43 UTC comment server INFO 200 - StreamManager onStreamCreate start - - - 43.078 - - - - - - - - - - - - - - - - - - - - - - - - -
    2012-09-05 23:12:43 UTC comment server INFO 200 - StreamManager onStreamCreate finish - - - 43.08 - - - - - - - - - - - - - - - - - - - - - - - - -
    2012-09-05 23:12:43 UTC create stream INFO 200 - - _defaultVHost_ ondemand Player-71004767ff75 0.022 [any] 443 rtmpe://server/Player-71004767ff75 199.101.224.83 rtmpe https://some.swf MAC 11,4,402,265 319438041 3913 3413 1 - 0 0 - - - - 0 0.0 rtmpe://server/Player-71004767ff75 rtmpe://server/Player-71004767ff75 - rtmpe://server/Player-71004767ff75 -
    2012-09-05 23:12:43 UTC play stream INFO 401 - - _defaultVHost_ ondemand Player-71004767ff75 0.116 [any] 443 rtmpe://server/Player-71004767ff75 199.101.224.83 rtmpe https://url_to_player.swf MAC 11,4,402,265 319438041 3982 3455 1 - 0 0 - - - - 0 0.0 rtmpe://server/Player-71004767ff75 rtmpe://server/Player-71004767ff75 - rtmpe://server/Player-71004767ff75 -
    2012-09-05 23:12:58 UTC comment server INFO 200 - onSeek: to: 0.0 - - - 58.481 - - - - - - - - - - - - - - - - - - - - - - - - -
    2012-09-05 23:12:58 UTC comment server INFO 200 - onPause: at: 0.0 - - - 58.602 - - - - - - - - - - - - - - - - - - - - - - - - -

    So the onPlay method doesn't get called. It's as if the listener isn't fully instantiated yet. I can see the native log, "2012-09-05 23:12:43 UTC play stream", get run.. but my custom one does not.

    Just want to make sure I'm not overlooking anything menial.

    Thanks,
    Jake

  2. #2

    Default

    The problem ended up being client stream read permissions. Once that was corrected all was well.

    I'm feeling off my game today.. sheesh!

    Sorry for the noise.

    Jake

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

    Default

    np, Jake. Thanks for the update.

    Richard

Similar Threads

  1. Multiple IMediaStreamActionNotify3 listeners
    By yevgune2 in forum General Forum
    Replies: 1
    Last Post: 03-06-2014, 02:41 AM
  2. create stream by IMediaStreamActionNotify3.onPlay()
    By spiritsoul in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 07-12-2013, 01:02 AM
  3. Fast Forward/Fast Rewind and Flowplayer
    By sam.shm in forum Video On Demand Streaming Discussion
    Replies: 4
    Last Post: 06-05-2013, 06:18 PM

Posting Permissions

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