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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more