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

Commit

Permalink
[general] sync to hd branch without flv
Browse files Browse the repository at this point in the history
  • Loading branch information
myfreeer committed Nov 21, 2016
1 parent 0e71acd commit 1b8c379
Show file tree
Hide file tree
Showing 10 changed files with 1,833 additions and 1,951 deletions.
69 changes: 39 additions & 30 deletions ABPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,45 @@ var ABP = {
* == Licensed Under the MIT License : /LICENSING
* Copyright (c) 2012 Jim Chen ( CQZ, Jabbany )
************************/
function CommentLoader(url,xcm,callback){
if(callback == null)
callback = function(){return;};
var xmlhttp = null;
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}
else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,true);
xmlhttp.send();
var cm = xcm;
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
if(navigator.appName == 'Microsoft Internet Explorer'){
var f = new ActiveXObject("Microsoft.XMLDOM");
f.async = false;
f.loadXML(xmlhttp.responseText);
cm.load(BilibiliParser(f));
callback();
}else{
var standarizedXML = xmlhttp.responseXML == null ? (new window.DOMParser()).parseFromString(xmlhttp.responseText, "text/xml") : xmlhttp.responseXML;
cm.load(BilibiliParser(standarizedXML));
//console.log(standarizedXML);
callback();
}
}
}
function CommentLoader(url, xcm, callback) {
if (callback == null)
callback = function() {
return;
};
var xmlhttp = null;
var retry = 0;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", url, true);
xmlhttp.onerror = function() {
xmlhttp.abort();
if (retry < 3) xmlhttp.send();
retry += 1;
};
xmlhttp.ontimeout = xmlhttp.onerror;
xmlhttp.send();
var cm = xcm;
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
if (navigator.appName == 'Microsoft Internet Explorer') {
var f = new ActiveXObject("Microsoft.XMLDOM");
f.async = false;
f.loadXML(xmlhttp.responseText);
cm.load(BilibiliParser(f));
callback();
} else {
var standarizedXML = xmlhttp.responseXML == null ? (new window.DOMParser()).parseFromString(xmlhttp.responseText, "text/xml") : xmlhttp.responseXML;
cm.load(BilibiliParser(standarizedXML));
//console.log(standarizedXML);
callback();
}
}
}
}

function createCORSRequest(method, url){
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr){
Expand Down Expand Up @@ -595,7 +604,7 @@ return check; }
commentList: null,
commentListContainer: null,
lastSelectedComment: null,
commentCoolDown: 10000,
commentCoolDown: 5000,
commentScale: ABP.playerConfig.scale ? ABP.playerConfig.scale : 1,
proportionalScale: ABP.playerConfig.prop,
defaults: {
Expand Down

0 comments on commit 1b8c379

Please sign in to comment.