Web component

framework

A <tomato-player> custom element configured with HTML attributes.

Loading the custom element…
skin attribute

Changing the attribute swaps the skin on the live element. The same element is in the CDN build, so it also works with a single script tag and no bundler.

Open the no-build CDN page
Big Buck Bunny © Blender Foundation, CC BY 3.0, via Wikimedia Commons. HLS test stream by Mux, DASH by Akamai.

The code

html
<script type="module">
import 'tomato-player/element';
</script>
​
<tomato-player
src="https://upload.wikimedia.org/wikipedia/commons/transcoded/c/c0/Big_Buck_Bunny_4K.webm/Big_Buck_Bunny_4K.webm.720p.vp9.webm"
poster="/tomato-player/media/poster.jpg"
title="Big Buck Bunny"
skin="cinema"
accent="#e5372a"
chapters="/chapters.vtt"
></tomato-player>