PuzzleSDK
UIVideoPlayerTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
3
4 http://www.cocos2d-x.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE SOFTWARE.
23 ****************************************************************************/
24
25#ifndef __tests__VideoPlayerTest__
26#define __tests__VideoPlayerTest__
27
28#include "../UIScene.h"
29
30DEFINE_TEST_SUITE(VideoPlayerTests);
31
33{
34public:
36
37 virtual bool init() override;
38
39 void menuCloseCallback(cocos2d::Ref* sender);
40
41 void menuRatioCallback(cocos2d::Ref* sender);
42 void menuResourceVideoCallback(cocos2d::Ref* sender);
43 void menuOnlineVideoCallback(cocos2d::Ref* sender);
44
45 void menuFullScreenCallback(cocos2d::Ref* sender);
46 void menuPauseCallback(cocos2d::Ref* sender);
47 void menuResumeCallback(cocos2d::Ref* sender);
48 void menuStopCallback(cocos2d::Ref* sender);
49 void menuHintCallback(cocos2d::Ref* sender);
50 void menuLoopCallback(cocos2d::Ref* sender);
51
52 void sliderCallback(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType eventType);
53
54 void videoEventCallback(cocos2d::Ref* sender, cocos2d::ui::VideoPlayer::EventType eventType);
55
56private:
57 void createVideo();
58 void createSlider();
59
60 cocos2d::ui::VideoPlayer* _videoPlayer;
61 cocos2d::Label* _videoStateLabel;
62 cocos2d::Label* _loopStatusLabel;
63 cocos2d::Rect _visibleRect;
64};
65
66
68{
69public:
71
73
74 virtual bool init() override;
75
76 void menuCloseCallback(cocos2d::Ref* sender);
77 void switchStyleCallback(cocos2d::Ref* sender);
78 void switchUserInputCallback(cocos2d::Ref* sender);
79
80private:
81 void createVideo();
82
83 cocos2d::Rect _visibleRect;
84 cocos2d::ui::VideoPlayer* _videoPlayer;
85
86 cocos2d::MenuItemFont* _switchUserInputEnabled;
87 cocos2d::MenuItemFont* _switchStyle;
88
89
91 cocos2d::ui::VideoPlayer::StyleType _style;
92
93 void updateButtonsTexts();
94};
95
96
97#endif // __tests__VideoPlayerTest__
DEFINE_TEST_SUITE(VideoPlayerTests)
void menuCloseCallback(cocos2d::Ref *sender)
cocos2d::ui::VideoPlayer::StyleType _style
cocos2d::MenuItemFont * _switchUserInputEnabled
cocos2d::MenuItemFont * _switchStyle
cocos2d::ui::VideoPlayer * _videoPlayer
virtual bool init() override
void switchStyleCallback(cocos2d::Ref *sender)
CREATE_FUNC(SimpleVideoPlayerTest)
void switchUserInputCallback(cocos2d::Ref *sender)
cocos2d::Rect _visibleRect
void menuStopCallback(cocos2d::Ref *sender)
void videoEventCallback(cocos2d::Ref *sender, cocos2d::ui::VideoPlayer::EventType eventType)
cocos2d::Rect _visibleRect
cocos2d::ui::VideoPlayer * _videoPlayer
void sliderCallback(cocos2d::Ref *sender, cocos2d::ui::Slider::EventType eventType)
void menuCloseCallback(cocos2d::Ref *sender)
cocos2d::Label * _loopStatusLabel
CREATE_FUNC(VideoPlayerTest)
virtual bool init() override
void menuFullScreenCallback(cocos2d::Ref *sender)
void menuOnlineVideoCallback(cocos2d::Ref *sender)
void menuRatioCallback(cocos2d::Ref *sender)
cocos2d::Label * _videoStateLabel
void menuLoopCallback(cocos2d::Ref *sender)
void menuPauseCallback(cocos2d::Ref *sender)
void menuResumeCallback(cocos2d::Ref *sender)
void menuResourceVideoCallback(cocos2d::Ref *sender)
void menuHintCallback(cocos2d::Ref *sender)