我正在检查 Red5 的 oflaDemo。我想知道如何更改 oflaDemo 以便可以将某个 flv 文件流式传输给所有订阅者...
/** {@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);
}
上面代码的结果对于所有订阅者来说只是一个空白屏幕......
你们有人知道吗?
提前致谢!