mirror of
https://github.com/psychopy/psychojs.git
synced 2025-05-11 16:18:10 +00:00
visual/MovieStim: deal with promise based video play
This commit is contained in:
parent
da2d9c5ad7
commit
3220e5b1b5
@ -219,7 +219,20 @@ export class MovieStim extends VisualStim
|
||||
play(log = false)
|
||||
{
|
||||
this.status = PsychoJS.Status.STARTED;
|
||||
this._movie.play();
|
||||
|
||||
// As found on https://goo.gl/LdLk22
|
||||
const playPromise = this._movie.play();
|
||||
|
||||
if (playPromise !== undefined)
|
||||
{
|
||||
playPromise.catch((error) => {
|
||||
throw {
|
||||
origin: 'MovieStim.play',
|
||||
context: `when attempting to play MovieStim: ${this._name}`,
|
||||
error
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user