Skip to content

How to get video length with Pixijs v8 #10547

Closed Answered by ASoldo
ASoldo asked this question in v8 General
Discussion options

You must be logged in to vote

this is what I did and now it works:

async init(): Promise<void> {
    console.log("Initializing Game: ", this.name);
    this.loaded = false;

    // Load the video texture
    this.texture = await PIXI.Assets.load({
      src: "https://pixijs.com/assets/video.mp4",
      data: {
        muted: true,
      },
      type: "video",
    });

    // Create a PIXI sprite using the video texture
    this.videoSprite = new PIXI.Sprite(this.texture);
    this.videoSprite.position.set(0, 0);
    this.videoSprite.width = this.app.screen.width;
    this.videoSprite.height = this.app.screen.height;
    this.app.stage.addChild(this.videoSprite);

    // Example of how to pause the video
    // (this.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ASoldo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant