Installation
Vime provides various packages that can be used to quickly get started depending on the library/framework you're using, scroll down to the section that is relevant to you.
note
If you have any issues or struggles with the installation steps below please raise an issue 🐛
#
CDNThe easiest way to get going with Vime is to simply load it from a CDN. We highly recommend
using JSDELIVR for the best performance. Simply insert the following
inside the <head>
element of your HTML file.
And ... we're all done 🎉 That was anticlimactic 😞 Let's move onto setting up our player.
#
Rollup / WebpackA custom elements bundle is available so you can import components and register them individually. This is a more flexible alternative to the lazy loading approach used by the CDN.
Let's install the @vime/core
package by running the following in our terminal...
Now let's first load the CSS for the player themes, which are small files that only contain a bunch of CSS variables for styling the player. You can either load them from the CDN, or bundle them into your project directly (this will require a plugin). See our example configurations for Rollup and Webpack.
Now you can can start bundling Vime by importing the components you require and their dependencies into your project, and registering them in the custom elements registry like so...
info
All components list their dependencies inside their API documentation under the ##Dependencies
section. See the Video component as an example.
And ... we're all done 🎉 Let's move onto setting up our player.
#
StencilLuckily for you Vime is built with Stencil so it works out of the box very easily.
Let's first load the CSS for the player themes, which are small files that only contain a bunch of CSS variables for styling the player. You can either load them from the CDN, or if you're using the Shadow DOM throughout your application, add the following (after adjusting paths) to the component that is wrapping the player...
Now let's install the @vime/core
package by running the following in our terminal...
Finally, we import it into the root of our application...
And ... we're all done 🎉 That was anticlimactic 😞 Let's move onto setting up our player.
#
SvelteYou have two options with Svelte due to it having perfect
web components support. You can either follow the
instructions for loading it from the CDN and use the Vime web components in their natural
form, or you can use the Svelte bindings from the @vime/svelte
package, which wraps all the web
components inside Svelte components so you can feel right at home. Some other advantages for using
@vime/svelte
include typed + documented components, and additional helpers for extending Vime with
custom components.
Let's first load the CSS for the player themes, which are small files that only contain a bunch of
CSS variables for styling the player. Add the following to the <head>
element of your HTML file...
Now let's install the @vime/svelte
package by running the following in our terminal...
And ... we're all done 🎉 That was anticlimactic 😞 Let's move onto setting up our player.
#
ReactUnfortunately React has poor web components support ... but
we have you covered with our @vime/react
package, which wraps all the Vime web components inside
React components so it feels natural to interact with, and it removes all the limitations of working
with web components inside React.
Let's first load the CSS for the player themes, which are small files that only contain a bunch of CSS variables for styling the player. Add the following to the root of your application...
Alternatively, you can load the themes from the CDN. Now let's install the @vime/react
package by running the following in our terminal...
And ... we're all done 🎉 That was anticlimactic 😞 Let's move onto setting up our player.
#
PreactYou have two options with Preact due to it having perfect web components support.
You can either follow the instructions for loading it from the CDN and use the
Vime web components in their natural form, or you can use the Vime React components by setting
up preact-compat
, and following the React
installation instructions.
#
Vueinfo
Vime now supports both Vue 2 (@vime/vue
) and Vue 3 (@vime/vue-next
) 🚀
You have two options with Vue due to it having perfect web components support. You can either follow the instructions here for loading the web components in their natural form, or you can use the Vue bindings from Vime, which wrap all the web components inside Vue components so you can feel right at home.
Let's first load the CSS for the player themes, which are small files that only contain a bunch of CSS variables for styling the player. Add the following to the root of your application...
Alternatively, you can load the themes from the CDN. Now let's install the package by running the following in our terminal...
And ... we're all done 🎉 That was anticlimactic 😞 Let's move onto setting up our player.
#
AngularAre you a 🥕 farmer?
You have two options with Angular due to it having perfect web components support. You can either follow the instructions here for
loading the web components in their natural form which can be slightly tedious, or you can use
the @vime/angular
package to make the installation a breeze.
Let's first load the CSS for the player themes, which are small files that only contain a bunch of CSS variables for styling the player. Add the following to the root of your application styles...
Alternatively, you can load the themes from the CDN. Now let's install the @vime/angular
package by running the following in our terminal...
For the last step we simply need to import the Module
into our application, you can do this
at the root AppModule
or wherever makes the most sense:
And ... we're all done 🎉 Let's move onto setting up our player.