Dan Rossi wrote:
hi there, ive been trying to work out how to notify a currently subscribed client if a live broadcast is available or not when they connect. I have a method to invoke currently connected clients that a show has started with this code, when publishing in record mode i had to make a patch to some code to be able to get the published name as referenced on trac.Hi im still trying to work out how to invoke a method on just the connected subscribed client if i used this public void streamSubscriberStart(ISubscriberStream stream) { IConnection conn = Red5.getConnectionLocal(); Object[] streams = getStreams().toArray(); String streamName = streams[0].toString(); if (hasBroadcastStream(conn.getScope(), streams[0].toString())) { log.info("Connecting to live stream: " + streamName); if (conn instanceof IServiceCapableConnection) { ((IServiceCapableConnection) conn.getClient()).invoke("onBroadcast", new Object[]{streamName}, this); log.info("sending notification to "+conn); } } } I get an exception of a classcast error any ideas ? [ERROR] 1193112 IoWorker-4:( PlaylistSubscriberStream.error ) error notify streamSubscriberStart java.lang.ClassCastException: org.red5.server.Client at com.pistolmedia.CamApplication.streamSubscriberStart(CamApplication.java:220) at org.red5.server.stream.PlaylistSubscriberStream.notifySubscriberStart(PlaylistSubscriberStream.java:360) at org.red5.server.stream.PlaylistSubscriberStream.start(PlaylistSubscriberStream.java:104) at org.red5.server.stream.StreamService.play(StreamService.java:128) at org.red5.server.stream.StreamService.play(StreamService.java:161) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.red5.server.service.ServiceInvoker.invoke(ServiceInvoker.java:143) at org.red5.server.net.rtmp.RTMPHandler.invokeCall(RTMPHandler.java:250) at org.red5.server.net.rtmp.RTMPHandler.onInvoke(RTMPHandler.java:393) at org.red5.server.net.rtmp.RTMPHandler.messageReceived(RTMPHandler.java:140) at org.red5.server.net.rtmp.RTMPMinaIoHandler.messageReceived(RTMPMinaIoHandler.java:68) at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(AbstractIoFilterChain.java:188) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:501) at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:51) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:787) at org.apache.mina.filter.ThreadPoolFilter.processEvent(ThreadPoolFilter.java:718) at org.apache.mina.filter.ThreadPoolFilter$Worker.processEvents(ThreadPoolFilter.java:474) at org.apache.mina.filter.ThreadPoolFilter$Worker.run(ThreadPoolFilter.java:429) |
_______________________________________________ Red5 mailing list [email protected] http://osflash.org/mailman/listinfo/red5_osflash.org
