在 Web 直播中比较流行的是通过 http-chunked 模式来实现直播。而 http-chunked 协议很难得到具体播放的进度,那我们就需要一个能够很容易获得播放进度的协议--切片协议。 入门 Tip 事情需要一点一点做,饭需要一口一口的吃,DASH 由于协议比较复杂,推荐大家先从 HTTP-Chunked 协议入手,自己先搭建一个直播的 DEMO 试试水,这里推荐一下 HTTPLIVE
65535)); // ChunkedWriteHandler:向客户端发送HTML5文件 ctx.pipeline().addBefore("byteToBuf","http-chunked
65535)); // ChunkedWriteHandler:向客户端发送HTML5文件 ctx.pipeline().addBefore("byteToBuf","http-chunked
pipeline.addLast("aggregator", new HttpObjectAggregator(65535)); pipeline.addLast("http-chunked
HttpResponseEncoder()); // 支持异步发送大的码流(大的文件传输),但不占用过多的内存,防止java内存溢出 ch.pipeline().addLast("http-chunked
e.pipeline().addLast("aggregator", new HttpObjectAggregator(65536)); e.pipeline().addLast("http-chunked
.addLast("http-encoder", new HttpResponseEncoder()) .addLast("http-chunked .addLast("aggregator", new HttpObjectAggregator(65536)) .addLast("http-chunked
aggregator",new HttpObjectAggregator(65536)); // ChunkedWriteHandler:向客户端发送HTML5文件 e.pipeline().addLast("http-chunked
// 向客户端发送h5文件,主要是来支持websocket通信 pipeline.addLast("http-chunked
// 向客户端发送h5文件,主要是来支持websocket通信 pipeline.addLast("http-chunked
newHttpObjectAggregator(65536));// 向客户端发送h5文件,主要是来支持websocket通信 pipeline.addLast("http-chunked
channel.pipeline().addLast("aggregator", new HttpObjectAggregator(65536)); channel.pipeline().addLast("http-chunked
channel.pipeline().addLast("aggregator", new HttpObjectAggregator(65536)); channel.pipeline().addLast("http-chunked
channel.pipeline().addLast("aggregator", new HttpObjectAggregator(65536)); channel.pipeline().addLast("http-chunked
String HTTP_CODEC = "http-codec"; String AGGREGATOR = "aggregator"; String HTTP_CHUNKED = "http-chunked