1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-12 08:38:10 +00:00

Merge pull request #260 from thewhodidthis/bf#196--video

visual/MovieStim: do tell PIXI base texture to respect autoplay
This commit is contained in:
Alain Pitiot 2021-02-18 13:22:11 +01:00 committed by GitHub
commit 38ab3444aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,7 +373,7 @@ export class MovieStim extends VisualStim
}
// create a PixiJS video sprite:
this._texture = PIXI.Texture.from(this._movie);
this._texture = PIXI.Texture.from(this._movie, { resourceOptions: { autoPlay: this.autoPlay } });
this._pixi = new PIXI.Sprite(this._texture);
// since _texture.width may not be immedialy available but the rest of the code needs its value
@ -390,8 +390,7 @@ export class MovieStim extends VisualStim
this._movie.muted = this._noAudio;
this._movie.volume = this._volume;
// autoplay and loop:
this._texture.baseTexture.autoPlay = this.autoPlay;
// loop:
this._movie.loop = this._loop;
// opacity: