3 Commits

Author SHA1 Message Date
b1fb8b0866 Update README.md for release v1.0.0 2021-05-30 11:14:56 +08:00
b0d903a096 delete test.html 2021-05-30 11:11:55 +08:00
3c6552e480 Merge branch 'no-dialog' 2021-05-30 02:53:04 +08:00
3 changed files with 4 additions and 38 deletions

View File

@@ -52,6 +52,10 @@ Fork from `msw-file`,目前是一个音乐播放器。
临时文件夹管理器位于 `internal/pkg/tmpfs` 中,默认删除时间是 10 分钟。10分钟内如果没有对该临时文件的访问则会删除此临时文件。 临时文件夹管理器位于 `internal/pkg/tmpfs` 中,默认删除时间是 10 分钟。10分钟内如果没有对该临时文件的访问则会删除此临时文件。
## Change log
- `v1.0.0` 首个版本
## 后端 API 文档 ## 后端 API 文档
说明中带有 `stream``流` 相关字样的,说明该 API 以 `io.Copy` 方式传输文件,不支持断点续传 说明中带有 `stream``流` 相关字样的,说明该 API 以 `io.Copy` 方式传输文件,不支持断点续传

BIN
demo1.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -1,38 +0,0 @@
<html>
<body>
<h1>title</h1>
<audio id="player" autoplay controls></audio>
</body>
</html>
<script>
var video = document.getElementById("player")
var url = "/api/v1/get_file_stream?id=38508&config=0. OPUS 128k"
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "arraybuffer";
xhr.onload = function (oEvent) {
var blob = new Blob([oEvent.target.response]);
video.src = URL.createObjectURL(blob);
//video.play() if you want it to play on load
};
xhr.onprogress = function (oEvent) {
console.log(oEvent.loaded)
if (oEvent.lengthComputable) {
var percentComplete = oEvent.loaded / oEvent.total;
// do something with this
console.log(percentComplete);
}
}
xhr.send();
</script>