mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12579 from jianglong0156/videoplayer
[ci skip]improve Videoplayer test
This commit is contained in:
commit
b9a6e8c051
|
@ -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(){
|
||||
|
|
Loading…
Reference in New Issue