You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting displayOrigin on a Video that is loaded with its loadURL function, it does not show up. It works if the video is loaded via key, or if setOrigin is used instead.
varconfig={type: Phaser.AUTO,width: 800,height: 600,backgroundColor: '#2d2d2d',parent: 'phaser-example',scene: {preload: preload,create: create}};vargame=newPhaser.Game(config);functionpreload(){this.load.video('wormhole','assets/video/wormhole.mp4','loadeddata',false,true);}functioncreate(){varvid=this.add.video(400,300,/* 'wormhole' */)// if key is specified and loadURL is taken out, it worksvid.loadURL('assets/video/wormhole.mp4')vid.setDisplayOrigin(0,0)// breaks video when loaded with loadURLvid.play(true);}
Additional Information
The text was updated successfully, but these errors were encountered:
I think if you add a video with no source you must give it a size:
varvid=this.add.video(400,300).setSize(800,600);
Or else wait for VIDEO_CREATED as the video has no texture frame before then.
I think the problem you saw was because setting the display origin on a size 0 game object spoils the origin values (NaN, NaN). Maybe Phaser could handle that better.
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
Version
Description
When setting displayOrigin on a Video that is loaded with its
loadURL
function, it does not show up. It works if the video is loaded via key, or if setOrigin is used instead.Example Test Code
Go to https://labs.phaser.io/edit.html?src=src/game%20objects/video/play%20video.js&v=3.52.0 and copy/paste the code below
Additional Information
The text was updated successfully, but these errors were encountered: