Self-hosting afterglow

This page shows you how to self-host afterglow, which is quick and easy.

We felt a little left hanging when SublimeVideo went away without giving us a solution for the future. In the process of creating afterglow, we always had a focus on self hosting and giving people the possibility to be completely independent with afterglow.

Self hosting afterglow is quite easy.

Step 1 - download afterglow

You'll have to download afterglow's main file. The latest release is always available at https://github.com/moay/afterglow/releases.

There is no need for you to download the entire repository, it's enough to get the afterglow.min.js which you will find in the afterglow.zip available with each release (or contained in the dist folder of the repo).

You can also install afterglow via bower. Just run

bower install afterglow

and use

bower_components/afterglow/dist/afterglow.min.js

Additionally, you can use npm to download afterglow:

npm install afterglowplayer

and use

node_modules/afterglowplayer/dist/afterglow.min.js

Step 2 - host afterglow

After having downloaded afterglow, all you have to do is to upload the file afterglow.min.js somewhere it can be accessed via a public url. This url should not change at any time (no dynamic urls or dynamic IPs and so on).

Step 3 - use your self hosted version

From now on, you are self hosted and you can use your self hosted version for your webpages.

Quick example: if you have a webspace with a domain example.com pointing towards the folder where your version of afterglow is located, you should add

<script type="text/javscript" src="//example.com/afterglow.min.js"></script>

to the <head> or somewhere in the markup of your page. Read more about how to use afterglow in the basic player setup guide. Everything but the url via which you access afterglow stays the same.

🚧

Make sure to use GZIP compression

When afterglow is served via the CDN, it comes gzipped with a size of ~80KB, which is quite cool for a fully working video solution. If you don't serve it gzipped, it will have a size of ~340KB, which is quite heavy for mobile devices.

If you want to learn how to enable GZIP compression, we recommend reading this guide.

🚧

Make sure to use SSL

You may have noticed, that the example does not have http or https in it, just the // at the beginning of the src attribute. This type of url is called protocol relative url which means, that the protocol will be chosen depending on the currently used one. (?)

In order to have this properly working, you MUST provide a valid SSL certificate to the domain where your version of afterglow is hosted. It will of course also work with plain old http://example.com/afterglow.min.js and without using SSL, but it's strongly recommended to provide SSL support.