Little Bird Curriculum / code littlebird.com.au
static-player-migration.js JavaScript 9 lines · 25 views Raw Download Embed view

The whole diff: swap the import and give the player a URL instead of a Vimeo id.

// before: an id that only means something inside Vimeo
import Player from '@vimeo/player';

const player = new Player('container', { id: 123456789 });

// after: a URL you control. Everything below this line is unchanged.
import Player from '@player/static';

const player = new Player('container', { url: 'https://cdn.example.com/video.mp4' });

Embed this snippet

As an iframe:

Or drop it inline with a script tag (injects the highlighted block where included):

Shared from Little Bird Electronics curriculum.

Copied to clipboard