Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
[html5] switch to lower quality on error
Browse files Browse the repository at this point in the history
  • Loading branch information
myfreeer committed Dec 8, 2016
1 parent 65790e9 commit 3fe6e73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bilibili_injected.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@
//flv.playUrl(location.href);
biliHelper.switcher.flvPlayer.attachMediaElement(abp.video);
biliHelper.switcher.flvPlayer.load();
biliHelper.switcher.flvPlayer.on(flvjs.Events.ERROR, e => console.warn(e, 'Switch back to HTML5 HD.', biliHelper.switcher.html5hd()));
//biliHelper.switcher.flvPlayer.play();
}
}, 600);
Expand All @@ -717,6 +718,7 @@
comments = comments ? comments : biliHelper.commentsXML ? biliHelper.commentsXML : biliHelper.commentsUrl ? biliHelper.commentsUrl : 'http://comment.bilibili.com/' + biliHelper.cid + '.xml';
this.set('html5hd');
var abp = biliHelper.switcher.html5('html5hd',comments);
abp.video.querySelector('source').addEventListener('error', e=>console.warn(e, 'Switch back to HTML5 LD.', biliHelper.switcher.html5ld()));
},
html5ld: function(comments) {
comments = comments ? comments : biliHelper.commentsXML ? biliHelper.commentsXML : biliHelper.commentsUrl ? biliHelper.commentsUrl : 'http://comment.bilibili.com/' + biliHelper.cid + '.xml';
Expand Down

0 comments on commit 3fe6e73

Please sign in to comment.