dacatchman Posted September 9, 2019 Share Posted September 9, 2019 So older pixi had a movieclip, but newer docs show to use AnimatedSprite. Problem is, the construct an animated sprite we need an array of textures. However, all the demos for v4 and v5 for video are just PIXI.Texture.from('path/to/video') and it makes a new texture/sprite each time the video would play. I'm interested in using the animatedSprite loop/gotoAndPlay methods because I'm trying to show videos on demand. Any ideas? I'm quite new to PIXI so it's innards and how to get like, the frames of a Texture and such, are a mystery to me. Thanks! Quote Link to comment Share on other sites More sharing options...
dacatchman Posted September 9, 2019 Author Share Posted September 9, 2019 Okay, small update. I figured that I could access the HTML video object directly by going down the object chain, which I can, ie: mySpriteVideo._texture.baseTexture.source.play(); Generally we treat _variables as private, so it feels wrong to do it this way; any other ideas? This can't be what the developers of PIXI intended? Any reason we can't get a PIXI.Video with frame control on it? Quote Link to comment Share on other sites More sharing options...
jonforum Posted September 9, 2019 Share Posted September 9, 2019 create a variable videoControler, and ref the baseTexture.source, you should have access to what you want for control the video , also add custom update. create_IntroVideo () { const videoSprite = new PIXI.Sprite( PIXI.Texture.fromVideo( $loader.DATA2.vidA1.data ) ); const videoControler = videoSprite.texture.baseTexture.source; //videoSprite.anchor.set(0.5,1) //videoSprite.width = 1920; //videoSprite.height = 1080; // videoControler.currentTime = 11; //temp jump to end //videoControler.onended = () => { // // $stage.goto('Scene_Title'); //} you have the full api herehttps://www.w3schools.com/tags/ref_av_dom.asp Quote Link to comment Share on other sites More sharing options...
dacatchman Posted September 10, 2019 Author Share Posted September 10, 2019 Thanks for the reply. In Chrome v76, I am getting this randomly when using videos: Quote WebGL: INVALID_VALUE: tex(Sub)Image2D: video visible size is empty Sometimes it happens, sometimes it doesn't. Just sitting there refreshing the page sometimes the video plays and other times I get those errors in the console and no video. Any ideas? Quote Link to comment Share on other sites More sharing options...
jonforum Posted September 13, 2019 Share Posted September 13, 2019 that's mean you not finish load the video. You need load the video before in a loader. If i remember, when video not finish load and you try create sprite, size will be 0. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 13, 2019 Share Posted September 13, 2019 AnimatedSprite and videos aren't compatible. One is a sequence of textures, maybe packed with texturePacker. Another is an html <video> streaming to texture, and it gives you much less control and more problems. As for chrome v76, we made a fix for that: https://github.com/pixijs/pixi.js/pull/6088 , here's the build: pixijs.download/fix-video-performance/pixi.js Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.