Setup

The Complete Player is Vime's greatest offering. It enables complete customization of the player. If you'd like to know what features it includes and how it compares to other options then see the getting started page.

Vime 2 is now out which is a complete rewrite towards Web Components. Vime 1 will not be receiving any more updates, so we strongly recommended you start with or migrate over to Vime 2 today.

Installation

NPM
YARN
UNPKG
JSDELIVR
NPM
npm install @vime-js/complete
YARN
yarn add @vime-js/complete
UNPKG
<script src="https://unpkg.com/@vime-js/complete"></script>
JSDELIVR
<script src="https://cdn.jsdelivr.net/npm/@vime-js/complete"></script>

The dist folder inside the package contains multiple exports:

  • complete.js is a UMD development build that can be used directly in the browser via the <script> tag.

  • complete.esm.js is intended for use with modern bundlers like Webpack or Rollup.

  • complete.min.js is a UMD production build that can be used directly in the browser via the <script> tag.

  • complete.esm.min.js is an ESM production build that can be used directly in modern browsers via the <script type="module"> tag.

  • UMD builds are exported under the Vime namespace.

  • If you're using a bundler then it will automatically pull in the correct files.

  • If you're using svelte-loader or rollup-plugin-svelte then you'll receive the uncompiled components.

Setup

JavaScript
Svelte
JavaScript
import { Player, Boot, FileProvider } from '@vime-js/complete';
const target = document.getElementById('player-target');
// Mount
const player = new Player({
target,
// If you'd like to initialize any props on setup, you can do so here.
props: {
src: '/media/my-video.mp4',
plugins: [Boot],
providers: [FileProvider]
}
});
const off = player.$on('mount', () => {
// Interact with the player and plugins here.
});
// ...
// Destroy
off();
player.$destroy();

See the client-side component API for the complete set of component initialization options.

Svelte
<Player
src="/media/my-video.mp4"
plugins={[Boot]}
providers={[FileProvider]}
on:mount={onPlayerMount}
bind:this={player}
/>
<script>
import { Player, Boot, FileProvider } from '@vime-js/complete';
let player;
const onPlayerMount = () => {
// Interact with the player and plugins here.
};
</script>

Where to next?

To customize the player go to the customization page, and then go to the API section to find out how to interact with the player.

  • For all available providers see this page.

  • See the provider notes for any provider specific issues or features.

  • To see how to set the src prop checkout the loading media guide.

  • If you want more control over which plugins are loaded then see this page.

  • You don't need to load any Vime specific icons or CSS, they're all loaded via plugins.

  • Vime only has a few basic events, you listen to changes through store subscriptions. For example, if you wanted to get updates on the currentTime, you'd subscribe to it. More information can be found here.

  • This player extends the Standard Player, all the props/methods/events listed here are

    also available directly from the Complete Player.