{"_id":"59bba3e115d1e1002426165a","category":{"_id":"59bba3e115d1e10024261653","version":"59bba3e115d1e10024261652","project":"55e6dcb32d0d3021000daf70","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-02T11:25:40.976Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"project":"55e6dcb32d0d3021000daf70","user":"55e6dc8a2d0d3021000daf6e","parentDoc":null,"version":{"_id":"59bba3e115d1e10024261652","project":"55e6dcb32d0d3021000daf70","__v":1,"createdAt":"2017-09-15T09:56:49.752Z","releaseDate":"2017-09-15T09:56:49.752Z","categories":["59bba3e115d1e10024261653","59bba3e115d1e10024261654","59bba3e115d1e10024261655","59bba3e115d1e10024261656","59bba3e115d1e10024261657"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-04T11:53:46.904Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"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.\n\nSelf hosting afterglow is quite easy.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 1 - download afterglow\"\n}\n[/block]\nYou'll have to download afterglow's main file. The latest release is always available at [https://github.com/moay/afterglow/releases](https://github.com/moay/afterglow/releases). \n\nThere 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).\n\n\nYou can also install afterglow via bower. Just run\n\n    bower install afterglow\n\nand use\n\n    bower_components/afterglow/dist/afterglow.min.js\n\nAdditionally, you can use npm to download afterglow:\n\n    npm install afterglowplayer\n\nand use \n\n    node_modules/afterglowplayer/dist/afterglow.min.js\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 2 - host afterglow\"\n}\n[/block]\nAfter 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).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 3 - use your self hosted version\"\n}\n[/block]\nFrom now on, you are self hosted and you can use your self hosted version for your webpages. \n\nQuick 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\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script type=\\\"text/javscript\\\" src=\\\"//example.com/afterglow.min.js\\\"></script>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nto the `<head>` or somewhere in the markup of your page. Read more about how to use afterglow in the [basic player setup guide](doc:basic-player-setup). Everything but the url via which you access afterglow stays the same.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Make sure to use GZIP compression\",\n  \"body\": \"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.\\n\\nIf you want to learn how to enable GZIP compression, we recommend reading [this guide](https://varvy.com/pagespeed/enable-compression.html).\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Make sure to use SSL\",\n  \"body\": \"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. ([?](http://blog.httpwatch.com/2010/02/10/using-protocol-relative-urls-to-switch-between-http-and-https/))\\n\\nIn 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.\"\n}\n[/block]","excerpt":"This page shows you how to self-host afterglow, which is quick and easy.","slug":"self-hosting-afterglow","type":"basic","title":"Self-hosting afterglow"}

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. [block:api-header] { "type": "basic", "title": "Step 1 - download afterglow" } [/block] You'll have to download afterglow's main file. The latest release is always available at [https://github.com/moay/afterglow/releases](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 [block:api-header] { "type": "basic", "title": "Step 2 - host afterglow" } [/block] 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). [block:api-header] { "type": "basic", "title": "Step 3 - use your self hosted version" } [/block] 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 [block:code] { "codes": [ { "code": "<script type=\"text/javscript\" src=\"//example.com/afterglow.min.js\"></script>", "language": "html" } ] } [/block] to the `<head>` or somewhere in the markup of your page. Read more about how to use afterglow in the [basic player setup guide](doc:basic-player-setup). Everything but the url via which you access afterglow stays the same. [block:callout] { "type": "warning", "title": "Make sure to use GZIP compression", "body": "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.\n\nIf you want to learn how to enable GZIP compression, we recommend reading [this guide](https://varvy.com/pagespeed/enable-compression.html)." } [/block] [block:callout] { "type": "warning", "title": "Make sure to use SSL", "body": "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. ([?](http://blog.httpwatch.com/2010/02/10/using-protocol-relative-urls-to-switch-between-http-and-https/))\n\nIn 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." } [/block]