I am trying to embed an MP4 into a Grafana dashboard on an Ubuntu 18.04 server. I have entered this into the “text” dashboard in HTML mode.
<video width="320" height="240" controls autoplay loop>
<source src="/home/testing/Downloads/video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
This shows the controls but does not show the video. When I put the same code in an html page on its own, however, the video shows as expected.
I have also placed a video in /var/www/html
but this fails to show too.
What am I doing wrong here?
Hello fajgeddes! This is related to the breaking changes introduced in 6.0. The text panel does no longer by default allow unsantizied HTML. #4117. This means that if you have text panels with scripts tags they will no longer work as before. To enable unsafe javascript execution in text panels enable the settings disable_sanitize_html
under the section panels in your Grafana ini file, or set env variable GF_PANELS_DISABLE_SANITIZE_HTML=true
.
But the video
tag is native HTML5 - why would that have been broken?
I can now play the video, but it does not loop as it is supposed to. What am I doing wrong now?
Honestly, I am not sure. I have tested this now on Chrome, Safari and Firefox and loop works for me on all browsers.
hi fajgeddes,
how did you play the video in grafana, I tried the with same video tag with type ogg
and also did GF_PANELS_DISABLE_SANITIZE_HTML=true
but video was not playing