aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fonts/AvenirLTStd-Heavy.ttfbin0 -> 49936 bytes
-rw-r--r--src/fonts/AvenirLTStd-Heavy.woffbin0 -> 28088 bytes
-rwxr-xr-xsrc/fonts/AvenirLTStd-Heavy.woff2bin0 -> 21164 bytes
-rw-r--r--src/fonts/AvenirLTStd-Medium.ttfbin0 -> 52748 bytes
-rw-r--r--src/fonts/AvenirLTStd-Medium.woffbin0 -> 28964 bytes
-rwxr-xr-xsrc/fonts/AvenirLTStd-Medium.woff2bin0 -> 22084 bytes
-rw-r--r--src/js/docs.js15
-rw-r--r--src/js/lib/hogan-3.0.2.mustache.js802
-rw-r--r--src/js/plyr.js1123
-rw-r--r--src/less/docs.less140
-rw-r--r--src/less/docs/fontface.less16
-rw-r--r--src/less/docs/mixins.less42
-rw-r--r--src/less/docs/normalize.less406
-rw-r--r--src/less/plyr.less431
-rwxr-xr-xsrc/sprite/icon-bubble.svg6
-rw-r--r--src/sprite/icon-collapse.svg13
-rw-r--r--src/sprite/icon-expand.svg13
-rwxr-xr-xsrc/sprite/icon-fast-forward.svg6
-rw-r--r--src/sprite/icon-muted.svg14
-rw-r--r--src/sprite/icon-pause.svg13
-rwxr-xr-xsrc/sprite/icon-play.svg6
-rwxr-xr-xsrc/sprite/icon-refresh.svg7
-rw-r--r--src/sprite/icon-rewind.svg10
-rwxr-xr-xsrc/sprite/icon-sound.svg7
-rw-r--r--src/templates/controls.html59
25 files changed, 3129 insertions, 0 deletions
diff --git a/src/fonts/AvenirLTStd-Heavy.ttf b/src/fonts/AvenirLTStd-Heavy.ttf
new file mode 100644
index 00000000..7bee7997
--- /dev/null
+++ b/src/fonts/AvenirLTStd-Heavy.ttf
Binary files differ
diff --git a/src/fonts/AvenirLTStd-Heavy.woff b/src/fonts/AvenirLTStd-Heavy.woff
new file mode 100644
index 00000000..771c45a1
--- /dev/null
+++ b/src/fonts/AvenirLTStd-Heavy.woff
Binary files differ
diff --git a/src/fonts/AvenirLTStd-Heavy.woff2 b/src/fonts/AvenirLTStd-Heavy.woff2
new file mode 100755
index 00000000..b889b061
--- /dev/null
+++ b/src/fonts/AvenirLTStd-Heavy.woff2
Binary files differ
diff --git a/src/fonts/AvenirLTStd-Medium.ttf b/src/fonts/AvenirLTStd-Medium.ttf
new file mode 100644
index 00000000..73ec1e54
--- /dev/null
+++ b/src/fonts/AvenirLTStd-Medium.ttf
Binary files differ
diff --git a/src/fonts/AvenirLTStd-Medium.woff b/src/fonts/AvenirLTStd-Medium.woff
new file mode 100644
index 00000000..bc2a778e
--- /dev/null
+++ b/src/fonts/AvenirLTStd-Medium.woff
Binary files differ
diff --git a/src/fonts/AvenirLTStd-Medium.woff2 b/src/fonts/AvenirLTStd-Medium.woff2
new file mode 100755
index 00000000..bcf4649b
--- /dev/null
+++ b/src/fonts/AvenirLTStd-Medium.woff2
Binary files differ
diff --git a/src/js/docs.js b/src/js/docs.js
new file mode 100644
index 00000000..89803ee2
--- /dev/null
+++ b/src/js/docs.js
@@ -0,0 +1,15 @@
+// ==========================================================================
+// Docs example
+// ==========================================================================
+
+/*global plyr, templates */
+
+// Setup the player
+plyr.setup({
+ debug: true,
+ title: "Video demo",
+ html: templates.controls.render({}),
+ captions: {
+ defaultActive: true
+ }
+}); \ No newline at end of file
diff --git a/src/js/lib/hogan-3.0.2.mustache.js b/src/js/lib/hogan-3.0.2.mustache.js
new file mode 100644
index 00000000..f1300c46
--- /dev/null
+++ b/src/js/lib/hogan-3.0.2.mustache.js
@@ -0,0 +1,802 @@
+/*!
+ * Copyright 2011 Twitter, Inc.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// A wrapper for compatibility with Mustache.js, quirks and all
+
+
+
+var Hogan = {};
+
+(function (Hogan) {
+ Hogan.Template = function (codeObj, text, compiler, options) {
+ codeObj = codeObj || {};
+ this.r = codeObj.code || this.r;
+ this.c = compiler;
+ this.options = options || {};
+ this.text = text || '';
+ this.partials = codeObj.partials || {};
+ this.subs = codeObj.subs || {};
+ this.buf = '';
+ }
+
+ Hogan.Template.prototype = {
+ // render: replaced by generated code.
+ r: function (context, partials, indent) { return ''; },
+
+ // variable escaping
+ v: hoganEscape,
+
+ // triple stache
+ t: coerceToString,
+
+ render: function render(context, partials, indent) {
+ return this.ri([context], partials || {}, indent);
+ },
+
+ // render internal -- a hook for overrides that catches partials too
+ ri: function (context, partials, indent) {
+ return this.r(context, partials, indent);
+ },
+
+ // ensurePartial
+ ep: function(symbol, partials) {
+ var partial = this.partials[symbol];
+
+ // check to see that if we've instantiated this partial before
+ var template = partials[partial.name];
+ if (partial.instance && partial.base == template) {
+ return partial.instance;
+ }
+
+ if (typeof template == 'string') {
+ if (!this.c) {
+ throw new Error("No compiler available.");
+ }
+ template = this.c.compile(template, this.options);
+ }
+
+ if (!template) {
+ return null;
+ }
+
+ // We use this to check whether the partials dictionary has changed
+ this.partials[symbol].base = template;
+
+ if (partial.subs) {
+ // Make sure we consider parent template now
+ if (!partials.stackText) partials.stackText = {};
+ for (key in partial.subs) {
+ if (!partials.stackText[key]) {
+ partials.stackText[key] = (this.activeSub !== undefined && partials.stackText[this.activeSub]) ? partials.stackText[this.activeSub] : this.text;
+ }
+ }
+ template = createSpecializedPartial(template, partial.subs, partial.partials,
+ this.stackSubs, this.stackPartials, partials.stackText);
+ }
+ this.partials[symbol].instance = template;
+
+ return template;
+ },
+
+ // tries to find a partial in the current scope and render it
+ rp: function(symbol, context, partials, indent) {
+ var partial = this.ep(symbol, partials);
+ if (!partial) {
+ return '';
+ }
+
+ return partial.ri(context, partials, indent);
+ },
+
+ // render a section
+ rs: function(context, partials, section) {
+ var tail = context[context.length - 1];
+
+ if (!isArray(tail)) {
+ section(context, partials, this);
+ return;
+ }
+
+ for (var i = 0; i < tail.length; i++) {
+ context.push(tail[i]);
+ section(context, partials, this);
+ context.pop();
+ }
+ },
+
+ // maybe start a section
+ s: function(val, ctx, partials, inverted, start, end, tags) {
+ var pass;
+
+ if (isArray(val) && val.length === 0) {
+ return false;
+ }
+
+ if (typeof val == 'function') {
+ val = this.ms(val, ctx, partials, inverted, start, end, tags);
+ }
+
+ pass = !!val;
+
+ if (!inverted && pass && ctx) {
+ ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]);
+ }
+
+ return pass;
+ },
+
+ // find values with dotted names
+ d: function(key, ctx, partials, returnFound) {
+ var found,
+ names = key.split('.'),
+ val = this.f(names[0], ctx, partials, returnFound),
+ doModelGet = this.options.modelGet,
+ cx = null;
+
+ if (key === '.' && isArray(ctx[ctx.length - 2])) {
+ val = ctx[ctx.length - 1];
+ } else {
+ for (var i = 1; i < names.length; i++) {
+ found = findInScope(names[i], val, doModelGet);
+ if (found !== undefined) {
+ cx = val;
+ val = found;
+ } else {
+ val = '';
+ }
+ }
+ }
+
+ if (returnFound && !val) {
+ return false;
+ }
+
+ if (!returnFound && typeof val == 'function') {
+ ctx.push(cx);
+ val = this.mv(val, ctx, partials);
+ ctx.pop();
+ }
+
+ return val;
+ },
+
+ // find values with normal names
+ f: function(key, ctx, partials, returnFound) {
+ var val = false,
+ v = null,
+ found = false,
+ doModelGet = this.options.modelGet;
+
+ for (var i = ctx.length - 1; i >= 0; i--) {
+ v = ctx[i];
+ val = findInScope(key, v, doModelGet);
+ if (val !== undefined) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ return (returnFound) ? false : "";
+ }
+
+ if (!returnFound && typeof val == 'function') {
+ val = this.mv(val, ctx, partials);
+ }
+
+ return val;
+ },
+
+ // higher order templates
+ ls: function(func, cx, partials, text, tags) {
+ var oldTags = this.options.delimiters;
+
+ this.options.delimiters = tags;
+ this.b(this.ct(coerceToString(func.call(cx, text)), cx, partials));
+ this.options.delimiters = oldTags;
+
+ return false;
+ },
+
+ // compile text
+ ct: function(text, cx, partials) {
+ if (this.options.disableLambda) {
+ throw new Error('Lambda features disabled.');
+ }
+ return this.c.compile(text, this.options).render(cx, partials);
+ },
+
+ // template result buffering
+ b: function(s) { this.buf += s; },
+
+ fl: function() { var r = this.buf; this.buf = ''; return r; },
+
+ // method replace section
+ ms: function(func, ctx, partials, inverted, start, end, tags) {
+ var textSource,
+ cx = ctx[ctx.length - 1],
+ result = func.call(cx);
+
+ if (typeof result == 'function') {
+ if (inverted) {
+ return true;
+ } else {
+ textSource = (this.activeSub && this.subsText && this.subsText[this.activeSub]) ? this.subsText[this.activeSub] : this.text;
+ return this.ls(result, cx, partials, textSource.substring(start, end), tags);
+ }
+ }
+
+ return result;
+ },
+
+ // method replace variable
+ mv: function(func, ctx, partials) {
+ var cx = ctx[ctx.length - 1];
+ var result = func.call(cx);
+
+ if (typeof result == 'function') {
+ return this.ct(coerceToString(result.call(cx)), cx, partials);
+ }
+
+ return result;
+ },
+
+ sub: function(name, context, partials, indent) {
+ var f = this.subs[name];
+ if (f) {
+ this.activeSub = name;
+ f(context, partials, this, indent);
+ this.activeSub = false;
+ }
+ }
+
+ };
+
+ //Find a key in an object
+ function findInScope(key, scope, doModelGet) {
+ var val;
+
+ if (scope && typeof scope == 'object') {
+
+ if (scope[key] !== undefined) {
+ val = scope[key];
+
+ // try lookup with get for backbone or similar model data
+ } else if (doModelGet && scope.get && typeof scope.get == 'function') {
+ val = scope.get(key);
+ }
+ }
+
+ return val;
+ }
+
+ function createSpecializedPartial(instance, subs, partials, stackSubs, stackPartials, stackText) {
+ function PartialTemplate() {};
+ PartialTemplate.prototype = instance;
+ function Substitutions() {};
+ Substitutions.prototype = instance.subs;
+ var key;
+ var partial = new PartialTemplate();
+ partial.subs = new Substitutions();
+ partial.subsText = {}; //hehe. substext.
+ partial.buf = '';
+
+ stackSubs = stackSubs || {};
+ partial.stackSubs = stackSubs;
+ partial.subsText = stackText;
+ for (key in subs) {
+ if (!stackSubs[key]) stackSubs[key] = subs[key];
+ }
+ for (key in stackSubs) {
+ partial.subs[key] = stackSubs[key];
+ }
+
+ stackPartials = stackPartials || {};
+ partial.stackPartials = stackPartials;
+ for (key in partials) {
+ if (!stackPartials[key]) stackPartials[key] = partials[key];
+ }
+ for (key in stackPartials) {
+ partial.partials[key] = stackPartials[key];
+ }
+
+ return partial;
+ }
+
+ var rAmp = /&/g,
+ rLt = /</g,
+ rGt = />/g,
+ rApos = /\'/g,
+ rQuot = /\"/g,
+ hChars = /[&<>\"\']/;
+
+ function coerceToString(val) {
+ return String((val === null || val === undefined) ? '' : val);
+ }
+
+ function hoganEscape(str) {
+ str = coerceToString(str);
+ return hChars.test(str) ?
+ str
+ .replace(rAmp, '&amp;')
+ .replace(rLt, '&lt;')
+ .replace(rGt, '&gt;')
+ .replace(rApos, '&#39;')
+ .replace(rQuot, '&quot;') :
+ str;
+ }
+
+ var isArray = Array.isArray || function(a) {
+ return Object.prototype.toString.call(a) === '[object Array]';
+ };
+
+})(typeof exports !== 'undefined' ? exports : Hogan);
+
+
+
+(function (Hogan) {
+ // Setup regex assignments
+ // remove whitespace according to Mustache spec
+ var rIsWhitespace = /\S/,
+ rQuot = /\"/g,
+ rNewline = /\n/g,
+ rCr = /\r/g,
+ rSlash = /\\/g,
+ rLineSep = /\u2028/,
+ rParagraphSep = /\u2029/;
+
+ Hogan.tags = {
+ '#': 1, '^': 2, '<': 3, '$': 4,
+ '/': 5, '!': 6, '>': 7, '=': 8, '_v': 9,
+ '{': 10, '&': 11, '_t': 12
+ };
+
+ Hogan.scan = function scan(text, delimiters) {
+ var len = text.length,
+ IN_TEXT = 0,
+ IN_TAG_TYPE = 1,
+ IN_TAG = 2,
+ state = IN_TEXT,
+ tagType = null,
+ tag = null,
+ buf = '',
+ tokens = [],
+ seenTag = false,
+ i = 0,
+ lineStart = 0,
+ otag = '{{',
+ ctag = '}}';
+
+ function addBuf() {
+ if (buf.length > 0) {
+ tokens.push({tag: '_t', text: new String(buf)});
+ buf = '';
+ }
+ }
+
+ function lineIsWhitespace() {
+ var isAllWhitespace = true;
+ for (var j = lineStart; j < tokens.length; j++) {
+ isAllWhitespace =
+ (Hogan.tags[tokens[j].tag] < Hogan.tags['_v']) ||
+ (tokens[j].tag == '_t' && tokens[j].text.match(rIsWhitespace) === null);
+ if (!isAllWhitespace) {
+ return false;
+ }
+ }
+
+ return isAllWhitespace;
+ }
+
+ function filterLine(haveSeenTag, noNewLine) {
+ addBuf();
+
+ if (haveSeenTag && lineIsWhitespace()) {
+ for (var j = lineStart, next; j < tokens.length; j++) {
+ if (tokens[j].text) {
+ if ((next = tokens[j+1]) && next.tag == '>') {
+ // set indent to token value
+ next.indent = tokens[j].text.toString()
+ }
+ tokens.splice(j, 1);
+ }
+ }
+ } else if (!noNewLine) {
+ tokens.push({tag:'\n'});
+ }
+
+ seenTag = false;
+ lineStart = tokens.length;
+ }
+
+ function changeDelimiters(text, index) {
+ var close = '=' + ctag,
+ closeIndex = text.indexOf(close, index),
+ delimiters = trim(
+ text.substring(text.indexOf('=', index) + 1, closeIndex)
+ ).split(' ');
+
+ otag = delimiters[0];
+ ctag = delimiters[delimiters.length - 1];
+
+ return closeIndex + close.length - 1;
+ }
+
+ if (delimiters) {
+ delimiters = delimiters.split(' ');
+ otag = delimiters[0];
+ ctag = delimiters[1];
+ }
+
+ for (i = 0; i < len; i++) {
+ if (state == IN_TEXT) {
+ if (tagChange(otag, text, i)) {
+ --i;
+ addBuf();
+ state = IN_TAG_TYPE;
+ } else {
+ if (text.charAt(i) == '\n') {
+ filterLine(seenTag);
+ } else {
+ buf += text.charAt(i);
+ }
+ }
+ } else if (state == IN_TAG_TYPE) {
+ i += otag.length - 1;
+ tag = Hogan.tags[text.charAt(i + 1)];
+ tagType = tag ? text.charAt(i + 1) : '_v';
+ if (tagType == '=') {
+ i = changeDelimiters(text, i);
+ state = IN_TEXT;
+ } else {
+ if (tag) {
+ i++;
+ }
+ state = IN_TAG;
+ }
+ seenTag = i;
+ } else {
+ if (tagChange(ctag, text, i)) {
+ tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag,
+ i: (tagType == '/') ? seenTag - otag.length : i + ctag.length});
+ buf = '';
+ i += ctag.length - 1;
+ state = IN_TEXT;
+ if (tagType == '{') {
+ if (ctag == '}}') {
+ i++;
+ } else {
+ cleanTripleStache(tokens[tokens.length - 1]);
+ }
+ }
+ } else {
+ buf += text.charAt(i);
+ }
+ }
+ }
+
+ filterLine(seenTag, true);
+
+ return tokens;
+ }
+
+ function cleanTripleStache(token) {
+ if (token.n.substr(token.n.length - 1) === '}') {
+ token.n = token.n.substring(0, token.n.length - 1);
+ }
+ }
+
+ function trim(s) {
+ if (s.trim) {
+ return s.trim();
+ }
+
+ return s.replace(/^\s*|\s*$/g, '');
+ }
+
+ function tagChange(tag, text, index) {
+ if (text.charAt(index) != tag.charAt(0)) {
+ return false;
+ }
+
+ for (var i = 1, l = tag.length; i < l; i++) {
+ if (text.charAt(index + i) != tag.charAt(i)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ // the tags allowed inside super templates
+ var allowedInSuper = {'_t': true, '\n': true, '$': true, '/': true};
+
+ function buildTree(tokens, kind, stack, customTags) {
+ var instructions = [],
+ opener = null,
+ tail = null,
+ token = null;
+
+ tail = stack[stack.length - 1];
+
+ while (tokens.length > 0) {
+ token = tokens.shift();
+
+ if (tail && tail.tag == '<' && !(token.tag in allowedInSuper)) {
+ throw new Error('Illegal content in < super tag.');
+ }
+
+ if (Hogan.tags[token.tag] <= Hogan.tags['$'] || isOpener(token, customTags)) {
+ stack.push(token);
+ token.nodes = buildTree(tokens, token.tag, stack, customTags);
+ } else if (token.tag == '/') {
+ if (stack.length === 0) {
+ throw new Error('Closing tag without opener: /' + token.n);
+ }
+ opener = stack.pop();
+ if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) {
+ throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n);
+ }
+ opener.end = token.i;
+ return instructions;
+ } else if (token.tag == '\n') {
+ token.last = (tokens.length == 0) || (tokens[0].tag == '\n');
+ }
+
+ instructions.push(token);
+ }
+
+ if (stack.length > 0) {
+ throw new Error('missing closing tag: ' + stack.pop().n);
+ }
+
+ return instructions;
+ }
+
+ function isOpener(token, tags) {
+ for (var i = 0, l = tags.length; i < l; i++) {
+ if (tags[i].o == token.n) {
+ token.tag = '#';
+ return true;
+ }
+ }
+ }
+
+ function isCloser(close, open, tags) {
+ for (var i = 0, l = tags.length; i < l; i++) {
+ if (tags[i].c == close && tags[i].o == open) {
+ return true;
+ }
+ }
+ }
+
+ function stringifySubstitutions(obj) {
+ var items = [];
+ for (var key in obj) {
+ items.push('"' + esc(key) + '": function(c,p,t,i) {' + obj[key] + '}');
+ }
+ return "{ " + items.join(",") + " }";
+ }
+
+ function stringifyPartials(codeObj) {
+ var partials = [];
+ for (var key in codeObj.partials) {
+ partials.push('"' + esc(key) + '":{name:"' + esc(codeObj.partials[key].name) + '", ' + stringifyPartials(codeObj.partials[key]) + "}");
+ }
+ return "partials: {" + partials.join(",") + "}, subs: " + stringifySubstitutions(codeObj.subs);
+ }
+
+ Hogan.stringify = function(codeObj, text, options) {
+ return "{code: function (c,p,i) { " + Hogan.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}";
+ }
+
+ var serialNo = 0;
+ Hogan.generate = function(tree, text, options) {
+ serialNo = 0;
+ var context = { code: '', subs: {}, partials: {} };
+ Hogan.walk(tree, context);
+
+ if (options.asString) {
+ return this.stringify(context, text, options);
+ }
+
+ return this.makeTemplate(context, text, options);
+ }
+
+ Hogan.wrapMain = function(code) {
+ return 'var t=this;t.b(i=i||"");' + code + 'return t.fl();';
+ }
+
+ Hogan.template = Hogan.Template;
+
+ Hogan.makeTemplate = function(codeObj, text, options) {
+ var template = this.makePartials(codeObj);
+ template.code = new Function('c', 'p', 'i', this.wrapMain(codeObj.code));
+ return new this.template(template, text, this, options);
+ }
+
+ Hogan.makePartials = function(codeObj) {
+ var key, template = {subs: {}, partials: codeObj.partials, name: codeObj.name};
+ for (key in template.partials) {
+ template.partials[key] = this.makePartials(template.partials[key]);
+ }
+ for (key in codeObj.subs) {
+ template.subs[key] = new Function('c', 'p', 't', 'i', codeObj.subs[key]);
+ }
+ return template;
+ }
+
+ function esc(s) {
+ return s.replace(rSlash, '\\\\')
+ .replace(rQuot, '\\\"')
+ .replace(rNewline, '\\n')
+ .replace(rCr, '\\r')
+ .replace(rLineSep, '\\u2028')
+ .replace(rParagraphSep, '\\u2029');
+ }
+
+ function chooseMethod(s) {
+ return (~s.indexOf('.')) ? 'd' : 'f';
+ }
+
+ function createPartial(node, context) {
+ var prefix = "<" + (context.prefix || "");
+ var sym = prefix + node.n + serialNo++;
+ context.partials[sym] = {name: node.n, partials: {}};
+ context.code += 't.b(t.rp("' + esc(sym) + '",c,p,"' + (node.indent || '') + '"));';
+ return sym;
+ }
+
+ Hogan.codegen = {
+ '#': function(node, context) {
+ context.code += 'if(t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),' +
+ 'c,p,0,' + node.i + ',' + node.end + ',"' + node.otag + " " + node.ctag + '")){' +
+ 't.rs(c,p,' + 'function(c,p,t){';
+ Hogan.walk(node.nodes, context);
+ context.code += '});c.pop();}';
+ },
+
+ '^': function(node, context) {
+ context.code += 'if(!t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,1,0,0,"")){';
+ Hogan.walk(node.nodes, context);
+ context.code += '};';
+ },
+
+ '>': createPartial,
+ '<': function(node, context) {
+ var ctx = {partials: {}, code: '', subs: {}, inPartial: true};
+ Hogan.walk(node.nodes, ctx);
+ var template = context.partials[createPartial(node, context)];
+ template.subs = ctx.subs;
+ template.partials = ctx.partials;
+ },
+
+ '$': function(node, context) {
+ var ctx = {subs: {}, code: '', partials: context.partials, prefix: node.n};
+ Hogan.walk(node.nodes, ctx);
+ context.subs[node.n] = ctx.code;
+ if (!context.inPartial) {
+ context.code += 't.sub("' + esc(node.n) + '",c,p,i);';
+ }
+ },
+
+ '\n': function(node, context) {
+ context.code += write('"\\n"' + (node.last ? '' : ' + i'));
+ },
+
+ '_v': function(node, context) {
+ context.code += 't.b(t.v(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));';
+ },
+
+ '_t': function(node, context) {
+ context.code += write('"' + esc(node.text) + '"');
+ },
+
+ '{': tripleStache,
+
+ '&': tripleStache
+ }
+
+ function tripleStache(node, context) {
+ context.code += 't.b(t.t(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));';
+ }
+
+ function write(s) {
+ return 't.b(' + s + ');';
+ }
+
+ Hogan.walk = function(nodelist, context) {
+ var func;
+ for (var i = 0, l = nodelist.length; i < l; i++) {
+ func = Hogan.codegen[nodelist[i].tag];
+ func && func(nodelist[i], context);
+ }
+ return context;
+ }
+
+ Hogan.parse = function(tokens, text, options) {
+ options = options || {};
+ return buildTree(tokens, '', [], options.sectionTags || []);
+ }
+
+ Hogan.cache = {};
+
+ Hogan.cacheKey = function(text, options) {
+ return [text, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join('||');
+ }
+
+ Hogan.compile = function(text, options) {
+ options = options || {};
+ var key = Hogan.cacheKey(text, options);
+ var template = this.cache[key];
+
+ if (template) {
+ var partials = template.partials;
+ for (var name in partials) {
+ delete partials[name].instance;
+ }
+ return template;
+ }
+
+ template = this.generate(this.parse(this.scan(text, options.delimiters), text, options), text, options);
+ return this.cache[key] = template;
+ }
+})(typeof exports !== 'undefined' ? exports : Hogan);
+
+
+var Mustache = (function (Hogan) {
+
+ // Mustache.js has non-spec partial context behavior
+ function mustachePartial(name, context, partials, indent) {
+ var partialScope = this.f(name, context, partials, 0);
+ var cx = context;
+ if (partialScope) {
+ cx = cx.concat(partialScope);
+ }
+
+ return Hogan.Template.prototype.rp.call(this, name, cx, partials, indent);
+ }
+
+ var HoganTemplateWrapper = function(renderFunc, text, compiler){
+ this.rp = mustachePartial;
+ Hogan.Template.call(this, renderFunc, text, compiler);
+ };
+ HoganTemplateWrapper.prototype = Hogan.Template.prototype;
+
+ // Add a wrapper for Hogan's generate method. Mustache and Hogan keep
+ // separate caches, and Mustache returns wrapped templates.
+ var wrapper;
+ var HoganWrapper = function(){
+ this.cache = {};
+ this.generate = function(code, text, options) {
+ return new HoganTemplateWrapper(new Function('c', 'p', 'i', code), text, wrapper);
+ }
+ };
+ HoganWrapper.prototype = Hogan;
+ wrapper = new HoganWrapper();
+
+ return {
+ to_html: function(text, data, partials, sendFun) {
+ var template = wrapper.compile(text);
+ var result = template.render(data, partials);
+ if (!sendFun) {
+ return result;
+ }
+
+ sendFun(result);
+ }
+ }
+
+})(Hogan);
diff --git a/src/js/plyr.js b/src/js/plyr.js
new file mode 100644
index 00000000..c3055a12
--- /dev/null
+++ b/src/js/plyr.js
@@ -0,0 +1,1123 @@
+// ==========================================================================
+// Plyr
+// plyr.js v1.0.10
+// https://github.com/sampotts/plyr
+// ==========================================================================
+// Credits: http://paypal.github.io/accessible-html5-video-player/
+// ==========================================================================
+
+(function (api) {
+ "use strict";
+
+ // Globals
+ var fullscreen, config;
+
+ // Default config
+ var defaults = {
+ enabled: true,
+ debug: false,
+ seekInterval: 10,
+ volume: 5,
+ click: true,
+ selectors: {
+ container: ".player",
+ controls: ".player-controls",
+ buttons: {
+ play: "[data-player='play']",
+ pause: "[data-player='pause']",
+ restart: "[data-player='restart']",
+ rewind: "[data-player='rewind']",
+ forward: "[data-player='fast-forward']",
+ mute: "[data-player='mute']",
+ volume: "[data-player='volume']",
+ captions: "[data-player='captions']",
+ fullscreen: "[data-player='fullscreen']"
+ },
+ progress: {
+ container: ".player-progress",
+ buffer: ".player-progress-buffer",
+ played: ".player-progress-played"
+ },
+ captions: ".player-captions",
+ duration: ".player-duration",
+ seekTime: ".player-seek-time"
+ },
+ classes: {
+ video: "player-video",
+ videoWrapper: "player-video-wrapper",
+ audio: "player-audio",
+ stopped: "stopped",
+ playing: "playing",
+ muted: "muted",
+ captions: {
+ enabled: "captions-enabled",
+ active: "captions-active"
+ },
+ fullscreen: {
+ enabled: "fullscreen-enabled",
+ active: "fullscreen-active"
+ }
+ },
+ captions: {
+ defaultActive: false
+ },
+ fullscreen: {
+ enabled: true,
+ fallback: true
+ },
+ storage: {
+ enabled: true,
+ supported: function() {
+ try {
+ return "localStorage" in window && window.localStorage !== null;
+ }
+ catch(e) {
+ return false;
+ }
+ }
+ }
+ };
+
+ // Debugging
+ function _log(text, error) {
+ if(config.debug && window.console) {
+ console[(error ? "error" : "log")](text);
+ }
+ }
+
+ // Credits: http://paypal.github.io/accessible-html5-video-player/
+ // Unfortunately, due to scattered support, browser sniffing is required
+ function _browserSniff() {
+ var nAgt = navigator.userAgent,
+ browserName = navigator.appName,
+ fullVersion = ""+parseFloat(navigator.appVersion),
+ majorVersion = parseInt(navigator.appVersion,10),
+ nameOffset,
+ verOffset,
+ ix;
+
+ // MSIE 11
+ if ((navigator.appVersion.indexOf("Windows NT") !== -1) && (navigator.appVersion.indexOf("rv:11") !== -1)) {
+ browserName = "IE";
+ fullVersion = "11;";
+ }
+ // MSIE
+ else if ((verOffset=nAgt.indexOf("MSIE")) !== -1) {
+ browserName = "IE";
+ fullVersion = nAgt.substring(verOffset+5);
+ }
+ // Chrome
+ else if ((verOffset=nAgt.indexOf("Chrome")) !== -1) {
+ browserName = "Chrome";
+ fullVersion = nAgt.substring(verOffset+7);
+ }
+ // Safari
+ else if ((verOffset=nAgt.indexOf("Safari")) !== -1) {
+ browserName = "Safari";
+ fullVersion = nAgt.substring(verOffset+7);
+ if ((verOffset=nAgt.indexOf("Version")) !== -1) {
+ fullVersion = nAgt.substring(verOffset+8);
+ }
+ }
+ // Firefox
+ else if ((verOffset=nAgt.indexOf("Firefox")) !== -1) {
+ browserName = "Firefox";
+ fullVersion = nAgt.substring(verOffset+8);
+ }
+ // In most other browsers, "name/version" is at the end of userAgent
+ else if ( (nameOffset=nAgt.lastIndexOf(" ")+1) < (verOffset=nAgt.lastIndexOf("/")) ) {
+ browserName = nAgt.substring(nameOffset,verOffset);
+ fullVersion = nAgt.substring(verOffset+1);
+ if (browserName.toLowerCase()==browserName.toUpperCase()) {
+ browserName = navigator.appName;
+ }
+ }
+ // Trim the fullVersion string at semicolon/space if present
+ if ((ix=fullVersion.indexOf(";")) !== -1) {
+ fullVersion=fullVersion.substring(0,ix);
+ }
+ if ((ix=fullVersion.indexOf(" ")) !== -1) {
+ fullVersion=fullVersion.substring(0,ix);
+ }
+ // Get major version
+ majorVersion = parseInt(""+fullVersion,10);
+ if (isNaN(majorVersion)) {
+ fullVersion = ""+parseFloat(navigator.appVersion);
+ majorVersion = parseInt(navigator.appVersion,10);
+ }
+ // Return data
+ return [browserName, majorVersion];
+ }
+
+ // Replace all
+ function _replaceAll(string, find, replace) {
+ return string.replace(new RegExp(find.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), replace);
+ }
+
+ // Wrap an element
+ function _wrap(elements, wrapper) {
+ // Convert `elms` to an array, if necessary.
+ if (!elements.length) {
+ elements = [elements];
+ }
+
+ // Loops backwards to prevent having to clone the wrapper on the
+ // first element (see `child` below).
+ for (var i = elements.length - 1; i >= 0; i--) {
+ var child = (i > 0) ? wrapper.cloneNode(true) : wrapper;
+ var el = elements[i];
+
+ // Cache the current parent and sibling.
+ var parent = el.parentNode;
+ var sibling = el.nextSibling;
+
+ // Wrap the element (is automatically removed from its current
+ // parent).
+ child.appendChild(el);
+
+ // If the element had a sibling, insert the wrapper before
+ // the sibling to maintain the HTML structure; otherwise, just
+ // append it to the parent.
+ if (sibling) {
+ parent.insertBefore(child, sibling);
+ } else {
+ parent.appendChild(child);
+ }
+ }
+ }
+
+ // Toggle class on an element
+ function _toggleClass(element, name, state) {
+ if(element){
+ if(element.classList) {
+ element.classList[state ? "add" : "remove"](name);
+ }
+ else {
+ var className = (" " + element.className + " ").replace(/\s+/g, " ").replace(" " + name + " ", "");
+ element.className = className + (state ? " " + name : "");
+ }
+ }
+ }
+
+ // Bind event
+ function _on(element, event, callback) {
+ element.addEventListener(event, callback, false);
+ }
+
+ // Unbind event
+ function _off(element, event, callback) {
+ element.removeEventListener(event, callback, false);
+ }
+
+ // Get percentage
+ function _getPercentage(current, max) {
+ return Math.floor((current / max) * 100);
+ }
+
+ // Get click position relative to parent
+ // http://www.kirupa.com/html5/getting_mouse_click_position.htm
+ function _getClickPosition(event) {
+ var parentPosition = _fullscreen().isFullScreen() ? { x: 0, y: 0 } : _getPosition(event.currentTarget);
+
+ return {
+ x: event.clientX - parentPosition.x,
+ y: event.clientY - parentPosition.y
+ };
+ }
+ // Get element position
+ function _getPosition(element) {
+ var xPosition = 0;
+ var yPosition = 0;
+
+ while (element) {
+ xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft);
+ yPosition += (element.offsetTop - element.scrollTop + element.clientTop);
+ element = element.offsetParent;
+ }
+
+ return {
+ x: xPosition,
+ y: yPosition
+ };
+ }
+
+ // Deep extend/merge two Objects
+ // http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/
+ // Removed call to arguments.callee (used explicit function name instead)
+ function _extend(destination, source) {
+ for (var property in source) {
+ if (source[property] && source[property].constructor && source[property].constructor === Object) {
+ destination[property] = destination[property] || {};
+ _extend(destination[property], source[property]);
+ }
+ else {
+ destination[property] = source[property];
+ }
+ }
+ return destination;
+ }
+
+ // Fullscreen API
+ function _fullscreen() {
+ var fullscreen = {
+ supportsFullScreen: false,
+ isFullScreen: function() { return false; },
+ requestFullScreen: function() {},
+ cancelFullScreen: function() {},
+ fullScreenEventName: "",
+ element: null,
+ prefix: ""
+ },
+ browserPrefixes = "webkit moz o ms khtml".split(" ");
+
+ // check for native support
+ if (typeof document.cancelFullScreen != "undefined") {
+ fullscreen.supportsFullScreen = true;
+ }
+ else {
+ // check for fullscreen support by vendor prefix
+ for (var i = 0, il = browserPrefixes.length; i < il; i++ ) {
+ fullscreen.prefix = browserPrefixes[i];
+
+ if (typeof document[fullscreen.prefix + "CancelFullScreen"] != "undefined") {
+ fullscreen.supportsFullScreen = true;
+ break;
+ }
+ // Special case for MS (when isn't it?)
+ else if (typeof document.msExitFullscreen != "undefined" && document.msFullscreenEnabled) {
+ fullscreen.prefix = "ms";
+ fullscreen.supportsFullScreen = true;
+ break;
+ }
+ }
+ }
+
+ // Safari doesn't support the ALLOW_KEYBOARD_INPUT flag so set it to not supported
+ // https://bugs.webkit.org/show_bug.cgi?id=121496
+ if(fullscreen.prefix === "webkit" && !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)) {
+ fullscreen.supportsFullScreen = false;
+ }
+
+ // Update methods to do something useful
+ if (fullscreen.supportsFullScreen) {
+ // Yet again Microsoft awesomeness,
+ // Sometimes the prefix is "ms", sometimes "MS" to keep you on your toes
+ fullscreen.fullScreenEventName = (fullscreen.prefix == "ms" ? "MSFullscreenChange" : fullscreen.prefix + "fullscreenchange");
+
+ fullscreen.isFullScreen = function() {
+ switch (this.prefix) {
+ case "":
+ return document.fullScreen;
+ case "webkit":
+ return document.webkitIsFullScreen;
+ case "ms":
+ // Docs say document.msFullScreenElement returns undefined
+ // if no element is full screem but it returns null, cheers
+ // https://msdn.microsoft.com/en-us/library/ie/dn265028%28v=vs.85%29.aspx
+ return (document.msFullscreenElement !== null);
+ default:
+ return document[this.prefix + "FullScreen"];
+ }
+ };
+ fullscreen.requestFullScreen = function(element) {
+ return (this.prefix === "") ? element.requestFullScreen() : element[this.prefix + (this.prefix == "ms" ? "RequestFullscreen" : "RequestFullScreen")](this.prefix === "webkit" ? element.ALLOW_KEYBOARD_INPUT : null);
+ };
+ fullscreen.cancelFullScreen = function() {
+ return (this.prefix === "") ? document.cancelFullScreen() : document[this.prefix + (this.prefix == "ms" ? "ExitFullscreen" : "CancelFullScreen")]();
+ };
+ fullscreen.element = function() {
+ return (this.prefix === "") ? document.fullscreenElement : document[this.prefix + "FullscreenElement"];
+ };
+ }
+
+ return fullscreen;
+ }
+
+ // Player instance
+ function Plyr(container) {
+ var player = this;
+ player.container = container;
+
+ // Captions functions
+ // Credits: http://paypal.github.io/accessible-html5-video-player/
+
+ // For "manual" captions, adjust caption position when play time changed (via rewind, clicking progress bar, etc.)
+ function _adjustManualCaptions() {
+ player.subcount = 0;
+ while (_timecodeMax(player.captions[player.subcount][0]) < player.media.currentTime.toFixed(1)) {
+ player.subcount++;
+ if (player.subcount > player.captions.length-1) {
+ player.subcount = player.captions.length-1;
+ break;
+ }
+ }
+ }
+ // Display captions container and button (for initialization)
+ function _showCaptions() {
+ _toggleClass(player.container, config.classes.captions.enabled, true);
+
+ if (config.captions.defaultActive) {
+ _toggleClass(player.container, config.classes.captions.active, true);
+ player.buttons.captions.setAttribute("checked", "checked");
+ }
+ }
+ // Utilities for caption time codes
+ function _timecodeMin(tc) {
+ var tcpair = [];
+ tcpair = tc.split(" --> ");
+ return _subTcSecs(tcpair[0]);
+ }
+ function _timecodeMax(tc) {
+ var tcpair = [];
+ tcpair = tc.split(" --> ");
+ return _subTcSecs(tcpair[1]);
+ }
+ function _subTcSecs(tc) {
+ if (tc === null || tc === undefined) {
+ return 0;
+ }
+ else {
+ var tc1 = [],
+ tc2 = [],
+ seconds;
+ tc1 = tc.split(",");
+ tc2 = tc1[0].split(":");
+ seconds = Math.floor(tc2[0]*60*60) + Math.floor(tc2[1]*60) + Math.floor(tc2[2]);
+ return seconds;
+ }
+ }
+
+ // Find all elements
+ function _getElements(selector) {
+ return player.container.querySelectorAll(selector);
+ }
+
+ // Find a single element
+ function _getElement(selector) {
+ return _getElements(selector)[0];
+ }
+
+ // Determine if we're in an iframe
+ function _inFrame() {
+ try {
+ return window.self !== window.top;
+ }
+ catch (e) {
+ return true;
+ }
+ }
+
+ // Insert controls
+ function _injectControls() {
+ // Insert custom video controls
+ _log("Injecting custom controls.");
+
+ // Use specified html
+ // Need to do a default?
+ var html = config.html;
+
+ // Replace aria label instances
+ html = _replaceAll(html, "{aria-label}", config.playAriaLabel);
+
+ // Replace all id references
+ html = _replaceAll(html, "{id}", player.random);
+
+ // Inject into the container
+ player.container.insertAdjacentHTML("beforeend", html);
+ }
+
+ // Find the UI controls and store references
+ function _findElements() {
+ try {
+ player.controls = _getElement(config.selectors.controls);
+
+ // Buttons
+ player.buttons = {};
+ player.buttons.play = _getElement(config.selectors.buttons.play);
+ player.buttons.pause = _getElement(config.selectors.buttons.pause);
+ player.buttons.restart = _getElement(config.selectors.buttons.restart);
+ player.buttons.rewind = _getElement(config.selectors.buttons.rewind);
+ player.buttons.forward = _getElement(config.selectors.buttons.forward);
+ player.buttons.mute = _getElement(config.selectors.buttons.mute);
+ player.buttons.captions = _getElement(config.selectors.buttons.captions);
+ player.buttons.fullscreen = _getElement(config.selectors.buttons.fullscreen);
+
+ // Progress
+ player.progress = {};
+ player.progress.container = _getElement(config.selectors.progress.container);
+
+ // Progress - Buffering
+ player.progress.buffer = {};
+ player.progress.buffer.bar = _getElement(config.selectors.progress.buffer);
+ player.progress.buffer.text = player.progress.buffer.bar.getElementsByTagName("span")[0];
+
+ // Progress - Played
+ player.progress.played = {};
+ player.progress.played.bar = _getElement(config.selectors.progress.played);
+ player.progress.played.text = player.progress.played.bar.getElementsByTagName("span")[0];
+
+ // Volume
+ player.volume = _getElement(config.selectors.buttons.volume);
+
+ // Timing
+ player.duration = _getElement(config.selectors.duration);
+ player.seekTime = _getElements(config.selectors.seekTime);
+
+ return true;
+ }
+ catch(e) {
+ _log("It looks like there's a problem with your controls html. Bailing.", true);
+ return false;
+ }
+ }
+
+ // Setup media
+ function _setupMedia() {
+ player.media = player.container.querySelectorAll("audio, video")[0];
+
+ // If there's no media, bail
+ if(!player.media) {
+ _log("No audio or video element found!", true);
+ return false;
+ }
+
+ // Remove native video controls
+ player.media.removeAttribute("controls");
+
+ // Set media type
+ player.type = (player.media.tagName.toLowerCase() == "video" ? "video" : "audio");
+
+ // Add type class
+ _toggleClass(player.container, config.classes[player.type], true);
+
+ // If there's no autoplay attribute, assume the video is stopped and add state class
+ _toggleClass(player.container, config.classes.stopped, (player.media.getAttribute("autoplay") === null));
+
+ // Inject the player wrapper
+ if(player.type === "video") {
+ // Create the wrapper div
+ var wrapper = document.createElement("div");
+ wrapper.setAttribute("class", config.classes.videoWrapper);
+
+ // Wrap the video in a container
+ _wrap(player.media, wrapper);
+
+ // Cache the container
+ player.videoContainer = wrapper;
+ }
+ }
+
+ // Setup captions
+ function _setupCaptions() {
+ if(player.type === "video") {
+ // Inject the container
+ player.videoContainer.insertAdjacentHTML("afterbegin", "<div class='" + config.selectors.captions.replace(".", "") + "'></div>");
+
+ // Cache selector
+ player.captionsContainer = _getElement(config.selectors.captions);
+
+ // Determine if HTML5 textTracks is supported
+ player.isTextTracks = false;
+ if (player.media.textTracks) {
+ player.isTextTracks = true;
+ }
+
+ // Get URL of caption file if exists
+ var captionSrc = "",
+ kind,
+ children = player.media.childNodes;
+
+ for (var i = 0; i < children.length; i++) {
+ if (children[i].nodeName.toLowerCase() === "track") {
+ kind = children[i].getAttribute("kind");
+ if (kind === "captions") {
+ captionSrc = children[i].getAttribute("src");
+ }
+ }
+ }
+
+ // Record if caption file exists or not
+ player.captionExists = true;
+ if (captionSrc === "") {
+ player.captionExists = false;
+ _log("No caption track found.");
+ }
+ else {
+ _log("Caption track found; URI: " + captionSrc);
+ }
+
+ // If no caption file exists, hide container for caption text
+ if (!player.captionExists) {
+ _toggleClass(player.container, config.classes.captions.enabled);
+ }
+ // If caption file exists, process captions
+ else {
+ // Turn off native caption rendering to avoid double captions
+ // This doesn't seem to work in Safari 7+, so the <track> elements are removed from the dom below
+ var tracks = player.media.textTracks;
+ for (var x=0; x < tracks.length; x++) {
+ tracks[x].mode = "hidden";
+ }
+
+ // Enable UI
+ _showCaptions(player);
+
+ // If IE 10/11 or Firefox 31+ or Safari 7+, don"t use native captioning (still doesn"t work although they claim it"s now supported)
+ if ((player.browserName === "IE" && player.browserMajorVersion === 10) ||
+ (player.browserName === "IE" && player.browserMajorVersion === 11) ||
+ (player.browserName === "Firefox" && player.browserMajorVersion >= 31) ||
+ (player.browserName === "Safari" && player.browserMajorVersion >= 7)) {
+ // Debugging
+ _log("Detected IE 10/11 or Firefox 31+ or Safari 7+.");
+
+ // Set to false so skips to "manual" captioning
+ player.isTextTracks = false;
+ }
+
+ // Rendering caption tracks
+ // Native support required - http://caniuse.com/webvtt
+ if (player.isTextTracks) {
+ _log("TextTracks supported.");
+
+ for (var y=0; y < tracks.length; y++) {
+ var track = tracks[y];
+
+ if (track.kind === "captions") {
+ _on(track, "cuechange", function() {
+ if (this.activeCues[0]) {
+ if (this.activeCues[0].hasOwnProperty("text")) {
+ player.captionsContainer.innerHTML = this.activeCues[0].text;
+ }
+ }
+ });
+ }
+ }
+ }
+ // Caption tracks not natively supported
+ else {
+ _log("TextTracks not supported so rendering captions manually.");
+
+ // Render captions from array at appropriate time
+ player.currentCaption = "";
+ player.subcount = 0;
+ player.captions = [];
+
+ _on(player.media, "timeupdate", function() {
+ // Check if the next caption is in the current time range
+ if (player.media.currentTime.toFixed(1) > _timecodeMin(player.captions[player.subcount][0]) &&
+ player.media.currentTime.toFixed(1) < _timecodeMax(player.captions[player.subcount][0])) {
+ player.currentCaption = player.captions[player.subcount][1];
+ }
+ // Is there a next timecode?
+ if (player.media.currentTime.toFixed(1) > _timecodeMax(player.captions[player.subcount][0]) &&
+ player.subcount < (player.captions.length-1)) {
+ player.subcount++;
+ }
+ // Render the caption
+ player.captionsContainer.innerHTML = player.currentCaption;
+ });
+
+ if (captionSrc !== "") {
+ // Create XMLHttpRequest Object
+ var xhr = new XMLHttpRequest();
+
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ if (xhr.status === 200) {
+ var records = [],
+ record,
+ req = xhr.responseText;
+
+ records = req.split("\n\n");
+
+ for (var r=0; r < records.length; r++) {
+ record = records[r];
+ player.captions[r] = [];
+ player.captions[r] = record.split("\n");
+ }
+
+ // Remove first element ("VTT")
+ player.captions.shift();
+
+ _log("Successfully loaded the caption file via AJAX.");
+ }
+ else {
+ _log("There was a problem loading the caption file via AJAX.", true);
+ }
+ }
+ }
+
+ xhr.open("get", captionSrc, true);
+
+ xhr.send();
+ }
+ }
+
+ // If Safari 7+, removing track from DOM [see "turn off native caption rendering" above]
+ if (player.browserName === "Safari" && player.browserMajorVersion >= 7) {
+ _log("Safari 7+ detected; removing track from DOM.");
+
+ // Find all <track> elements
+ tracks = player.media.getElementsByTagName("track");
+
+ // Loop through and remove one by one
+ for (var t=0; t < tracks.length; t++) {
+ player.media.removeChild(tracks[t]);
+ }
+ }
+ }
+ }
+ }
+
+ // Setup seeking
+ function _setupSeeking() {
+ // Update number of seconds in rewind and fast forward buttons
+ player.seekTime[0].innerHTML = config.seekInterval;
+ player.seekTime[1].innerHTML = config.seekInterval;
+ }
+
+ // Setup fullscreen
+ function _setupFullscreen() {
+ if(player.type === "video" && config.fullscreen.enabled) {
+ // Check for native support
+ var nativeSupport = fullscreen.supportsFullScreen;
+
+ if(nativeSupport || (config.fullscreen.fallback && !_inFrame())) {
+ _log((nativeSupport ? "Native" : "Fallback") + " fullscreen enabled.");
+
+ // Add styling hook
+ _toggleClass(player.container, config.classes.fullscreen.enabled, true);
+ }
+ else {
+ _log("Fullscreen not supported and fallback disabled.");
+ }
+ }
+ }
+
+ // Play media
+ function _play() {
+ player.media.play();
+
+ _toggleClass(player.container, config.classes.stopped);
+ _toggleClass(player.container, config.classes.playing, true);
+ }
+
+ // Pause media
+ function _pause() {
+ player.media.pause();
+
+ _toggleClass(player.container, config.classes.playing);
+ _toggleClass(player.container, config.classes.stopped, true);
+ }
+
+ // Restart playback
+ function _restart() {
+ // Move to beginning
+ player.media.currentTime = 0;
+
+ // Special handling for "manual" captions
+ if (!player.isTextTracks) {
+ player.subcount = 0;
+ }
+
+ // Play and ensure the play button is in correct state
+ _play();
+ }
+
+ // Rewind
+ function _rewind(seekInterval) {
+ // Use default if needed
+ if(typeof seekInterval === "undefined") {
+ seekInterval = config.seekInterval;
+ }
+
+ var targetTime = player.media.currentTime - seekInterval;
+
+ if (targetTime < 0) {
+ player.media.currentTime = 0;
+ }
+ else {
+ player.media.currentTime = targetTime;
+ }
+ // Special handling for "manual" captions
+ if (!player.isTextTracks && player.type === "video") {
+ _adjustManualCaptions(player);
+ }
+ }
+
+ // Fast forward
+ function _forward(seekInterval) {
+ // Use default if needed
+ if(typeof seekInterval === "undefined") {
+ seekInterval = config.seekInterval;
+ }
+
+ var targetTime = player.media.currentTime + seekInterval;
+
+ if (targetTime > player.media.duration) {
+ player.media.currentTime = player.media.duration;
+ }
+ else {
+ player.media.currentTime = targetTime;
+ }
+ // Special handling for "manual" captions
+ if (!player.isTextTracks && player.type === "video") {
+ _adjustManualCaptions(player);
+ }
+ }
+
+ // Toggle fullscreen
+ function _toggleFullscreen() {
+ // Check for native support
+ var nativeSupport = fullscreen.supportsFullScreen;
+
+ // If it's a fullscreen change event, it's probably a native close
+ if(event.type === fullscreen.fullScreenEventName) {
+ config.fullscreen.active = fullscreen.isFullScreen();
+ }
+ // If there's native support, use it
+ else if(nativeSupport) {
+ // Request fullscreen
+ if(!fullscreen.isFullScreen()) {
+ fullscreen.requestFullScreen(player.container);
+ }
+ // Bail from fullscreen
+ else {
+ fullscreen.cancelFullScreen();
+ }
+
+ // Check if we're actually full screen (it could fail)
+ config.fullscreen.active = fullscreen.isFullScreen();
+ }
+ else {
+ // Otherwise, it's a simple toggle
+ config.fullscreen.active = !config.fullscreen.active;
+
+ // Bind/unbind escape key
+ if(config.fullscreen.active) {
+ _on(document, "keyup", _handleEscapeFullscreen);
+ document.body.style.overflow = "hidden";
+ }
+ else {
+ _off(document, "keyup", _handleEscapeFullscreen);
+ document.body.style.overflow = "";
+ }
+ }
+
+ // Set class hook
+ _toggleClass(player.container, config.classes.fullscreen.active, config.fullscreen.active);
+ }
+
+ // Bail from faux-fullscreen
+ function _handleEscapeFullscreen(event) {
+ // If it's a keypress and not escape, bail
+ if((event.which || event.charCode || event.keyCode) === 27 && config.fullscreen.active) {
+ _toggleFullscreen();
+ }
+ }
+
+ // Set volume
+ function _setVolume(volume) {
+ // Use default if needed
+ if(typeof volume === "undefined") {
+ if(config.storage.enabled && config.storage.supported) {
+ volume = window.localStorage.plyr_volume || config.volume;
+ }
+ else {
+ volume = config.volume;
+ }
+ }
+ // Maximum is 10
+ if(volume > 10) {
+ volume = 10;
+ }
+
+ player.volume.value = volume;
+ player.media.volume = parseFloat(volume / 10);
+ _checkMute();
+
+ // Store the volume in storage
+ if(config.storage.enabled && config.storage.supported) {
+ window.localStorage.plyr_volume = volume;
+ }
+ }
+
+ // Mute
+ function _toggleMute(muted) {
+ // If the method is called without parameter, toggle based on current value
+ if(typeof active === "undefined") {
+ muted = !player.media.muted;
+ player.buttons.mute.checked = muted;
+ }
+
+ player.media.muted = muted;
+ _checkMute();
+ }
+
+ // Toggle captions
+ function _toggleCaptions(active) {
+ // If the method is called without parameter, toggle based on current value
+ if(typeof active === "undefined") {
+ active = (player.container.className.indexOf(config.classes.captions.active) === -1);
+ player.buttons.captions.checked = active;
+ }
+
+ if (active) {
+ _toggleClass(player.container, config.classes.captions.active, true);
+ }
+ else {
+ _toggleClass(player.container, config.classes.captions.active);
+ }
+ }
+
+ // Check mute state
+ function _checkMute() {
+ _toggleClass(player.container, config.classes.muted, (player.media.volume === 0 || player.media.muted));
+ }
+
+ // Update <progress> elements
+ function _updateProgress(event) {
+ var progress, text, value = 0;
+
+ switch(event.type) {
+ // Video playing
+ case "timeupdate":
+ progress = player.progress.played.bar;
+ text = player.progress.played.text;
+ value = _getPercentage(player.media.currentTime, player.media.duration);
+ break;
+
+ // Check buffer status
+ case "playing":
+ case "progress":
+ progress = player.progress.buffer.bar;
+ text = player.progress.buffer.text;
+ value = (function() {
+ var buffered = player.media.buffered;
+
+ if(buffered.length) {
+ return _getPercentage(buffered.end(0), player.media.duration);
+ }
+
+ return 0;
+ })();
+ break;
+ }
+
+ if (progress && value > 0) {
+ progress.value = value;
+ text.innerHTML = value;
+ }
+ }
+
+ // Update the displayed play time
+ function _updateTimeDisplay() {
+ player.secs = parseInt(player.media.currentTime % 60);
+ player.mins = parseInt((player.media.currentTime / 60) % 60);
+
+ // Ensure it"s two digits. For example, 03 rather than 3.
+ player.secs = ("0" + player.secs).slice(-2);
+ player.mins = ("0" + player.mins).slice(-2);
+
+ // Render
+ player.duration.innerHTML = player.mins + ":" + player.secs;
+ }
+
+ // Listen for events
+ function _listeners() {
+ // Play
+ _on(player.buttons.play, "click", function() {
+ _play();
+ player.buttons.pause.focus();
+ });
+
+ // Pause
+ _on(player.buttons.pause, "click", function() {
+ _pause();
+ player.buttons.play.focus();
+ });
+
+ // Restart
+ _on(player.buttons.restart, "click", _restart);
+
+ // Rewind
+ _on(player.buttons.rewind, "click", function() {
+ _rewind(config.seekInterval);
+ });
+
+ // Fast forward
+ _on(player.buttons.forward, "click", function() {
+ _forward(config.seekInterval);
+ });
+
+ // Get the HTML5 range input element and append audio volume adjustment on change
+ _on(player.volume, "change", function() {
+ _setVolume(this.value);
+ });
+
+ // Mute
+ _on(player.buttons.mute, "change", function() {
+ _toggleMute(this.checked);
+ });
+
+ // Fullscreen
+ _on(player.buttons.fullscreen, "click", _toggleFullscreen);
+
+ // Handle user exiting fullscreen by escaping etc
+ _on(document, fullscreen.fullScreenEventName, _toggleFullscreen);
+
+ // Click video
+ if(player.type === "video" && config.click) {
+ _on(player.videoContainer, "click", function() {
+ if(player.media.paused) {
+ _play();
+ }
+ else if(player.media.ended) {
+ _restart();
+ }
+ else {
+ _pause();
+ }
+ });
+ }
+
+ // Duration
+ _on(player.media, "timeupdate", _updateTimeDisplay);
+
+ // Playing progress
+ _on(player.media, "timeupdate", _updateProgress);
+
+ // Skip when clicking progress bar
+ _on(player.progress.played.bar, "click", function(event) {
+ player.pos = _getClickPosition(event).x / this.offsetWidth;
+ player.media.currentTime = player.pos * player.media.duration;
+
+ // Special handling for "manual" captions
+ if (!player.isTextTracks && player.type === "video") {
+ _adjustManualCaptions(player);
+ }
+ });
+
+ // Captions
+ _on(player.buttons.captions, "click", function() {
+ _toggleCaptions(this.checked);
+ });
+
+ // Clear captions at end of video
+ _on(player.media, "ended", function() {
+ if(player.type === "video") {
+ player.captionsContainer.innerHTML = "";
+ }
+ _toggleClass(player.container, config.classes.stopped, true);
+ _toggleClass(player.container, config.classes.playing);
+ });
+
+ // Check for buffer progress
+ _on(player.media, "progress", _updateProgress);
+ // Also check on start of playing
+ _on(player.media, "playing", _updateProgress);
+ }
+
+ function _init() {
+ // Setup the fullscreen api
+ fullscreen = _fullscreen();
+
+ // Sniff
+ player.browserInfo = _browserSniff();
+ player.browserName = player.browserInfo[0];
+ player.browserMajorVersion = player.browserInfo[1];
+
+ // Debug info
+ _log(player.browserName + " " + player.browserMajorVersion);
+
+ // If IE8, stop customization (use fallback)
+ // If IE9, stop customization (use native controls)
+ if (player.browserName === "IE" && (player.browserMajorVersion === 8 || player.browserMajorVersion === 9) ) {
+ _log("Browser not suppported.", true);
+ return false;
+ }
+
+ // Set up aria-label for Play button with the title option
+ if (typeof(config.title) === "undefined" || !config.title.length) {
+ config.playAriaLabel = "Play";
+ }
+ else {
+ config.playAriaLabel = "Play " + config.title;
+ }
+
+ // Setup media
+ _setupMedia();
+
+ // Generate random number for id/for attribute values for controls
+ player.random = Math.floor(Math.random() * (10000));
+
+ // Inject custom controls
+ _injectControls();
+
+ // Find the elements
+ if(!_findElements()) {
+ return false;
+ }
+
+ // Captions
+ _setupCaptions();
+
+ // Set volume
+ _setVolume();
+
+ // Setup fullscreen
+ _setupFullscreen();
+
+ // Seeking
+ _setupSeeking();
+
+ // Listeners
+ _listeners();
+ }
+
+ _init();
+
+ return {
+ media: player.media,
+ play: _play,
+ pause: _pause,
+ restart: _restart,
+ rewind: _rewind,
+ forward: _forward,
+ setVolume: _setVolume,
+ toggleMute: _toggleMute,
+ toggleCaptions: _toggleCaptions
+ }
+ }
+
+ // Expose setup function
+ api.setup = function(options){
+ // Extend the default options with user specified
+ config = _extend(defaults, options);
+
+ // If enabled carry on
+ // You may want to disable certain UAs etc
+ if(!config.enabled) {
+ return false;
+ }
+
+ // Get the players
+ var elements = document.querySelectorAll(config.selectors.container), players = [];
+
+ // Create a player instance for each element
+ for (var i = elements.length - 1; i >= 0; i--) {
+ // Get the current element
+ var element = elements[i];
+
+ // Setup a player instance and add to the element
+ if(typeof element.plyr === "undefined") {
+ element.plyr = new Plyr(element);
+ }
+
+ // Add to return array
+ players.push(element.plyr);
+ }
+
+ return players;
+ }
+}(this.plyr = this.plyr || {})); \ No newline at end of file
diff --git a/src/less/docs.less b/src/less/docs.less
new file mode 100644
index 00000000..65639769
--- /dev/null
+++ b/src/less/docs.less
@@ -0,0 +1,140 @@
+// ==========================================================================
+// HTML5 Video Player Demo Page
+// ==========================================================================
+
+// Reset
+@import "docs/normalize.less";
+// Mixins
+@import "docs/mixins.less";
+
+// Variables
+// ---------------------------------------
+// Colors
+@blue: #3498DB;
+@gray-dark: #343f4a;
+@gray: #565d64;
+@gray-light: #cbd0d3;
+
+// Elements
+@link-color: @blue;
+@padding-base: 20px;
+
+// Breakpoints
+@screen-md: 768px;
+
+// BORDER-BOX ALL THE THINGS!
+// http://paulirish.com/2012/box-sizing-border-box-ftw/
+*, *::after, *::before {
+ box-sizing: border-box;
+}
+
+// Base
+html {
+ //font-size: 62.5%;
+}
+body {
+ font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
+ background: #fff;
+ line-height: 1.5;
+ text-align: center;
+ color: #6D797F;
+}
+
+// Type
+h1,
+h2 {
+ letter-spacing: -.025em;
+ color: #2E3C44;
+ margin: 0 0 (@padding-base / 2);
+ line-height: 1.2;
+ .font-smoothing();
+}
+h1 {
+ .font-size(64);
+ color: #3498DB;
+}
+p,
+small {
+ margin: 0 0 @padding-base;
+}
+small {
+ display: block;
+ padding: 0 (@padding-base / 2);
+ .font-size(14);
+}
+
+// Header
+header {
+ padding: @padding-base;
+ margin-bottom: @padding-base;
+
+ p {
+ .font-size(18);
+ }
+ @media (min-width: 560px) {
+ padding-top: (@padding-base * 3);
+ padding-bottom: (@padding-base * 3);
+ }
+}
+
+// Sections
+section {
+ padding-bottom: @padding-base;
+
+ @media (min-width: 560px) {
+ padding-bottom: (@padding-base * 2);
+ }
+}
+
+// Links & Buttons
+a {
+ text-decoration: none;
+ color: @link-color;
+ border-bottom: 1px solid currentColor;
+ transition: all .3s ease;
+
+ &:hover,
+ &:focus {
+ color: #000;
+ }
+ &:focus {
+ .tab-focus();
+ }
+}
+.btn {
+ display: inline-block;
+ padding: (@padding-base / 2) (@padding-base * 1.5);
+ background: @link-color;
+ border: 0;
+ color: #fff;
+ .font-smoothing(on);
+ font-weight: 600;
+ border-radius: 3px;
+
+ &:hover,
+ &:focus {
+ color: #fff;
+ background: darken(@link-color, 5%);
+ }
+}
+
+// Players
+.example-audio .player {
+ max-width: 480px;
+}
+.example-video .player {
+ max-width: 1200px;
+}
+.example-audio .player,
+.example-video .player {
+ margin: 0 auto @padding-base;
+
+ &-fullscreen,
+ &.fullscreen-active {
+ max-width: none;
+ }
+}
+
+// Fonts
+// Last to not block rendering
+@import "docs/fontface.less"; \ No newline at end of file
diff --git a/src/less/docs/fontface.less b/src/less/docs/fontface.less
new file mode 100644
index 00000000..d4df4756
--- /dev/null
+++ b/src/less/docs/fontface.less
@@ -0,0 +1,16 @@
+@font-face {
+ font-family: "Avenir";
+ src: url("../../assets/fonts/AvenirLTStd-Medium.woff2") format("woff2"),
+ url("../../assets/fonts/AvenirLTStd-Medium.woff") format("woff"),
+ url("../../assets/fonts/AvenirLTStd-Medium.ttf") format("truetype");
+ font-style: normal;
+ font-weight: 400;
+}
+@font-face {
+ font-family: "Avenir";
+ src: url("../../assets/fonts/AvenirLTStd-Heavy.woff2") format("woff2"),
+ url("../../assets/fonts/AvenirLTStd-Heavy.woff") format("woff"),
+ url("../../assets/fonts/AvenirLTStd-Heavy.ttf") format("truetype");
+ font-style: normal;
+ font-weight: 600;
+} \ No newline at end of file
diff --git a/src/less/docs/mixins.less b/src/less/docs/mixins.less
new file mode 100644
index 00000000..b3a1f63b
--- /dev/null
+++ b/src/less/docs/mixins.less
@@ -0,0 +1,42 @@
+// ==========================================================================
+// Mixins
+// ==========================================================================
+
+// Contain floats: nicolasgallagher.com/micro-clearfix-hack/
+// ---------------------------------------
+.clearfix() {
+ zoom: 1;
+ &:before,
+ &:after { content: ""; display: table; }
+ &:after { clear: both; }
+}
+
+// Webkit-style focus
+// ---------------------------------------
+.tab-focus() {
+ // Default
+ outline: thin dotted @gray-dark;
+ // Webkit
+ //outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: 1px;
+}
+
+// Use rems for font sizing
+// Leave <body> at 100%/16px
+// ---------------------------------------
+.font-size(@font-size: 16){
+ @rem: round((@font-size / 16), 1);
+ font-size: (@font-size * 1px);
+ font-size: ~"@{rem}rem";
+}
+
+// Font smoothing
+// ---------------------------------------
+.font-smoothing(@mode: on) when (@mode = on) {
+ -moz-osx-font-smoothing: grayscale;
+ -webkit-font-smoothing: antialiased;
+}
+.font-smoothing(@mode: on) when (@mode = off) {
+ -moz-osx-font-smoothing: auto;
+ -webkit-font-smoothing: subpixel-antialiased;
+} \ No newline at end of file
diff --git a/src/less/docs/normalize.less b/src/less/docs/normalize.less
new file mode 100644
index 00000000..562891ab
--- /dev/null
+++ b/src/less/docs/normalize.less
@@ -0,0 +1,406 @@
+/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
+
+/* ==========================================================================
+ HTML5 display definitions
+ ========================================================================== */
+
+/**
+ * Correct `block` display not defined in IE 8/9.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/**
+ * Correct `inline-block` display not defined in IE 8/9.
+ */
+
+audio,
+canvas,
+video {
+ display: inline-block;
+}
+
+/**
+ * Prevent modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/**
+ * Address `[hidden]` styling not present in IE 8/9.
+ * Hide the `template` element in IE, Safari, and Firefox < 22.
+ */
+
+[hidden],
+template {
+ display: none;
+}
+
+/* ==========================================================================
+ Base
+ ========================================================================== */
+
+/**
+ * 1. Set default font family to sans-serif.
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
+ * user zoom.
+ */
+
+html {
+ font-family: sans-serif; /* 1 */
+ -ms-text-size-adjust: 100%; /* 2 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/**
+ * Remove default margin.
+ */
+
+body {
+ margin: 0;
+}
+
+/* ==========================================================================
+ Links
+ ========================================================================== */
+
+/**
+ * Remove the gray background color from active links in IE 10.
+ */
+
+a {
+ background: transparent;
+}
+
+/**
+ * Address `outline` inconsistency between Chrome and other browsers.
+ */
+
+a:focus {
+ outline: thin dotted;
+}
+
+/**
+ * Improve readability when focused and also mouse hovered in all browsers.
+ */
+
+a:active,
+a:hover {
+ outline: 0;
+}
+
+/* ==========================================================================
+ Typography
+ ========================================================================== */
+
+/**
+ * Address variable `h1` font-size and margin within `section` and `article`
+ * contexts in Firefox 4+, Safari 5, and Chrome.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+/**
+ * Address styling not present in IE 8/9, Safari 5, and Chrome.
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/**
+ * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
+ */
+
+b,
+strong {
+ font-weight: bold;
+}
+
+/**
+ * Address styling not present in Safari 5 and Chrome.
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/**
+ * Address differences between Firefox and other browsers.
+ */
+
+hr {
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ height: 0;
+}
+
+/**
+ * Address styling not present in IE 8/9.
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/**
+ * Correct font family set oddly in Safari 5 and Chrome.
+ */
+
+code,
+kbd,
+pre,
+samp {
+ font-family: monospace, serif;
+ font-size: 1em;
+}
+
+/**
+ * Improve readability of pre-formatted text in all browsers.
+ */
+
+pre {
+ white-space: pre-wrap;
+}
+
+/**
+ * Set consistent quote types.
+ */
+
+q {
+ quotes: "\201C" "\201D" "\2018" "\2019";
+}
+
+/**
+ * Address inconsistent and variable font size in all browsers.
+ */
+
+small {
+ font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+/* ==========================================================================
+ Embedded content
+ ========================================================================== */
+
+/**
+ * Remove border when inside `a` element in IE 8/9.
+ */
+
+img {
+ border: 0;
+}
+
+/**
+ * Correct overflow displayed oddly in IE 9.
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+/* ==========================================================================
+ Figures
+ ========================================================================== */
+
+/**
+ * Address margin not present in IE 8/9 and Safari 5.
+ */
+
+figure {
+ margin: 0;
+}
+
+/* ==========================================================================
+ Forms
+ ========================================================================== */
+
+/**
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/**
+ * 1. Correct `color` not being inherited in IE 8/9.
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * 1. Correct font family not being inherited in all browsers.
+ * 2. Correct font size not being inherited in all browsers.
+ * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
+ */
+
+button,
+input,
+select,
+textarea {
+ font-family: inherit; /* 1 */
+ font-size: 100%; /* 2 */
+ margin: 0; /* 3 */
+}
+
+/**
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+button,
+input {
+ line-height: normal;
+}
+
+/**
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
+ * All other form control elements do not inherit `text-transform` values.
+ * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
+ * Correct `select` style inheritance in Firefox 4+ and Opera.
+ */
+
+button,
+select {
+ text-transform: none;
+}
+
+/**
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ * and `video` controls.
+ * 2. Correct inability to style clickable `input` types in iOS.
+ * 3. Improve usability and consistency of cursor style between image-type
+ * `input` and others.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button; /* 2 */
+ cursor: pointer; /* 3 */
+}
+
+/**
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+html input[disabled] {
+ cursor: default;
+}
+
+/**
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
+ * 2. Remove excess padding in IE 8/9/10.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
+ * (include `-moz` to future-proof).
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box; /* 2 */
+ box-sizing: content-box;
+}
+
+/**
+ * Remove inner padding and search cancel button in Safari 5 and Chrome
+ * on OS X.
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/**
+ * Remove inner padding and border in Firefox 4+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/**
+ * 1. Remove default vertical scrollbar in IE 8/9.
+ * 2. Improve readability and alignment in all browsers.
+ */
+
+textarea {
+ overflow: auto; /* 1 */
+ vertical-align: top; /* 2 */
+}
+
+/* ==========================================================================
+ Tables
+ ========================================================================== */
+
+/**
+ * Remove most spacing between table cells.
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+} \ No newline at end of file
diff --git a/src/less/plyr.less b/src/less/plyr.less
new file mode 100644
index 00000000..c1facb67
--- /dev/null
+++ b/src/less/plyr.less
@@ -0,0 +1,431 @@
+// ==========================================================================
+// HTML5 Media Player
+// ==========================================================================
+
+// Variables
+// -------------------------------
+// Colors
+@blue: #3498DB;
+@gray-dark: #343f4a;
+@gray: #565d64;
+@gray-light: #cbd0d3;
+
+// Controls
+@controls-bg: @gray-dark;
+@control-color: @gray-light;
+@control-color-active: @blue;
+@control-color-inactive: @gray;
+@control-spacing: 10px;
+
+// Progress
+@progress-bg: lighten(@gray, 10%);
+@progress-playing-bg: @blue;
+@progress-buffered-bg: @gray;
+
+// Range
+@range-track-height: 6px;
+@range-track-bg: @gray;
+@range-thumb-height: (@range-track-height * 2);
+@range-thumb-width: (@range-track-height * 2);
+@range-thumb-bg: @control-color;
+@range-thumb-bg-focus: @control-color-active;
+
+// Breakpoints
+@bp-control-split: 560px; // When controls split into left/right
+@bg-captions-large: 768px; // When captions jump to the larger font size
+
+// Utility classes & mixins
+// -------------------------------
+// Screen reader only
+.sr-only {
+ position: absolute !important;
+ clip: rect(1px, 1px, 1px, 1px);
+ padding: 0 !important;
+ border: 0 !important;
+ height: 1px !important;
+ width: 1px !important;
+ overflow: hidden;
+}
+// Contain floats: nicolasgallagher.com/micro-clearfix-hack/
+.clearfix() {
+ zoom: 1;
+ &:before,
+ &:after { content: ""; display: table; }
+ &:after { clear: both; }
+}
+
+// Tab focus styles
+.tab-focus() {
+ outline: thin dotted #000;
+ outline-offset: 1px;
+}
+
+// Range styling
+// ---------------------------------------
+.range-thumb() {
+ height: @range-thumb-height;
+ width: @range-thumb-width;
+ background: @range-thumb-bg;
+ border: 0;
+ border-radius: (@range-thumb-height / 2);
+ transition: background .3s ease;
+ cursor: ew-resize;
+}
+.range-track() {
+ height: @range-track-height;
+ background: @range-track-bg;
+ border: 0;
+ border-radius: (@range-track-height / 2);
+}
+
+// Font smoothing
+// ---------------------------------------
+.font-smoothing(@mode: on) when (@mode = on) {
+ -moz-osx-font-smoothing: grayscale;
+ -webkit-font-smoothing: antialiased;
+}
+.font-smoothing(@mode: on) when (@mode = off) {
+ -moz-osx-font-smoothing: auto;
+ -webkit-font-smoothing: subpixel-antialiased;
+}
+
+// Styles
+// -------------------------------
+// Base
+.player {
+ position: relative;
+ max-width: 100%;
+ min-width: 290px;
+ overflow: hidden; // For the controls
+
+ // border-box everything
+ // http://paulirish.com/2012/box-sizing-border-box-ftw/
+ &,
+ *,
+ *::after,
+ *::before {
+ box-sizing: border-box;
+ }
+
+ // For video
+ &-video-wrapper {
+ position: relative;
+ }
+ video {
+ width: 100%;
+ height: auto;
+ vertical-align: middle;
+ }
+
+ // Captions
+ &-captions {
+ display: none;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ padding: 20px;
+ min-height: 2.5em;
+ color: #fff;
+ font-size: 16px;
+ font-weight: 600;
+ text-shadow:
+ -1px -1px 0 @gray,
+ 1px -1px 0 @gray,
+ -1px 1px 0 @gray,
+ 1px 1px 0 @gray;
+ text-align: center;
+ .font-smoothing();
+
+ @media (min-width: @bg-captions-large) {
+ font-size: 24px;
+ }
+ }
+ &.captions-active &-captions {
+ display: block;
+ }
+
+ // Player controls
+ &-controls {
+ .clearfix();
+ .font-smoothing();
+ position: relative;
+ padding: (@control-spacing * 2) @control-spacing @control-spacing;
+ background: @controls-bg;
+ line-height: 1;
+ text-align: center;
+
+ // Layout
+ &-sound {
+ display: block;
+ margin: @control-spacing auto 0;
+ }
+ @media (min-width: @bp-control-split) {
+ &-playback {
+ float: left;
+ }
+ &-sound {
+ float: right;
+ margin-top: 0;
+ }
+ }
+
+ input + label,
+ button {
+ display: inline-block;
+ vertical-align: middle;
+ margin: 0 2px;
+ padding: (@control-spacing / 2) @control-spacing;
+
+ transition: background .3s ease;
+ border-radius: 3px;
+ cursor: pointer;
+
+ svg {
+ width: 18px;
+ height: 18px;
+ display: block;
+ fill: currentColor;
+ transition: fill .3s ease;
+ }
+ }
+ input + label,
+ input.inverted:checked + label {
+ color: @control-color-inactive;
+ }
+ button,
+ input.inverted + label,
+ input:checked + label {
+ color: @control-color;
+ }
+ button {
+ border: 0;
+ background: transparent;
+ overflow: hidden;
+ }
+ input:focus + label,
+ button:focus {
+ .tab-focus();
+ color: #fff;
+ }
+ button:hover,
+ input + label:hover {
+ background: @control-color-active;
+ color: #fff;
+ }
+ .icon-exit-fullscreen,
+ .icon-muted {
+ display: none;
+ }
+ .player-time {
+ display: inline-block;
+ vertical-align: middle;
+ margin-left: @control-spacing;
+ color: #fff;
+ font-weight: 600;
+ font-size: 14px;
+ .font-smoothing();
+ }
+ }
+
+ // Player progress
+ // <progress> element
+ &-progress {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ width: 100%;
+ height: @control-spacing;
+ background: @progress-bg;
+
+ &-buffer,
+ &-played {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ vertical-align: top;
+
+ &[value] {
+ -webkit-appearance: none;
+ border: none;
+ background: transparent;
+
+
+ &::-webkit-progress-bar {
+ background: transparent;
+ }
+
+ // Inherit from currentColor;
+ &::-webkit-progress-value {
+ background: currentColor;
+ transition: width .1s ease;
+ }
+ &::-moz-progress-bar {
+ background: currentColor;
+ transition: width .1s ease;
+ }
+ }
+ }
+ &-played {
+ z-index: 2;
+ }
+ &-played[value] {
+ cursor: pointer;
+ color: @progress-playing-bg;
+ }
+ &-buffer[value] {
+ color: @progress-buffered-bg;
+ }
+ }
+
+ // States
+ &-controls [data-player='pause'],
+ &.playing .player-controls [data-player='play'] {
+ display: none;
+ }
+ &.playing .player-controls [data-player='pause'] {
+ display: inline-block;
+ }
+
+ // Muted
+ &.muted .player-controls .icon-muted {
+ display: block;
+
+ & + svg {
+ display: none;
+ }
+ }
+
+ // Volume control
+ // <input[type='range']> element
+ &-volume {
+ vertical-align: middle;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ //height: 6px;
+ width: 100px;
+ margin: 0 @control-spacing 0 0;
+ padding: 0;
+ cursor: pointer;
+ background: none;
+
+ // Webkit
+ &::-webkit-slider-runnable-track {
+ .range-track();
+ }
+ &::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ margin-top: -((@range-thumb-height - @range-track-height) / 2);
+ .range-thumb();
+ }
+
+ // Mozilla
+ &::-moz-range-track {
+ .range-track();
+ }
+ &::-moz-range-thumb {
+ .range-thumb();
+ }
+
+ // Microsoft
+ &::-ms-track {
+ height: @range-track-height;
+ background: transparent;
+ border-color: transparent;
+ border-width: ((@range-thumb-height - @range-track-height) / 2) 0;
+ color: transparent;
+ }
+ &::-ms-fill-lower,
+ &::-ms-fill-upper {
+ .range-track();
+ }
+ &::-ms-thumb {
+ .range-thumb();
+ }
+
+ &:focus {
+ outline: 0;
+
+ &::-webkit-slider-thumb {
+ background: @range-thumb-bg-focus;
+ }
+ &::-moz-range-thumb {
+ background: @range-thumb-bg-focus;
+ }
+ &::-ms-thumb {
+ background: @range-thumb-bg-focus;
+ }
+ }
+ }
+
+ // Full screen mode
+ &-fullscreen,
+ &.fullscreen-active {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: 100%;
+ width: 100%;
+ z-index: 10000000;
+
+ .player-video-wrapper {
+ height: 100%;
+ width: 100%;
+
+ video {
+ height: 100%;
+ }
+ .player-captions {
+ top: auto;
+ bottom: 90px;
+
+ @media (min-width: @bp-control-split) and (max-width: (@bg-captions-large - 1)) {
+ bottom: 60px;
+ }
+ @media (min-width: @bg-captions-large) {
+ bottom: 80px;
+ }
+ }
+ }
+ .player-controls {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+
+ .icon-exit-fullscreen {
+ display: block;
+
+ & + svg {
+ display: none;
+ }
+ }
+ }
+ }
+
+ // Some options are hidden by default
+ [data-player='captions'],
+ [data-player='captions'] + label,
+ [data-player='fullscreen'],
+ [data-player='fullscreen'] + label {
+ display: none;
+ }
+ &.captions-enabled [data-player='captions'],
+ &.captions-enabled [data-player='captions'] + label,
+ &.fullscreen-enabled [data-player='fullscreen'],
+ &.fullscreen-enabled [data-player='fullscreen'] + label {
+ display: inline-block;
+ }
+
+ // Full browser view hides toggle
+ &-fullscreen [data-player='fullscreen'],
+ &-fullscreen [data-player='fullscreen'] + label {
+ display: none !important;
+ }
+} \ No newline at end of file
diff --git a/src/sprite/icon-bubble.svg b/src/sprite/icon-bubble.svg
new file mode 100755
index 00000000..7090121a
--- /dev/null
+++ b/src/sprite/icon-bubble.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
+<path d="M9.016 3c2.748 0 4.984 2.243 4.984 5s-2.236 5-4.97 5l-0.060-0.004c-0.055-0.004-0.11-0.007-0.165-0.010l-0.336-0.014-3.665 1.098 0.629-2.483-0.517-0.747c-0.58-0.839-0.886-1.822-0.886-2.842 0-2.757 2.236-5 4.984-5zM9.016 1c-3.857 0-6.984 3.134-6.984 7 0 1.479 0.46 2.848 1.241 3.978l-1.272 5.022 6.722-2.015c0.098 0.004 0.194 0.015 0.293 0.015 3.857 0 6.984-3.134 6.984-7s-3.127-7-6.984-7v0z"></path>
+</svg>
diff --git a/src/sprite/icon-collapse.svg b/src/sprite/icon-collapse.svg
new file mode 100644
index 00000000..d41e0402
--- /dev/null
+++ b/src/sprite/icon-collapse.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+ <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
+ <title>collapse</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="Page-1" stroke="none" stroke-width="1">
+ <g id="collapse" sketch:type="MSLayerGroup" transform="translate(-1.000000, -1.000000)">
+ <path d="M15.00325,9.01 L15.00325,5.377 L16.29625,6.694 C16.68825,7.082 17.32125,7.082 17.71325,6.694 C18.10525,6.306 18.10425,5.678 17.71325,5.291 L14.74625,2.291 C14.55825,2.105 14.30425,2 14.03725,2 C14.02625,2 14.01425,2 14.00325,2.001 C13.99225,2.002 13.98025,2 13.96925,2 C13.70325,2 13.44825,2.105 13.26025,2.291 L10.29325,5.291 C9.90225,5.679 9.90225,6.307 10.29325,6.694 C10.68425,7.081 11.31825,7.082 11.71025,6.694 L13.00425,5.377 L13.00425,9.01 C13.00425,9.557 13.44725,10 13.99425,10 L14.01225,10 C14.55925,10 15.00225,9.557 15.00225,9.01 L15.00325,9.01 Z" id="Shape" sketch:type="MSShapeGroup" transform="translate(14.003438, 6.000000) rotate(-135.000000) translate(-14.003438, -6.000000) "></path>
+ <path d="M7.00668756,13.377 L8.29968756,14.694 C8.69168756,15.082 9.32468756,15.082 9.71668756,14.694 C10.1086876,14.306 10.1076876,13.678 9.71668756,13.291 L6.74968756,10.291 C6.56168756,10.105 6.30768756,10 6.04068756,10 C6.02968756,10 6.01768756,10 6.00668756,10.001 C5.99568756,10.002 5.98368756,10 5.97268756,10 C5.70668756,10 5.45168756,10.105 5.26368756,10.291 L2.29668756,13.291 C1.90568756,13.679 1.90568756,14.307 2.29668756,14.694 C2.68768756,15.081 3.32168756,15.082 3.71368756,14.694 L5.00768756,13.377 L5.00768756,17.01 C5.00768756,17.557 5.45068756,18 5.99768756,18 C6.56268756,18 7.00568756,17.557 7.00568756,17.01 L7.00668756,13.377 Z" id="Shape-2" sketch:type="MSShapeGroup" transform="translate(6.006875, 14.000000) rotate(45.000000) translate(-6.006875, -14.000000) "></path>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/src/sprite/icon-expand.svg b/src/sprite/icon-expand.svg
new file mode 100644
index 00000000..5fd651bd
--- /dev/null
+++ b/src/sprite/icon-expand.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+ <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
+ <title>expand</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="Page-1" stroke="none" stroke-width="1" sketch:type="MSPage">
+ <g id="expand" sketch:type="MSLayerGroup" transform="translate(-1.000000, -1.000000)">
+ <path d="M7.00325,17.01 L7.00325,13.377 L8.29625,14.694 C8.68825,15.082 9.32125,15.082 9.71325,14.694 C10.10525,14.306 10.10425,13.678 9.71325,13.291 L6.74625,10.291 C6.55825,10.105 6.30425,10 6.03725,10 C6.02625,10 6.01425,10 6.00325,10.001 C5.99225,10.002 5.98025,10 5.96925,10 C5.70325,10 5.44825,10.105 5.26025,10.291 L2.29325,13.291 C1.90225,13.679 1.90225,14.307 2.29325,14.694 C2.68425,15.081 3.31825,15.082 3.71025,14.694 L5.00425,13.377 L5.00425,17.01 C5.00425,17.557 5.44725,18 5.99425,18 L6.01225,18 C6.55925,18 7.00225,17.557 7.00225,17.01 L7.00325,17.01 Z" id="Shape" sketch:type="MSShapeGroup" transform="translate(6.003438, 14.000000) rotate(-135.000000) translate(-6.003438, -14.000000) "></path>
+ <path d="M15.0066876,5.377 L16.2996876,6.694 C16.6916876,7.082 17.3246876,7.082 17.7166876,6.694 C18.1086876,6.306 18.1076876,5.678 17.7166876,5.291 L14.7496876,2.291 C14.5616876,2.105 14.3076876,2 14.0406876,2 C14.0296876,2 14.0176876,2 14.0066876,2.001 C13.9956876,2.002 13.9836876,2 13.9726876,2 C13.7066876,2 13.4516876,2.105 13.2636876,2.291 L10.2966876,5.291 C9.90568756,5.679 9.90568756,6.307 10.2966876,6.694 C10.6876876,7.081 11.3216876,7.082 11.7136876,6.694 L13.0076876,5.377 L13.0076876,9.01 C13.0076876,9.557 13.4506876,10 13.9976876,10 C14.5626876,10 15.0056876,9.557 15.0056876,9.01 L15.0066876,5.377 Z" id="Shape-2" sketch:type="MSShapeGroup" transform="translate(14.006875, 6.000000) rotate(45.000000) translate(-14.006875, -6.000000) "></path>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/src/sprite/icon-fast-forward.svg b/src/sprite/icon-fast-forward.svg
new file mode 100755
index 00000000..cc4ee6d1
--- /dev/null
+++ b/src/sprite/icon-fast-forward.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
+<path d="M17.569 8.246l-10.569-6.246c-0.552 0-1 0.448-1 1v1.954l-5-2.954c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1l5-2.955v1.955c0 0.552 0.448 1 1 1l10.569-6.246c0.267-0.158 0.431-0.444 0.431-0.754s-0.164-0.597-0.431-0.754zM6 10.722l-4 2.364v-8.172l4 2.364v3.444zM8 13.086v-8.172l6.915 4.086-6.915 4.086z"></path>
+</svg>
diff --git a/src/sprite/icon-muted.svg b/src/sprite/icon-muted.svg
new file mode 100644
index 00000000..031da8d1
--- /dev/null
+++ b/src/sprite/icon-muted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+ <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
+ <title>muted</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="Page-1" stroke="none" stroke-width="1" sketch:type="MSPage">
+ <g id="sound" sketch:type="MSLayerGroup" transform="translate(0.000000, 2.000000)">
+ <path d="M9.214,0 C9.103,0 8.989,0.032 8.88,0.101 L4.832,2.911 C4.749,2.969 4.65,3 4.549,3 L0.996,3 C0.446,3 1.33226763e-15,3.448 1.33226763e-15,4 L1.33226763e-15,10 C1.33226763e-15,10.552 0.446,11 0.996,11 L4.549,11 C4.651,11 4.749,11.031 4.832,11.089 L8.88,13.899 C8.989,13.968 9.103,14 9.214,14 C9.606,14 9.961,13.6 9.961,13.051 L9.961,0.95 C9.961,0.4 9.606,0.001 9.214,0.001 L9.214,0 Z M7.969,10.834 L5.582,9.177 C5.416,9.062 5.218,8.999 5.016,8.999 L2.491,8.999 C2.216,8.999 1.993,8.775 1.993,8.499 L1.993,5.499 C1.993,5.223 2.216,4.999 2.491,4.999 L5.016,4.999 C5.218,4.999 5.416,4.937 5.582,4.821 L7.969,3.164 L7.969,10.833 L7.969,10.834 Z" id="Shape" sketch:type="MSShapeGroup"></path>
+ <path d="M14.934,6.799 C14.848,5.051 13.42,3.808 12.427,3.15 C11.957,2.838 11.333,3.028 11.102,3.558 L11.064,3.644 C10.876,4.075 11.019,4.583 11.4,4.838 C12.106,5.311 12.986,6.085 13.024,6.903 C13.056,7.579 12.471,8.371 11.361,9.173 C10.963,9.461 10.832,10.012 11.076,10.448 L11.118,10.523 C11.384,10.998 11.984,11.147 12.418,10.835 C14.158,9.584 15.004,8.229 14.934,6.798 L14.934,6.799 Z" id="Shape" sketch:type="MSShapeGroup"></path>
+ <path d="M17.934,6.799 C17.848,5.051 16.42,3.808 15.427,3.15 C14.957,2.838 14.333,3.028 14.102,3.558 L14.064,3.644 C13.876,4.075 14.019,4.583 14.4,4.838 C15.106,5.311 15.986,6.085 16.024,6.903 C16.056,7.579 15.471,8.371 14.361,9.173 C13.963,9.461 13.832,10.012 14.076,10.448 L14.118,10.523 C14.384,10.998 14.984,11.147 15.418,10.835 C17.158,9.584 18.004,8.229 17.934,6.798 L17.934,6.799 Z" id="Shape-2" sketch:type="MSShapeGroup" transform="translate(15.945467, 6.999165) rotate(-180.000000) translate(-15.945467, -6.999165) "></path>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/src/sprite/icon-pause.svg b/src/sprite/icon-pause.svg
new file mode 100644
index 00000000..ea2efe98
--- /dev/null
+++ b/src/sprite/icon-pause.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+ <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
+ <title>pause</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="Page-1" stroke="none" stroke-width="1" sketch:type="MSPage">
+ <g id="pause" sketch:type="MSLayerGroup" transform="translate(2.000000, 2.000000)">
+ <path d="M0,2 L0,12 C5.24848613e-17,14 2,14 2,14 L4,14 C4,14 6,14 6,12 C6,11.786438 6,11.572876 6,11 L6,2 C6,3.17446247e-09 4,0 4,0 L2,0 C2,0 0,0 0,2 Z M2,2 L4,2 L4,12 L2,12 L2,2 Z" id="Path-1" sketch:type="MSShapeGroup"></path>
+ <path d="M8,2 L8,12 C8,14 10,14 10,14 L12,14 C12,14 14,14 14,12 C14,11.786438 14,11.572876 14,11 L14,2 C14,3.17446247e-09 12,0 12,0 L10,0 C10,0 8,0 8,2 Z M10,2 L12,2 L12,12 L10,12 L10,2 Z" id="Path-2" sketch:type="MSShapeGroup"></path>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/src/sprite/icon-play.svg b/src/sprite/icon-play.svg
new file mode 100755
index 00000000..ebe9ff57
--- /dev/null
+++ b/src/sprite/icon-play.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
+<path d="M5 4.914l6.915 4.086-6.915 4.086v-8.172zM4 2c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1l10.569-6.246c0.267-0.158 0.431-0.444 0.431-0.754s-0.164-0.597-0.431-0.754l-10.569-6.246z"></path>
+</svg>
diff --git a/src/sprite/icon-refresh.svg b/src/sprite/icon-refresh.svg
new file mode 100755
index 00000000..10ffb198
--- /dev/null
+++ b/src/sprite/icon-refresh.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
+<path d="M8.013 14.006h-0.822c-2.372-0.388-4.187-2.453-4.187-4.934 0-0.831 0.213-1.609 0.574-2.299l0.613 0.85c0.446 0.618 1.409 0.446 1.614-0.289l1.162-4.179c0.162-0.58-0.275-1.155-0.877-1.154l-4.174 0.006c-0.741 0.001-1.17 0.841-0.736 1.443l1.128 1.564c-0.817 1.145-1.302 2.544-1.302 4.059 0 3.499 2.566 6.399 5.918 6.917 0.091 0.014 0.18 0.010 0.267-0.001v0.012h0.822c0.545 0 0.987-0.442 0.987-0.987v-0.020c0-0.545-0.442-0.987-0.987-0.987z"></path>
+<path d="M16.82 14.551l-1.129-1.564c0.818-1.145 1.302-2.544 1.302-4.059 0-3.499-2.566-6.399-5.918-6.918-0.091-0.014-0.18-0.010-0.267 0.001v-0.013h-0.822c-0.545 0-0.986 0.442-0.986 0.987v0.020c0 0.546 0.442 0.988 0.986 0.988h0.822c2.372 0.388 4.187 2.453 4.187 4.934 0 0.831-0.213 1.609-0.573 2.299l-0.614-0.85c-0.446-0.618-1.409-0.446-1.613 0.289l-1.163 4.179c-0.161 0.581 0.275 1.155 0.878 1.154l4.174-0.006c0.742-0.001 1.17-0.842 0.736-1.443z"></path>
+</svg>
diff --git a/src/sprite/icon-rewind.svg b/src/sprite/icon-rewind.svg
new file mode 100644
index 00000000..7be18d37
--- /dev/null
+++ b/src/sprite/icon-rewind.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="18px" height="21px" viewBox="0 0 18 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+ <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
+ <title>rewind</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="Page-1" stroke="none" stroke-width="1" sketch:type="MSPage">
+ <path d="M17.569,9.246 L7,3 C6.448,3 6,3.448 6,4 L6,5.954 L1,3 C0.448,3 0,3.448 0,4 L0,16 C0,16.552 0.448,17 1,17 L6,14.045 L6,16 C6,16.552 6.448,17 7,17 L17.569,10.754 C17.836,10.596 18,10.31 18,10 C18,9.69 17.836,9.403 17.569,9.246 L17.569,9.246 Z M6,11.722 L2,14.086 L2,5.914 L6,8.278 L6,11.722 L6,11.722 Z M8,14.086 L8,5.914 L14.915,10 L8,14.086 L8,14.086 Z" id="Shape" sketch:type="MSShapeGroup" transform="translate(9.000000, 10.000000) rotate(-180.000000) translate(-9.000000, -10.000000) "></path>
+ </g>
+</svg> \ No newline at end of file
diff --git a/src/sprite/icon-sound.svg b/src/sprite/icon-sound.svg
new file mode 100755
index 00000000..6c6ca54d
--- /dev/null
+++ b/src/sprite/icon-sound.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
+<path d="M10.214 2c-0.111 0-0.225 0.032-0.334 0.101l-4.048 2.81c-0.083 0.058-0.182 0.089-0.283 0.089h-3.553c-0.55 0-0.996 0.448-0.996 1v6c0 0.552 0.446 1 0.996 1h3.553c0.102 0 0.2 0.031 0.283 0.089l4.048 2.81c0.109 0.069 0.223 0.101 0.334 0.101 0.392 0 0.747-0.4 0.747-0.949v-12.101c0-0.55-0.355-0.949-0.747-0.949zM8.969 12.834l-2.387-1.657c-0.166-0.115-0.364-0.178-0.566-0.178h-2.525c-0.275 0-0.498-0.224-0.498-0.5v-3c0-0.276 0.223-0.5 0.498-0.5h2.525c0.202 0 0.4-0.062 0.566-0.178l2.387-1.657v7.669z"></path>
+<path d="M16.934 8.799c-0.086-1.748-1.514-2.991-2.507-3.649-0.47-0.312-1.094-0.122-1.325 0.408l-0.038 0.086c-0.188 0.431-0.045 0.939 0.336 1.194 0.706 0.473 1.586 1.247 1.624 2.065 0.032 0.676-0.553 1.468-1.663 2.27-0.398 0.288-0.529 0.839-0.285 1.275l0.042 0.075c0.266 0.475 0.866 0.624 1.3 0.312 1.74-1.251 2.586-2.606 2.516-4.037z"></path>
+</svg>
diff --git a/src/templates/controls.html b/src/templates/controls.html
new file mode 100644
index 00000000..3ae8d8c4
--- /dev/null
+++ b/src/templates/controls.html
@@ -0,0 +1,59 @@
+<div class="player-controls">
+ <div class="player-progress">
+ <progress class="player-progress-played" max="100" value="0">
+ <span>0</span>% played
+ </progress>
+ <progress class="player-progress-buffer" max="100" value="0">
+ <span>0</span>% buffered
+ </progress>
+ </div>
+ <span class="player-controls-playback">
+ <button type="button" data-player="restart">
+ <svg><use xlink:href="#icon-refresh"></use></svg>
+ <span class="sr-only">Restart</span>
+ </button>
+ <button type="button" data-player="rewind">
+ <svg><use xlink:href="#icon-rewind"></use></svg>
+ <span class="sr-only">Rewind <span class="player-seek-time">10</span> seconds</span>
+ </button>
+ <button type="button" aria-label="{aria-label}" data-player="play">
+ <svg><use xlink:href="#icon-play"></use></svg>
+ <span class="sr-only">Play</span>
+ </button>
+ <button type="button" data-player="pause">
+ <svg><use xlink:href="#icon-pause"></use></svg>
+ <span class="sr-only">Pause</span>
+ </button>
+ <button type="button" data-player="fast-forward">
+ <svg><use xlink:href="#icon-fast-forward"></use></svg>
+ <span class="sr-only">Fast forward <span class="player-seek-time">10</span> seconds</span>
+ </button>
+ <span class="player-time">
+ <span class="sr-only">Time</span>
+ <span class="player-duration">00:00</span>
+ </span>
+ </span>
+ <span class="player-controls-sound">
+ <input class="inverted sr-only" id="mute{id}" type="checkbox" data-player="mute">
+ <label id="mute{id}" for="mute{id}">
+ <svg class="icon-muted"><use xlink:href="#icon-muted"></use></svg>
+ <svg><use xlink:href="#icon-sound"></use></svg>
+ <span class="sr-only">Mute</span>
+ </label>
+
+ <label for="volume{id}" class="sr-only">Volume:</label>
+ <input id="volume{id}" class="player-volume" type="range" min="0" max="10" value="5" data-player="volume">
+
+ <input class="sr-only" id="captions{id}" type="checkbox" data-player="captions">
+ <label for="captions{id}">
+ <svg><use xlink:href="#icon-bubble"></use></svg>
+ <span class="sr-only">Captions</span>
+ </label>
+
+ <button type="button" data-player="fullscreen">
+ <svg class="icon-exit-fullscreen"><use xlink:href="#icon-collapse"></use></svg>
+ <svg><use xlink:href="#icon-expand"></use></svg>
+ <span class="sr-only">Toggle fullscreen</span>
+ </button>
+ </span>
+</div> \ No newline at end of file