Stream Red5流flv文件

Stream Red5流flv文件,stream,flv,red5,Stream,Flv,Red5,我在从Red5检查LADEMO。 我想知道我怎样才能更改oflaDemo,这样我就可以将某个flv文件流式传输给所有订阅者 /** {@inheritDoc} */ @Override public boolean appConnect(IConnection conn, Object[] params) { // Trigger calling of "onBWDone", required for some FLV players measur

我在从Red5检查LADEMO。 我想知道我怎样才能更改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);
    }
上面代码的结果对于所有订阅者来说只是一个空白屏幕

/** {@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);
    }
你们有谁知道吗


提前谢谢

这在客户端更容易实现,如果您不想硬编码流名称,可以将其名称作为flash变量传递。

我也遇到了同样的问题。我发现空白屏幕是因为什么行

serverStream.setRepeat(true);
如果将“重复”设置为false,则所有工作正常

UPD: 我认为这是红色5错误。我试着连续重复一个flv。我添加了自定义播放列表控制器:

public class MyPlayListController implements IPlaylistController {
    @Override
    public int nextItem(IPlaylist playlist, int itemIndex) {
        return 0;
    }

    @Override
    public int previousItem(IPlaylist playlist, int itemIndex) {
        return 0;
    }
}