Get error message when playing videos on iPad

Hi everyone,

I want to play videos on the iPad via Pavlovia.
However, I get this error message:

NotAllowedError: The request is not allowed by the user agent or 
the platform in the current context, possibly because the user denied permission.

I presume this has to do with the issue that no button is pressed and the video is autoplaying.

Do you know any workaround to this problem?

I thought that one solution could be to halt the video until a finger touches the screen, but I failed so far in implementing this using code (I used video.pause(); in the begin routine tab, but the video is not pausing at all).

Do you have any advise for me?

best regards,

Christian

Is ths video the first routine? Try adding an instruction routine at the start which requires a screen tap to proceed.

I tried what you suggested and added a instruction routine requiring that the subject touches the screen to continue.
Unfortunately, this does not solve the problem. The error message is still displayed.
The problem does only occur with apple mobile devices, not with the MacBook.

Do you have any other suggestions?

thanks, best,

Christian

Hi,

I’ve had a look and this is a known issue.

You might be able to work around it by setting autoPlay = False at the start of the routine until a play button is pressed and using Chrome instead of Safari.

Here are some links about the issue:

Minimal demo video_iphone [PsychoPy]

Thanks @Wakecarter, I will try it out and let you know.

best, Christian

Ok, I’ve tried it, but without success.
I cannot prevent the video from autoplaying, tried:

movie.setAutoPlay(false);
autoPlay = false;
autoplay: false;
movie.autoplay = false;

in the begin routine tab.

→ Note that the movie component is called “movie”

the button press for starting the video seems not a big issue, in contrast.

So I am really stuck here …

I have now tried several things to solve this issue.

I created a button (called button) and a mouse component (called mouse_2) using builder in psychopy.

In the movie component in builder, I added this code in the “Start” field (setting this to “Condition”): mouse_2.isPressedIn(button).
Good news: The video will start only after I have pressed the button with the mouse, when running it online on a desktop computer (Pavlovia).

However, I still get the error message when running it on an iPhone or iPad (see attached).
This is really a pity.

I have also muted the movie (No audio) and made its size smaller, because of this information:

Does someone have a suggestion for a solution to this problem, if possible quite soon because we scheduled some experiments at the beginning of next week?

thanks, best regards,

Christian