轉載自github:https://github.com/bilibili/flv.js/pull/448/files
,
防止丟失記錄,要修改源碼:git
@@ -117,6 +117,12 @@ class FetchStreamLoader extends BaseLoader { params.referrerPolicy \= dataSource.referrerPolicy; } // add abort controller, by wmlgl 2019-5-10 12:21:27 if (self.AbortController) { this.\_abortController \= new self.AbortController(); params.signal \= this.\_abortController.signal; } this.\_status \= LoaderStatus.kConnecting; self.fetch(seekConfig.url, params).then((res) \=> { if (this.\_requestAbort) { [](https://github.com/bilibili/flv.js/pull/448/files#diff-2236408d6aad747aed1a901e3aac73fe "Expand Down")[](https://github.com/bilibili/flv.js/pull/448/files#diff-2236408d6aad747aed1a901e3aac73fe "Expand Up") @@ -152,6 +158,10 @@ class FetchStreamLoader extends BaseLoader { } } }).catch((e) \=> { if (this.\_abortController && this.\_abortController.signal.aborted) { return; } this.\_status \= LoaderStatus.kError; if (this.\_onError) { this.\_onError(LoaderErrors.EXCEPTION, {code: \-1, msg: e.message}); [](https://github.com/bilibili/flv.js/pull/448/files#diff-2236408d6aad747aed1a901e3aac73fe "Expand All") @@ -163,6 +173,10 @@ class FetchStreamLoader extends BaseLoader { abort() { this.\_requestAbort \= true; if (this.\_abortController) { this.\_abortController.abort(); } } \_pump(reader) { // ReadableStreamReader
相關評論:
github