Published
Edited
Jun 9, 2021
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
videoPlayer = {
const player = new YouTubeToHtml5({
selector: '.youtube-video',
attribute: 'data-yt',
autoload: false,
withAudio: true
});
// add loading class to video element
player.addAction('api.before', function(element) {
element.classList.add('loading-video');
});

// remove loading class after API HTTP request completes
player.addAction('api.after', function(element) {
element.classList.remove('loading-video');
});

// load video
player.load();
return player;
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more