mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -08:00
update
This commit is contained in:
1 parent
ca9fa0981b
commit
f58684991f
12 files changed
+155
-155
No files matched your search
+11
-2
@@ -1,4 +1,5 @@
|
||||
import { errorHandle, request, getExt } from './utils';
|
||||
import ArtPlayerError from './utils/ArtPlayerError';
|
||||
import { errorHandle, getExt } from './utils';
|
||||
import config from './config';
|
||||
|
||||
export default class Mse {
|
||||
@@ -93,7 +94,7 @@ export default class Mse {
|
||||
fetchUrl() {
|
||||
const { option: { url }, notice, i18n, loading } = this.art;
|
||||
this.art.emit('player:fetch:start', url);
|
||||
request(url)
|
||||
this.request(url)
|
||||
.then(response => {
|
||||
this.sourceBuffer.appendBuffer(response);
|
||||
this.art.emit('player:fetch:success', url);
|
||||
@@ -109,4 +110,12 @@ export default class Mse {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
request(url) {
|
||||
return fetch(url)
|
||||
.then(response => response.arrayBuffer())
|
||||
.catch(err => {
|
||||
throw new ArtPlayerError(err.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user