Nagaraju Posted September 30, 2019 Share Posted September 30, 2019 Hello, I am working on playing videos in PIXI js using VideoBaseTexture . I need to call a method once video ends. I could not find any possible solution in PIXI docs.? Please help me !!! Thanks in advance Quote Link to comment Share on other sites More sharing options...
jonforum Posted September 30, 2019 Share Posted September 30, 2019 it stored in duration.https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/duration Quote Link to comment Share on other sites More sharing options...
Nagaraju Posted September 30, 2019 Author Share Posted September 30, 2019 Thanks for the reply. I could not able to load video element on canvas. I am using below code. <div ref="imageSlide"> </div> var video = document.createElement("video"); video.id = "videoPixi"; video.crossOrigin="anonymous"; video.src = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"; document.body.appendChild(video); var video = document.querySelector("#videoPixi"); var basetx = new PIXI.BaseTexture.from(video); this.videoTexture = PIXI.Texture.from(basetx);//(this.screenData.background.video.currentUrl); var videoSprite = new PIXI.Sprite(this.videoTexture); videoSprite.width = videoWidth; videoSprite.height = videoHeight; this.addChild(videoSprite); I am getting an error as it is showing in the attachments Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 30, 2019 Share Posted September 30, 2019 use "new PIXI.Texture(baseTex)" or "PIXI.Texture.from(video)". I know, its not clear which things you can put to "from". We added as many as possible but we didnt think that someone will try to make texture of baseTexture Its our default constructor variant. Quote Link to comment Share on other sites More sharing options...
Nagaraju Posted September 30, 2019 Author Share Posted September 30, 2019 Thanks for the quick reply. Working great. I can able to get video duration too...✌️ 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.