tags:

views:

864

answers:

1

Hi everybody

I was inspecting the oflaDemo from Red5. I was wondering how I could change the oflaDemo so that I could stream a certain flv file to all the subscribers...

/** {@inheritDoc} */
    @Override
    public boolean appConnect(IConnection conn, Object[] params) {
     // Trigger calling of "onBWDone", required for some FLV players
     measureBandwidth(conn);
     if (conn instanceof IStreamCapableConnection) {
      IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
      SimpleConnectionBWConfig bwConfig = new SimpleConnectionBWConfig();
      bwConfig.getChannelBandwidth()[IBandwidthConfigure.OVERALL_CHANNEL] =
       1024 * 1024;
      bwConfig.getChannelInitialBurst()[IBandwidthConfigure.OVERALL_CHANNEL] =
       128 * 1024;
      streamConn.setBandwidthConfigure(bwConfig);
     }

      serverStream = StreamUtils.createServerStream(appScope, "live0");
      SimplePlayItem item = new SimplePlayItem();
      item.setStart(0);
      item.setLength(10000);
      item.setName("IronMan");
      serverStream.addItem(item);
      item = new SimplePlayItem();
      item.setStart(20000);
      item.setLength(10000);
      item.setName("DarkKnight");
      serverStream.addItem(item);
      serverStream.start();
      serverStream.setRepeat(true);

     return super.appConnect(conn, params);
    }

The result of the code above is just a blank screen for all subscribers...

Does anyone of you have any idea?

thanks in advance!

A: 

This would be easier to accomplish on the client side and if you didn't want to hard-code the stream name, you could pass its name as a flash var.

Mondain