]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
去除buf限制
authorqydysky <qydysky@foxmail.com>
Thu, 10 Jun 2021 18:13:03 +0000 (02:13 +0800)
committerqydysky <qydysky@foxmail.com>
Thu, 10 Jun 2021 18:13:03 +0000 (02:13 +0800)
README.md
Reply/F.go

index 31d54aca2cb2eb1fb2a1bfc0bc9ee812a08bca59..8ae8706c87881ccb3ccaea334c48ec9313e3c9e5 100644 (file)
--- 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/)
 
index ff143471d722ef2aeb6bb574adf0355fa15baef5..6fb5345e38bf1145304f685408258822f49620f1 100644 (file)
@@ -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))