Install via editing header.php

Recommended installation instructions for sites using WordPress and editing the header.php

We recommend using the SmartVideo plugin for WordPress to install SmartVideo on your WordPress site... But if you are using WordPress and editing template code IS your cup of tea, then you can install SmartVideo JavaScript across​ your entire site by pasting it into your headers.php file. Here's how:

1. Navigate to your WordPress backend. Then mouseover Appearance and click Editor

660

2. On the far right side of the screen, click Theme Header (header.php)

1519

3. Copy the Javascript snippet below to your clipboard with your unique swarmcdnkey.

<script data-cfasync="false">
    var swarmoptions = {
        swarmcdnkey: "<<publicAPIKey>>",
        autoreplace: {
            youtube: true
        }
    };
</script>
<script data-cfasync="false" src="//assets.swarmcdn.com/cross/swarmdetect.js"></script>

4. Then paste ABOVE the section, and click. Update File.

1525

That’s it! Setup complete! Now sit back and enjoy your site’s modern, native video playback experience powered by Swarmify SmartVideo.

What happens next?

After installation, Swarmify scans for YouTube embeds on your site and then displays them in a native player automatically without you having to do anything more. Once the page with the player loads the first time, it signals our system to pull that video in and process and store it on our side so we can deliver it with our accelerated playback functionality. This process could take up to 30 minutes the first time (depending on the length of your videos and queue) so be patient when returning to your page to see SmartVideo fully in action. You can keep uploading your videos to YouTube and embed them on your site. Swarmify will continuously look for new embeds and convert them over, effortlessly.