Setup and Installation

If you currently run your site based on a OpenCart based shop, it is rather easy to integrate it with Xvid MediaHub. By installing the Xvid MediaHub OpenCart plugin, you can:

  • Sell Xvid MediaHub hosted videos as downloadable products and offload the product downloads to the hyper-fast Xvid MediaHub CDN.
  • Protect video that you sell with Xvid AutoGraph forensic watermarking (you'll be able to track each illegally copy of videos you sold back to the Opencart User ID of the user who pirated the content).


So let's start with  setting up the necessary pieces...

Step 1: Install the Xvid MediaHub plugin in your Opencart shop

  • Download the plugin archive from here.
  • Login to your OpenCart admin backend, click "Extensions"->"Extensions Installer" and "Upload" the xvid_mediahub.ocmod.zip archive .
  • Make sure that the new extension is enabled in your list of Installed Extensions. If not auto-enabled, then manually click on "Enable".

Step 2: Create an application to use with your site in your Xvid MediaHub account (If you have created an application already as part of some other tutorial, you can skip this step)

An application sets up a set of alternative "login" credentials allowing you to delegate API access under your account to one (or more) applications (e.g. a script, your website, etc.). This way you don't need to leak your actual username and password into an application config file and you can also at any time disable API access of a certain application or re-create the entire application with new credentials in case an app got compromised or insecure without harming your overall account or any other app in your account. 

So let's switch to the "Apps" tab and click "Add App", then enter a name for your new app and click "Create":
 

 

The newly created app will now show up in the grid. To obtain the corresponding application credentials, click on the "Edit" button. From the popup-window, copy&paste your Client ID and Client Secret. We'll need them in the next step:
 

Step 3: Configure your new Xvid MediaHub OpenCart extension

  • Log into the OpenCart admin backend.
  • Click on "Settings"->"Default Store", then select "Xvid MediaHub".
  • Copy&Paste your application's Client ID and Client Secret into the respective fields in the configuration dialog.
  • Enter "autograph.xvid.com" as the Download Domain.
  • Set "Treat as AutoGraph by default" to "Yes" if you plan to distribute your videos with Xvid AutoGraph protection in general.

Step 4: Add a MediaHub hosted video to a downloadable product

  • For each Xvid MediaHub hosted video that you want to sell, you first need to create a "Download" in OpenCart. For this, go to "Catalog"->"Downloads" and click the "+" button to create a new download.
  • Assign a descriptive name for your download in the "Download Name" field. This is the description that's shown to the end-user in his list of available downloads. So if you offer your video in multiple resolutions (like 720p, 1080p or 4K), you should always also mention the resolution in the donwload name, so that the user will know what it is.
  • The "Mask" field you can just leave empty if your video is supposed to be Xvid AutoGraph watermark protected and you've already chosen the "Treat as AutoGraph by default" option in the Xvid MediaHub settings page. Otherwise, you put a "autograph=false" into the "Mask" field to override the general config and switch off AutoGraph protection for this video.
  • In the "Filename" field just always enter (without the quotes) "https://autograph.xvid.com/downloads/?file_id=" and then append the Xvid MediaHub file ID of your video. Do *not* click the "Upload" button on the right end of the field (because there's no need to upload anything as the file is hosted via Xvid MediaHub) but just click the "Save" button once you're done. 
  • Once you've created your new download, you can assign it to one or more of your downloadable products as usual. So select your product, and go to "Downloads" under the "Links" tab. It is an autocomplete field, so by typing part of the name of the download your newly created Xvid MediaHub hosted download will be offered and you can select it to add it to your product.
  • No labels