Results 1 to 5 of 5

Thread: Gocoder and JWPlayer events

  1. #1

    Question Gocoder and JWPlayer events

    I have Wowza 3.6.2 build5334 with live apps types

    rtp-live-record-lowlatency
    live-record-lowlatency

    When i make live session with gocoder and stream ended video on JWPlayer v 6.7 freezed and player does not generete any events for this stream, but when i used FMLE all works fine.

  2. #2
    Join Date
    Jun 2011
    Posts
    1,047

    Default

    Hi,
    You'll only get a NetStream.Play.UnpublishNotify with RTMP type encoders.
    Others, such as RTSP Announce (that GoCoder uses) and other types that use MediaCaster,
    such as RTSP pull or MPEG-TS, will not provide the notification NetStream.Play.UnpublishNotify.

    Daren
    Last edited by daren_j; 12-02-2013 at 03:10 PM.

  3. #3

    Default

    whether it is possible to get the media server to send NetStream.Play.UnpublishNotify event or i may write own application?

  4. #4
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    I cannot test this right now, but this might work:

    package test;
    
    
    import java.util.Iterator;
    import java.util.List;
    
    import com.wowza.wms.amf.*;
    import com.wowza.wms.application.*;
    import com.wowza.wms.client.IClient;
    import com.wowza.wms.module.*;
    import com.wowza.wms.stream.*;
    import com.wowza.wms.media.model.*;
    
    public class ModuleMediaStreamActionNotify3Example extends ModuleBase
    {
    	IApplicationInstance appInstance;
    	
    	public void onAppStart(IApplicationInstance appInstance) {
    		String fullname = appInstance.getApplication().getName() + "/"
    				+ appInstance.getName();
    		getLogger().info("onAppStart: " + fullname);
    		
    		this.appInstance = appInstance;
    	}
    	
    	class StreamListener implements IMediaStreamActionNotify3
    	{
    		public void onMetaData(IMediaStream stream, AMFPacket metaDataPacket)
    		{
    			System.out.println("onMetaData[" + stream.getContextStr() + "]: " + metaDataPacket.toString());
    		}
    
    		public void onPauseRaw(IMediaStream stream, boolean isPause, double location)
    		{
    			System.out.println("onPauseRaw[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
    		}
    
    		public void onPause(IMediaStream stream, boolean isPause, double location)
    		{
    			System.out.println("onPause[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
    		}
    
    		public void onPlay(IMediaStream stream, String streamName, double playStart, double playLen, int playReset)
    		{
    			System.out.println("onPlay[" + stream.getContextStr() + "]: playStart:" + playStart + " playLen:" + playLen + " playReset:" + playReset);
    		}
    
    		public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
    		{
    			
    			
    		}
    
    		public void onSeek(IMediaStream stream, double location)
    		{
    			System.out.println("onSeek[" + stream.getContextStr() + "]: location:" + location);
    		}
    
    		public void onStop(IMediaStream stream)
    		{
    			System.out.println("onStop[" + stream.getContextStr() + "]: ");
    		}
    
    		public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
    		{
    			List<IClient> clients = appInstance.getClients();
    			Iterator<IClient> iter = clients.iterator();
    			while(iter.hasNext())
    			{
    				IClient client = iter.next();
    				if (!client.isConnected())
    					continue;
    				IMediaStream iStream = (IMediaStream) client.getPlayStreams().get(0);
    				sendStreamOnStatusError(iStream, "NetStream.Play.UnpublishNotify", "Stream UnPublished");
    			}
    		}
    
    		public void onCodecInfoAudio(IMediaStream stream,
    				MediaCodecInfoAudio codecInfoAudio) {
    			System.out.println("onCodecInfoAudio[" + stream.getContextStr() + " Audio Codec" + codecInfoAudio.toCodecsStr() + "]: ");
    		}
    
    		public void onCodecInfoVideo(IMediaStream stream,
    				MediaCodecInfoVideo codecInfoVideo) {
    			System.out.println("onCodecInfoVideo[" + stream.getContextStr() + " Video Codec" + codecInfoVideo.toCodecsStr() + "]: ");
    		}
    	}
    
    	public void onStreamCreate(IMediaStream stream)
    	{
    		getLogger().info("onStreamCreate["+stream+"]: clientId:" + stream.getClientId());
    		IMediaStreamActionNotify2 actionNotify = new StreamListener();
    
    		WMSProperties props = stream.getProperties();
    		synchronized (props)
    		{
    			props.put("streamActionNotifier", actionNotify);
    		}
    		stream.addClientListener(actionNotify);
    	}
    
    	public void onStreamDestroy(IMediaStream stream)
    	{
    		getLogger().info("onStreamDestroy["+stream+"]: clientId:" + stream.getClientId());
    
    		IMediaStreamActionNotify2 actionNotify = null;
    		WMSProperties props = stream.getProperties();
    		synchronized (props)
    		{
    			actionNotify = (IMediaStreamActionNotify2) stream.getProperties().get("streamActionNotifier");
    		}
    		if (actionNotify != null)
    		{
    			stream.removeClientListener(actionNotify);
    			getLogger().info("removeClientListener: " + stream.getSrc());
    		}
    	}
    
    }
    Richard

  5. #5
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    I tested it this morning and it works. The essential part is IMediaStreamActionNotify3.onUnPublish()

    public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
    		{
    			List<IClient> clients = appInstance.getClients();
    			Iterator<IClient> iter = clients.iterator();
    			while(iter.hasNext())
    			{
    				IClient client = iter.next();
    				if (!client.isConnected())
    					continue;
    				IMediaStream iStream = (IMediaStream) client.getPlayStreams().get(0);
    				sendStreamOnStatusError(iStream, "NetStream.Play.UnpublishNotify", "Stream UnPublished");
    			}
    		}
    Richard

Similar Threads

  1. Is GoCoder paid now?
    By tavius in forum GoCoder iOS app
    Replies: 2
    Last Post: 02-16-2016, 12:16 PM
  2. GoCoder Source
    By Moresheth in forum Wowza GoCoder SDK
    Replies: 7
    Last Post: 02-16-2016, 10:34 AM
  3. GoCoder does not work
    By nikolino in forum GoCoder Encoding App
    Replies: 1
    Last Post: 04-19-2014, 03:12 PM
  4. GoCoder, HLS, JWPlayer 6
    By olt99999 in forum Live Streaming and Encoder Discussion
    Replies: 5
    Last Post: 01-02-2014, 08:37 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
  •