From 16f18f38ec2cfc6dad0623f6747150818b3d2998 Mon Sep 17 00:00:00 2001 From: qydysky Date: Fri, 11 Jun 2021 02:13:03 +0800 Subject: [PATCH] =?utf8?q?=E5=8E=BB=E9=99=A4buf=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- README.md | 1 + Reply/F.go | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 31d54ac..8ae8706 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ I: 2021/04/13 20:07:45 命令行操作 [直播Web服务: http://192.168.31.245:3 - [xqq/mpegts.js](https://github.com/xqq/mpegts.js) - [bilibili/flv.js](https://github.com/bilibili/flv.js) - [bytedance/xgplayer](https://github.com/bytedance/xgplayer) +- [videojs/video.js](https://github.com/videojs/video.js)([demo](https://videojs-http-streaming.netlify.app)) - [video-dev/hls.js@v1.0.7+](https://hls-js-10780deb-25d8-41d3-b164-bc334c8dd47f.netlify.app/demo/) - [mpv](https://mpv.io/) diff --git a/Reply/F.go b/Reply/F.go index ff14347..6fb5345 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -2143,19 +2143,13 @@ func init() { } defer f.Close() - b := make([]byte,1<<20) - if n,e := f.Read(b);e != nil { + if b,e := io.ReadAll(f);e != nil { flog.L(`E: `,e) w.Header().Set("Retry-After", "1") w.WriteHeader(http.StatusServiceUnavailable) return - } else if n == 1<<20 { - flog.L(`W: `,`buf limit`) - w.Header().Set("Retry-After", "1") - w.WriteHeader(http.StatusServiceUnavailable) - return } else { - buf = b[:n] + buf = b m4s_cache.Store(path,buf) go func(){//移除 time.Sleep(time.Second*time.Duration(savestream.m4s_hls+1)) -- 2.39.2