RPG Maker MV Error in video playing from javascript

213 views Asked by At

I have a plugin that loads a video from string in a texture for then add to sprite and in turn to scene. The problem comes when i play the video from code, this only show a black screen and the game continues with normality. If i don't play the video this just show the first frame. Here is my code:

Scene_Splash.prototype.createSplashes = function() {

    // Selected is an image?
    if(Plg_mang.SplashScreen.SplashType.toUpperCase().includes("IMAGE")){
        this._mvSplash = new Sprite(ImageManager.loadNormalBitmap(Plg_mang.SplashScreen.SplImage));
    }else{

        // Selected is video then: Create a texture for a video)
        var video_texture = PIXI.Texture.fromVideo(Plg_mang.SplashScreen.SplImage);
        this._mvSplash = new PIXI.Sprite(video_texture);

        // Play video
        this._mvSplash.texture.baseTexture.source.play();
    }


    // Add to scene            
    this.addChild(this._mvSplash);
};
1

There are 1 answers

0
The rigjh On

Well i found the solution:

The code can be replaced by:

        Graphics.playVideo(Plg_mang.SplashScreen.SplImage);

No need to add a new element to the scene, just do this