I think we can add TouchEvent Listener to the VideoPlayer references the document http://www.cocos2d-x.org/reference/native-cpp/V3.3rc0/d5/d18/classcocos2d_1_1experimental_1_1ui_1_1_video_player.html
I added a touchListerner to the VideoPlayer,but It does not work.
1 Like
Can someone please answer this question? The following should log “touched!” every time the video widget is touched but nothing happens. It’s really frustrating to implement something so simple.
var video = new ccui.VideoPlayer();
video.setContentSize(new cc.Size(size.width/2, size.height/2));
video.setAnchorPoint(cc.p(0.5,0.5));
video.setPosition(cc.p(size.width / 2, size.height / 2));
video.setTouchEnabled(true);
video.setURL(res.video_mp4);
video.addTouchEventListener(function(){console.log("touched!")}, this);
1 Like