grafana / grafana-kiosk

Kiosk Utility for Grafana
Apache License 2.0
343 stars 57 forks source link

add `autoplay-policy` option to chromedp flags #99

Closed legnoh closed 1 year ago

legnoh commented 1 year ago

Hi, I would like to make one suggestion regarding the Chrome startup flag when grafana-kiosk starts.

Problems

Currently, I am trying to use a video plugin to play YouTube videos on my grafana-kiosk dashboard.

However, Chrome has an Autoplay policy, and if I want to autoplay videos embedded in <iframe> or <video> tags, I need to satisfy the following conditions beforehand.

It is very difficult to satisfy these conditions stably with the current grafana-kiosk, that is, to make videos play in the intended state. In the first place, grafana-kiosk starts Chrome in Incognito mode, so it is not possible to avoid this problem by improving Chrome's MEI (Media Engagement Index) even after playing videos several times.

Suggestion

I would like to set the flag --autoplay-policy=no-user-gesture-required introduced above as the default flag when Chrome starts. By enabling this flag, videos specified in Grafana will be able to play regardless of the policy on the Chrome side.

Concerns

Setting this flag may cause problems, such as increased network data consumption, as videos are automatically loaded. However, when specifying a video, the dashboard administrator can disable autoplay in advance via an iframe or plugin option. Of course, the dashboard administrator has the authority to set the URL to load, so there should be no unintended URLs being called. Therefore, I believe the benefits of setting this flag outweigh any concerns.

Thank you in advance for your consideration of the above.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

briangann commented 1 year ago

sounds great, i will test this out asap!