Grafana Cloud Enterprise Open source

YouTube video

This idea comes from a GitHub issue opened by Raphealtony. You can use the Business Text plugin to display YouTube videos on your Grafana dashboard.

How to configure the Business Text plugin to display a YouTube video.

Use the following external library

https://youtube.com/iframe_api

Content to copy

HTML
<h1>Volkov Labs Latest videos</h1>
<div id="player"></div>

After Content Ready

Warning

Plug-in libraries may change their versions and the code in the example may not work or cause an error.

Use the following for the JavaScript > After Content Ready:

js
import("https://esm.sh/youtube-player").then(({ default: YouTubePlayer }) => {
  const player = YouTubePlayer("player");

  const videoList = ["AcQi-6GCrNU", "1ogv2jstrlI", "vky-7-DfvXE"];

  const randomVideoId = videoList[Math.floor(Math.random() * videoList.length)];

  player.loadVideoById(randomVideoId);
});