Jump to content

Video sprite not showing up


Haon1919
 Share

Recommended Posts

Hello friends, so when I am trying to add a video to the background of a scene along with various other objects. For some reason if I use an image and add it to the container then allow the code to execute everything shows up correctly. But when I make the video sprite and attempt to add it to that same container I get the buttons on the screen showing up fine with a black background. I am insure what I am doing wrong.

 

-thanks in advance for the help!

Screen Shot 2018-09-18 at 2.55.18 PM.png

Link to comment
Share on other sites

@ivan.popelyshev

 

So I eventually was able to get something to show up. I changed the videoTexture line to be what I had below and the very first frame is showing now. I am assuming there is some autoplay boolean or method of the texture object that I can use?

var videoTexture = PIXI.Texture.fromVideo(PIXI.loader.resources['resources/videos/start_screen_test_8.mp4'].data);
Link to comment
Share on other sites

6 hours ago, Haon1919 said:

@ivan.popelyshev

 

So I eventually was able to get something to show up. I changed the videoTexture line to be what I had below and the very first frame is showing now. I am assuming there is some autoplay boolean or method of the texture object that I can use?

var videoTexture = PIXI.Texture.fromVideo(PIXI.loader.resources['resources/videos/start_screen_test_8.mp4'].data);

hi , i remember get some issue with video loader and first frame freezing.
By default the autoPlay is alway force to true.
 

here a good way to create a video controler

    const texture = PIXI.Texture.fromVideo('data2/Video/intro/vidA1.webm');
    const videoSprite = new PIXI.Sprite(texture);
    const videoControler = texture.baseTexture.source;

    videoSprite.width = 1920;
    videoSprite.height = 1080;

    videoControler.currentTime = 12.2;
    videoControler.onended = function(){
        this.nextVideo();
    }.bind(this);

    this.addChild(videoSprite);
    this.videoControler = videoControler;

 

and to start video

Scene_IntroVideo.prototype.start = function() {
    Scene_Base.prototype.start.call(this);
    this.videoControler.play();
};

if you have issue, try hack PIXI to force autoplay to the default source autoPlay

https://github.com/pixijs/pixi.js/pull/5112/commits/e2a5836ecfbd86e2115f3a44212b63a45101a5f0

It work for me 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...