File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ bool VideoPlayerTest::init()
43
43
44
44
_visibleRect = Director::getInstance ()->getOpenGLView ()->getVisibleRect ();
45
45
46
+ // Should create video first to make sure video is destryed first. If not, then may crash.
47
+ // Because when destroying video, it will stop video which may trigger stopped event listener.
48
+ createVideo ();
49
+
46
50
MenuItemFont::setFontSize (16 );
47
51
48
52
auto fullSwitch = MenuItemFont::create (" FullScreenSwitch" , CC_CALLBACK_1 (VideoPlayerTest::menuFullScreenCallback, this ));
@@ -95,8 +99,6 @@ bool VideoPlayerTest::init()
95
99
_loopStatusLabel->setAnchorPoint (Vec2::ANCHOR_MIDDLE_RIGHT);
96
100
_loopStatusLabel->setPosition (Vec2 (_visibleRect.origin .x + _visibleRect.size .width - 10 ,_visibleRect.origin .y + 185 ));
97
101
_uiLayer->addChild (_loopStatusLabel);
98
-
99
- createVideo ();
100
102
101
103
return true ;
102
104
}
You can’t perform that action at this time.
0 commit comments