mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
add more event
This commit is contained in:
1 parent
b2159e7d4d
commit
506b34522b
14 files changed
+202
-77
No files matched your search
+5
-2
@@ -91,10 +91,12 @@ export default class Mse {
|
||||
}
|
||||
|
||||
fetchUrl() {
|
||||
const { option, notice, i18n, loading } = this.art;
|
||||
request(option.url)
|
||||
const { option: { url }, notice, i18n, loading } = this.art;
|
||||
this.art.emit('player:fetch:start', url);
|
||||
request(url)
|
||||
.then(response => {
|
||||
this.sourceBuffer.appendBuffer(response);
|
||||
this.art.emit('player:fetch:success', url);
|
||||
})
|
||||
.catch(err => {
|
||||
if (this.repeat++ < this.maxRepeat) {
|
||||
@@ -103,6 +105,7 @@ export default class Mse {
|
||||
notice.show(i18n.get('Video load failed'));
|
||||
console.warn(err);
|
||||
loading.hide();
|
||||
this.art.emit('player:fetch:failure', url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user