Examples of IBroadcastScope


Examples of org.red5.server.api.scope.IBroadcastScope

    String publishName = rc.getStreamPublishName();
   
    if (rc.getIsScreenClient() && rc.isStartStreaming()) {
          IScope scope = conn.getScope();
          IBroadcastStream stream = getBroadcastStream(scope, publishName);
          IBroadcastScope bsScope = getBroadcastScope(scope, publishName);
          final StreamingProxy proxy = new StreamingProxy();
          proxy.setHost(host);
          proxy.setApp(app);
          proxy.setPort(1935);
          proxy.init();
          proxy.setExceptionHandler(new ClientExceptionHandler() {
        public void handleException(Throwable throwable) {
          result[0] = false;
          HashMap<String, Object> params = new HashMap<String, Object>();
          params.put("stopPublishing", true);
          params.put("error", throwable.getMessage());
          ((IServiceCapableConnection)conn).invoke(
            "screenSharerAction"
            , new Object[] { params }
            , ScopeApplicationAdapter.this);
        }
      });
          bsScope.subscribe(proxy, null);
          proxy.start(id, "live", null);
          streamingProxyMap.put(publishName, proxy);
          stream.addStreamListener(new IStreamListener() {
        public void packetReceived(IBroadcastStream stream, IStreamPacket packet) {
          try {
View Full Code Here

Examples of org.red5.server.api.scope.IBroadcastScope

          IScope scope = current.getScope();
          IBroadcastStream stream = getBroadcastStream(scope, publishName);
      StreamingProxy proxy = streamingProxyMap.remove(publishName);
      if (proxy != null) {
        proxy.stop();
        IBroadcastScope bsScope = getBroadcastScope(scope, stream.getPublishedName());
        if (bsScope != null) {
          bsScope.unsubscribe(proxy);
        }
      }
    }
    }
View Full Code Here

Examples of org.red5.server.stream.IBroadcastScope

    IStreamService service = (IStreamService) getScopeService(scope,
        IStreamService.class, StreamService.class);
    if (!(service instanceof StreamService))
      return null;
   
    IBroadcastScope bs = ((StreamService) service).getBroadcastScope(scope,
        name);
    return (IClientBroadcastStream) bs
        .getAttribute(IBroadcastScope.STREAM_ATTRIBUTE);
  }
View Full Code Here

Examples of org.red5.server.stream.IBroadcastScope

  protected void onChunkSize(RTMPConnection conn, Channel channel,
      Header source, ChunkSize chunkSize) {
    for (IClientStream stream : conn.getStreams()) {
      if (stream instanceof IClientBroadcastStream) {
        IClientBroadcastStream bs = (IClientBroadcastStream) stream;
        IBroadcastScope scope = (IBroadcastScope) bs.getScope()
            .getBasicScope(IBroadcastScope.TYPE,
                bs.getPublishedName());
        if (scope == null) {
          continue;
        }

        OOBControlMessage setChunkSize = new OOBControlMessage();
        setChunkSize.setTarget("ClientBroadcastStream");
        setChunkSize.setServiceName("chunkSize");
        if (setChunkSize.getServiceParamMap() == null) {
          setChunkSize.setServiceParamMap(new HashMap());
        }
        setChunkSize.getServiceParamMap().put("chunkSize",
            chunkSize.getSize());
        scope.sendOOBControlMessage((IConsumer) null, setChunkSize);
        if (log.isDebugEnabled()) {
          log.debug("Sending chunksize " + chunkSize + " to "
              + bs.getProvider());
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.