Exemplo n.º 1
0
 public synchronized void pushMessage(IMessage message) throws IOException {
   if (getState() >= PUBLISHED && message instanceof RTMPMessage) {
     RTMPMessage rtmpMsg = (RTMPMessage) message;
     rtmpClient.publishStreamData(streamId, rtmpMsg);
   } else {
     frameBuffer.add(message);
   }
 }
Exemplo n.º 2
0
 public synchronized void onStreamEvent(Notify notify) {
   ObjectMap<?, ?> map = (ObjectMap<?, ?>) notify.getCall().getArguments()[0];
   String code = (String) map.get("code");
   if (StatusCodes.NS_PUBLISH_START.equals(code)) {
     setState(PUBLISHED);
     while (frameBuffer.size() > 0) {
       rtmpClient.publishStreamData(streamId, frameBuffer.remove(0));
     }
   }
 }