ccui.VideoPlayer on html?


#1

Hi,

I have this code to play a video:

            var video = new ccui.VideoPlayer();
            video.setContentSize(cc.size(960,540));
            video.setPosition(cc.grid.getVisibleCentre());
            this.addChild(video, TD.groundPlace.AboveAll);
            video.setURL(TD.webURL.introVideo);
            video.setScale(0.8);
            video.setEventListener(ccui.VideoPlayer.EventType.PLAYING, function(sender){
                cc.log("VideoPlayer PLAYING");
            });
            video.setEventListener(ccui.VideoPlayer.EventType.PAUSED, function(sender){
                cc.log("VideoPlayer PAUSED");
            });
            video.setEventListener(ccui.VideoPlayer.EventType.STOPPED, function(sender){
                cc.log("VideoPlayer STOPPED");
            });
            video.setEventListener(ccui.VideoPlayer.EventType.COMPLETED, function(sender){
                cc.log("VideoPlayer COMPLETED");
                video.removeFromParent();
            });

            setTimeout(function () {
                video.play();
            }, 2000); // Wait 2 seconds before starting to play.

Works great on desktop, but on Android chrome web it display the first frame and stops. I don’t know how to figure out why? Can anyone help???