mirror of https://github.com/axmolengine/axmol.git
commit
9dc52ba72f
|
@ -53,7 +53,7 @@ var UIVideoPlayerTest = UIScene.extend({
|
|||
video.resume();
|
||||
}},
|
||||
{ name: "SEEKTO", func: function(){
|
||||
var sec = ((Math.random() * 3) * 100 | 0) / 100;
|
||||
var sec = ((Math.random() * 59) * 100 | 0) / 100;
|
||||
cc.log("seekTo %f sec!", sec);
|
||||
video.seekTo(sec);
|
||||
}},
|
||||
|
|
|
@ -104,10 +104,13 @@ var XHRTestLayer = cc.Layer.extend({
|
|||
// 5 seconds for timeout
|
||||
xhr.timeout = 5000;
|
||||
|
||||
xhr.setRequestHeader("Accept-Encoding","gzip,deflate");
|
||||
|
||||
//set arguments with <URL>?xxx=xxx&yyy=yyy
|
||||
xhr.open("GET", "http://geek.csdn.net/news/detail/33683", true);
|
||||
if(cc.sys.isNative){
|
||||
xhr.open("GET", "http://geek.csdn.net/news/detail/33683", true);
|
||||
}else{
|
||||
xhr.open("GET", "http://httpbin.org/get?show_env=1", true);
|
||||
}
|
||||
xhr.setRequestHeader("Accept-Encoding","gzip,deflate");
|
||||
|
||||
xhr.send();
|
||||
},
|
||||
|
@ -127,7 +130,7 @@ var XHRTestLayer = cc.Layer.extend({
|
|||
ensureLeftAligned(responseLabel);
|
||||
responseLabel.x = winSize.width / 10 * 3;
|
||||
responseLabel.y = winSize.height / 2;
|
||||
|
||||
|
||||
var xhr = cc.loader.getXMLHttpRequest();
|
||||
streamXHREventsToLabel(xhr, statusPostLabel, responseLabel, "POST");
|
||||
|
||||
|
|
Loading…
Reference in New Issue