Discover how to integrate IMG.LY’s video editor into your Vue.js application and unlock its full potential.

Platforms like Instagram, YouTube, and TikTok have revolutionized how we engage with content, setting new standards for consuming video media. With the growing popularity of short-form videos, this trend shows no signs of slowing down.

Users now not only love to watch videos but also expect intuitive video creation and editing features from modern web applications. Here is why adding a video editor to your Vue.js web application can significantly boost user engagement and satisfaction.

In this guide, you will discover how to integrate a video editor into a Vue.js project using CreativeEditor SDK (also referred to as CE.SDK). We will also discuss when this functionality is most beneficial and how to customize the editor for your specific needs.

For a quick setup, take a look at the GitHub Vue.js video editor integration repository to kick off your project.

Let’s dive in!

Why You Should Add a Video Editor to Your Vue.js App?

The digital landscape is constantly evolving, but one truth has remained steady: video content continues to dominate.

Statistics about videos are clear. According to Datareportal, over one-third of all Instagram reels are videos. Similarly, YouTube Shorts garners over 70 billion daily views, and TikTok boasts more than 1.5 billion monthly active users worldwide.

The reasons behind these staggering numbers are two:

  1. Videos are incredibly engaging for audiences.
  2. Social media platforms have made it remarkably easy to create professional-looking content.

Users now expect to be able to add filters, overlays, audio, music, and text with just a few clicks. As a result, not only do we anticipate video editing features in web applications, but we also demand that these features be simple to use.

By integrating an intuitive video editor, your Vue.js web app can capitalize on that trend. The goal is to provide a feature that billions of users are already familiar with—and likely expect from your application.

The payoff? Lowering the barriers to user-generated content, increasing engagement, and driving product distribution!

How to Integrate a Video Editor in Vue.js

In this section, you will learn how to set up a Vue.js video editor using CreativeEditor SDK.

Requirements

Before starting, ensure you have the latest LTS version of Node.js installed on your machine. Otherwise, download and install it from the official Node.js website.

If you do not already have a Vue.js project, create a new Vite-based Vue project by running the following command:

npm create vue@latest

This will install and run create-vue, the official Vue project scaffolding tool. During the process, you will be prompted to select optional features like TypeScript and testing support. Below is an example of how you can respond to the prompts:

 Project name: ... my-vue-video-editor-app
 Add TypeScript? ... No / Yes
 Add JSX Support? ... No / Yes
 Add Vue Router for Single Page Application development? ... No / Yes
 Add Pinia for state management? ... No / Yes
 Add Vitest for Unit Testing? ... No / Yes
 Add an End-to-End Testing Solution? » No
 Add ESLint for code quality? » Yes
 Add Prettier for code formatting? ... No / Yes

If you are unsure about an option, simply select “No” by pressing Enter.

After the project is set up, navigate to the project folder and install CreativeEditor SDK via @cesdk/cesdk-js package with this command:

npm install @cesdk/cesdk-js

Your package.json file will now include the SDK as a dependency:

"dependencies": {
"@cesdk/cesdk-js": "^1.41.1",
"vue": "^3.5.13",
"vue-router": "^4.4.5"
}

Finally, open your project in a JavaScript IDE, and you are ready to start coding!

Create the Video Editor Component

In the src/components folder, create a new file named VideoEditor.vue. This file will serve as your Vue.js single-file component for the CE.SDK-based video editor.

In the like this:

import CreativeEditorSDK from '@cesdk/cesdk-js';

Next, create your video editor component using the following lines of code:


<!-- src/components/VideoEditor.vue -->

<template>
  <div id="cesdk_container" style="height: 100vh; width: 100vw"></div>
</template>

<script>
import CreativeEditorSDK from '@cesdk/cesdk-js'

export default {
  props: { config: Object },

  _cesdk: null,

  mounted: function mounted() {
    CreativeEditorSDK.create('#cesdk_container', this.config).then(async (instance) => {
      this._cesdk = instance
      // customize the editor behavior...
    })
  },

  methods: {},

  watch: {},

  beforeUnmount: function beforeDestroy() {
    // clean up the CE.SDK instance
    if (this._cesdk) {
      this._cesdk.dispose()
      this._cesdk = null
    }
  },
}
</script>

The component defined above embeds the CreativeEditorSDK JavaScript element into an HTML <div> container.

Use the Component

You can now import the VideoEditor component in the

import VideoEditor from './components/VideoEditor.vue';

Then, include it in the