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
The video plays automatically and in a loop with sound
Steps to Reproduce
Videos preloaded in advance through Assets.load cannot be control
awaitAssets.load({src: this.payload.url,data: {autoPlay: true,// automatically playpreload: true,// preloadautoLoad: true,// Video loads immediatelyloop: true,// Whether to loopmuted: false,// Whether to mute// crossorigin: true,// playsinline: true // Play as inline video, default value: true},loadParser: "loadVideo"});
If there is a set of urls in advance, loaded through Assets.load(urls), and then loaded through await Assets.load({...}), the video control will be found to be uncontrollable, unable to start looping and carry sound playback
Environment
pixi.js version: v8.1.0
Browser & Version: Chrome 124
OS & Version: windows11
Possible Solution
Do not load the video in advance through Assets.load. Control the loading through await Assets.load() every time it is used.
Additional Information
The following is the demo written in pixi’s official demo site
import { Application, Assets, Graphics, Sprite } from 'pixi.js';
(async () =>
{
// Create a new application
const app = new Application();
// Initialize the application
await app.init({ resizeTo: window });
// Append the application canvas to the document body
document.body.appendChild(app.canvas);
const urls = [
'https://pixijs.com/assets/bunny.png',
'https://pixijs.com/assets/video.mp4'
];
Assets.load(urls);
setTimeout(()=>{
(async()=>{
const texture = await Assets.load({
src: "https://pixijs.com/assets/video.mp4",
data: {
resourceOptions: {
autoPlay: true, // 自动播放
preload: true, // 预加载
autoLoad: true, // 视频立即加载
loop: true, // 是否循环
muted: false, // 是否静音
},
},
});
const videoSprite = new Sprite(texture);
// Stretch to fill the whole screen
videoSprite.width = app.screen.width;
videoSprite.height = app.screen.height;
app.stage.addChild(videoSprite);
})();
},5000);
})();
The text was updated successfully, but these errors were encountered:
li-yongyu
changed the title
Bug: v8.1:Strange bug, video cannot be controlled
Bug: v8.1.0:Strange bug, video cannot be controlled
May 10, 2024
Current Behavior
Expected Behavior
The video plays automatically and in a loop with sound
Steps to Reproduce
Videos preloaded in advance through
Assets.load
cannot be controlIf there is a set of urls in advance, loaded through
Assets.load(urls)
, and then loaded throughawait Assets.load({...})
, the video control will be found to be uncontrollable, unable to start looping and carry sound playbackEnvironment
pixi.js
version: v8.1.0Possible Solution
Do not load the video in advance through
Assets.load
. Control the loading throughawait Assets.load()
every time it is used.Additional Information
The following is the demo written in pixi’s official demo site
The text was updated successfully, but these errors were encountered: