This tutorial will help if you are a WordPress admin and are looking for a way to collect videos from your users regarding specific posts you published on your blog. This is useful if you’d like to collect video feedback or get input from your readers through video.
In the tutorial, we’re explaining a simple setup for this kind of scenario, including the option to have all videos your readers submit to you get uploaded to your Google Drive account into a separate folder for each of your blog posts for better sorting.
We’re showing how to achieve this with the help of the Clipchamp video recorder and uploader plugin for WordPress. It is based on our video API and is enabling the API’s capabilities in WordPress.
1. Install the video recorder plugin
To start, you’ll first need to install the Clipchamp video plugin and set up the connection between Clipchamp and your site or blog. As part of the installation process you’re creating a free Clipchamp API trial account and set up the basics to connect it to your site.
The installation includes 3 guided steps, you can also check our detailed instructions in this initial setup tutorial to see what’s required.
2. Set Google Drive as the upload target for user videos
As part of the setup, you’re selecting an upload target in your Clipchamp API trial account, which we’ll use to submit user videos to. For the purposes of this tutorial, this upload target is Google Drive (see screenshots) and we’re specifying a particular folder as the root folder for all video uploads.
In the example, the folder is called “Clipchamp Videos”. Folders for videos from each of your posts will get created in the Clipchamp Videos parent folder.
The Google Drive interface to select the folder looks like this (you’ll see this during the initial setup of the plugin and Clipchamp API trial account):
And the video API upload target setup screen looks like this:
3. Embed video recording buttons on your site
After the initial setup and after configuring your preferred upload target to Google Drive, you’ll need to embed the Clipchamp button on your WordPress blog.
Generally there are multiple ways to embed 1 or multiple button(s):
1. You can tell the plugin to automatically add the button to every post (or custom post type) by ticking the respective box in the plugin settings screen. A downside to this method is that you cannot configure each single instance of a video button by itself. That means, you cannot change the label of a button or the target folder for the videos for each button. Instead, all buttons use the default settings.
2. You can use the
[ clipchamp ] shortcode and embed it manually in every post where you’d like a video recorder to appear. You can then change the configuration for each button you embed using the shortcode (it’s possible to make use of parameters with the shortcode, e.g.
[ clipchamp label="A different label"]). The downside to this approach is that it requires this extra manual step for each post.
3. You can embed the Clipchamp button code in your theme’s template files using the
the_clipchamp_button functions. On the one hand this is a bit more complex to set up at first, on the other hand it allows for a lot more control over the behaviour and parameters of each embedded video button on your site.
In the end, it depends on your specific situation which approach makes the most sense.
4. Embed a video button per post and upload videos to a separate Google Drive folder per post
For our example, we select option #3 from the list above, since we need control over every individual video button instance but don’t want to manually add a shortcode to each post.
In our example, we are editing the twentyseventeen theme provided by WordPress. The template file for a single post is single.php in the root folder of the theme. However, the actual post content is in content.php in the template-parts folder. Note that this is specific to the “twentyseventeen” theme and might differ in your theme. The general point is that you need to be able to add some code to the PHP file that determines the behaviour of posts in your WordPress installation. If you’re not sure which one that is, we recommend to check on the website or in the help section of the theme you’re using.
After finding the appropriate template file, we need to look for the right spot to display the Clipchamp button. We want it to show right after the main content of a post, but before the post pagination and footer. Consequently, we are calling the the_clipchamp_button function with the appropriate parameters, immediately after the the_content function (feel free to copy & paste this code):
Since we want to group the videos in folders named after the post, we extract the post slug to use it as the folder name (lines 1 & 2). Then, we are actually calling the function to embed the video recording button. We provide parameters for the label and folder based on the post.
After saving these changes to the content.php file (and uploading the modified file to your site), a Clipchamp video button will not only get inserted into each post you create on your WordPress site, each of these video recording widgets will also upload any videos your site visitors record through it to a unique Google Drive folder for each post.
As we can see, when we upload a test video, the video gets correctly put in the folder “hello-world”.
Using this method you can enable video feedback from your readers in your blog. For additional tutorials that show the extensive options of collecting videos on your WordPress (and non-WP) website, please see our constantly growing video API tutorial collection.
Happy clipchamping 🙂