Merge pull request #12579 from jianglong0156/videoplayer

[ci skip]improve Videoplayer test
This commit is contained in:
pandamicro 2015-06-29 10:19:08 +08:00
commit b9a6e8c051
1 changed files with 13 additions and 2 deletions

View File

@ -23,6 +23,10 @@ var UIVideoPlayerTest = UIScene.extend({
cc.log("VideoPlayer COMPLETED");
});
var playState = new cc.LabelTTF("PLAY State", "Thonburi", 28);
playState.setPosition(400, 350);
this.addChild(playState);
ccui.VideoPlayer.EventType = {
PLAYING: "play",
PAUSED: "pause",
@ -30,26 +34,31 @@ var UIVideoPlayerTest = UIScene.extend({
COMPLETED: "complete"
};
var list = [
{ name: "PLAYWEB", func: function(){
{ name: "PLAYURL", func: function(){
cc.log("play!");
playState.setString("play");
video.setURL("http://benchmark.cocos2d-x.org/cocosvideo.mp4");
video.play();
}},
{ name: "PLAYNATIVE", func: function(){
{ name: "PLAYLOCAL", func: function(){
cc.log("play!");
playState.setString("play");
video.setURL("cocosvideo.mp4");
video.play();
}},
{ name: "STOP", func: function(){
cc.log("stop!");
playState.setString("stop");
video.stop();
}},
{ name: "PAUSE", func: function(){
cc.log("pause!");
playState.setString("pause");
video.pause();
}},
{ name: "RESUME", func: function(){
cc.log("resume!");
playState.setString("resume");
video.resume();
}},
{ name: "SEEKTO", func: function(){
@ -59,10 +68,12 @@ var UIVideoPlayerTest = UIScene.extend({
}},
{ name: "ISPLAYING", func: function(){
cc.log("isPlaying!");
playState.setString("isPlaying");
cc.log(video.isPlaying());
}},
{ name: "Full Screen", func: function(){
cc.log("setFullScreenEnabled!");
playState.setString("setFullScreenEnabled");
video.setFullScreenEnabled(true);
}},
{ name: "Scale", func: function(){