Skip to main content

Youtube video

This idea comes from the GitHub issue opened by Raphealtony. The Business Text plugin can be used to display YouTube videos on your Grafana dashboard.

How to configure the Business Text plugin to display a YouTube video.
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

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

After Content Ready

Version mismatch

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:

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);
});