Chromium, Chrome, Edge version 90 and more limits number of opened MediaPlayers

Hello,

Recent chromium/chrome/edge updates limits the number of media player opened simultaneously.

Hence my test which consists of 88 successive videos in a loop does not work any more and the browser tells that it cannot open so many MediaPlayers.

Are you aware of this issue and if so is it solved in recent versions of PsychoPy ?

Thanks.

Following is a trace opening my test on Chrome 91.0.4472.1 with Psychopy 2021.1.4 (got the same with recent edge browser)

52[Intervention] Blocked attempt to create a WebMediaPlayer as there are too many WebMediaPlayers already in existence. See 1144736 - chromium - An open-source project to help move the web forward. - Monorail

@sotiri would it help if i give you access to my private experiment ?

@jem Sure, let me take a look, thanks, x

@sotiri how can I share the link with you, it is private due to the fact it contains some MPEG contents I cannot share public ?

@jem You can give my GitLab’s account developer access in your project’s member settings, x

@sotiri, I did that thanks. running the experiment requires some parameters user and session you can use user ID 51 and session ID 1

Thanks

Hi @jem, okay, thanks for sharing your project with me, it looks great. I tried piloting, but as the trial ended I got the following error:

Hi @sotiri

Sorry, my bad, I forgot to generate the conditions for user 51. I currently only supports 50 users :frowning:

Anyway, since you made a replicate of the repo for debugging you can use ID=1 and session =1 or 2 .

Also, I see that you managed to run till the end (so you do not have same errors as me and other of my volunteers).

Which Browser and which browser version are you using ?

Regards, and thanks again for testing.

~WRD0002.jpg

Hi @jem, ah okay I see, let me try again, I’m on macOS Chrome 92.0.4515.107

Hi @jem, okay, I was able to get to the end of the study past all 88 trials. Could it be that when that error was thrown there were other media player tabs open in parallel? x

1_mesh_metric_new_2021-07-28_11h37.31.233.csv (14.9 KB)

Thank @sotiri,

we tested for several users with clean browser only one tab open, empty cache and no other application running.

Get same issue on recent Chrome and recent Edge browsers (on Windows 10).

I am surprised you get it ok with a Chrome 92.0.4515.107, that’s crazy :frowning: and it does not help us to debug.

I have a Linux on my personal machine, will try it with a recent chrome to see if it could be OS related (but I would be surprised, or not…).

~WRD0002.jpg

@sotiri,

Just updated my Linux chromium to recent version 92.0.45.15.107 and I have the same issue.

What could we do to get you see the error in one of your environment ?

Also I noticed something strange, I have a total amount of 88 video per session plus the three in training.

However during the initialization of the experiment the system shows it downloads 288 resources (in the user/session window).

And the web console shows 111 error messages regarding blocked attempt to create a WebMediaPlayer.

Do you think this could be linked ? like a leak due to a design error in my test setup ?

Thanks,

JEM

~WRD0002.jpg

Hi @jem, not disputing the problem is real, but a screen recording might help, because I have been unable to reproduce so far. The way PsychoJS is wired all of the assets found in html/resources: .mp4, .csv, .xlsx, and other compatible files, are automatically preloaded on boot, x

Hello @sotiri,

Thanks for your reply.

Now I understand the 288 files loaded, so this is not the problem (the other files are xlsx files for per user/session information).

Sure I can record my screen end send it or maybe if you have a bit of time we can connect in a live session so we can run the test together on my machine also looking at the console, etc.

Just tell me, for live session I can send you an invitation. Otherwise I will setup screen recording.

Thanks again for your support.

~WRD0002.jpg

Hi @jem, no problem, a screen recording should be fine, many thanks, x

@sotiri , please find a link to a screen recording using chrome on windows 10.

You will see that some contents does not show.
Sometime it is even worth and no content gets visible at all.

thanks,

Hi @jem, alright, thanks, yes, I see. I wonder if instead of creating a new MovieStim instance for each trial in the main routine you could programmatically set the movie property to the target file as described below,

Hi @jem, sorry, I have updated the support fork to demonstrate a potential fix, x

Hi @Sotiri,

thank you very much for providing the fix. I did a review on git and it also seemed to be the right solution to me.

Unfortunately it still does not work, I cleaned my cache and double checked the session was using the proper javascript (the one with the fix).

I still have the errors in the log, from the beginning when the resources are loaded, before the test is effectively run (before I press ok).

It seems to me that the function where you did the fix is only executed during the test and not at the beginning.

I did browse the code of mesh_metric_new.js but could not find the location where the resources are loaded.

Maybe in a core Javascript loaded as a resource (https://lib.pavlovia.org/psychojs-2021.1.4.js)?

Regards,

~WRD0002.jpg

Hi @jem, no problem, thanks, your suggestion that PsychoJS media resource preloading might be related makes a lot of sense, but do you mean that the experiment runs as expected despite there being errors in the console? x