Compare commits
567 Commits
Author | SHA1 | Date | |
---|---|---|---|
86b2f61b56 | |||
130fb78b4c | |||
3718ec69ba | |||
4610f4a8c9 | |||
a8062354ec | |||
aac0a5a3a9 | |||
92b9e3400b | |||
bea513f5dd | |||
9d109bf02d | |||
fc45ab48c9 | |||
58e9b02405 | |||
b578fb4840 | |||
f18d9589eb | |||
35c6ec9461 | |||
56d9730d0a | |||
6e18bc8b31 | |||
81756a1af9 | |||
05e1ab1165 | |||
a0ddc5e6eb | |||
dc40b1f93a | |||
d7cc29f2fb | |||
0505e49038 | |||
6ff1e47341 | |||
e72a91de6e | |||
52ec4c012d | |||
ae89c92ab6 | |||
57ad124ce8 | |||
a85d45d2e5 | |||
a6f57fc034 | |||
04c9653b86 | |||
b8cdc71001 | |||
277ebf0fd1 | |||
7682d998e7 | |||
05b9b9a831 | |||
eee699cec6 | |||
3c9e9862d8 | |||
39dc651a9d | |||
4effda125a | |||
bf9de231d8 | |||
ef12332505 | |||
1b735f1727 | |||
7f7ecf852e | |||
931672895f | |||
0952bc8239 | |||
7e7508ca82 | |||
095d100ba4 | |||
c61fad51c1 | |||
7b11c6803d | |||
9b75436380 | |||
be19b72719 | |||
2fdcc18356 | |||
6425a33ccd | |||
12c5dbd290 | |||
cb591dac0c | |||
4c1cdea56e | |||
80cfabbaf9 | |||
c7d28b09c0 | |||
161dd48312 | |||
383515c1b7 | |||
98792168e4 | |||
01437a4a38 | |||
03ed86f5c2 | |||
1a745e1eaa | |||
70646ca907 | |||
af774b6f02 | |||
7a9eac093a | |||
4afd311ef6 | |||
7eec6c6739 | |||
521431e093 | |||
24bc415faf | |||
552f448ccd | |||
152e94f229 | |||
cb318dd6ad | |||
9ee0d00a35 | |||
c0909095e3 | |||
1e732694eb | |||
30922246e9 | |||
edf5a14171 | |||
1c9f7901bc | |||
1bd6ffc84d | |||
845ed000fc | |||
c7b2347ccd | |||
a2f18c4e31 | |||
37c8948d2c | |||
351e1540c5 | |||
b3299b4641 | |||
be2e7d4c99 | |||
7238eab737 | |||
3c2921b994 | |||
179c6fca0b | |||
69194915d4 | |||
341fd59cf6 | |||
a6c8b7e506 | |||
98e4c5acea | |||
1496b21c83 | |||
ac0061b83e | |||
0b7dc51bd1 | |||
126f80ed78 | |||
e0ef7482c6 | |||
6ffb971226 | |||
72187a89dd | |||
a461500ab9 | |||
c830af492c | |||
1f6f841fcb | |||
99960c0dc5 | |||
e8a8b08215 | |||
a989e87a2d | |||
0bceeb4674 | |||
5a433f2fc8 | |||
c86b824a04 | |||
21c2276359 | |||
602944ea4f | |||
f4a9ffcec7 | |||
d2e9c61fd7 | |||
c8cd051a00 | |||
448c070898 | |||
7f624ebbb7 | |||
4a69ef3874 | |||
31c933af38 | |||
00137fe46b | |||
b23a16826e | |||
2a822d7b45 | |||
cc5b363d66 | |||
7e53f01d44 | |||
d351f9f172 | |||
4d67d68c6b | |||
3f20462943 | |||
ab26525f09 | |||
e431d7594b | |||
8b75bec3d2 | |||
1a5e56ed46 | |||
3470d5f5e6 | |||
9ff933e532 | |||
299dfe4afe | |||
6921070688 | |||
bb976ccf4b | |||
f02cb5635f | |||
fad3f41ca7 | |||
39a0a38d07 | |||
a316514ca1 | |||
3b69f47590 | |||
8172e2339d | |||
44bb6c077c | |||
e11a58a841 | |||
c4e3b5a242 | |||
f1b44e6da0 | |||
aa093b6c42 | |||
97870a7cdc | |||
9a6433488f | |||
993617f75f | |||
e3baa43b22 | |||
7a332f29ea | |||
14c21422e7 | |||
fe411b1ede | |||
4f02e2d6e7 | |||
4719766843 | |||
85600ef685 | |||
f7edd84125 | |||
27e3583fbc | |||
12d1a03bc4 | |||
d3028b9a03 | |||
2385291886 | |||
cb0b22574a | |||
4a1adf92e2 | |||
b077bb9f5f | |||
68c4b52dfa | |||
81ad9cf6f7 | |||
024706f2ff | |||
57b3b9e3f6 | |||
6c8d118f83 | |||
48399f6364 | |||
e26694c322 | |||
d41249bd90 | |||
833d3ac36f | |||
fdaeecbb06 | |||
70297321c3 | |||
a02609c3e3 | |||
ffebc7b077 | |||
47e0800f02 | |||
c7c7902769 | |||
5bb4d70cf7 | |||
67b2f2510b | |||
ba9434b6f2 | |||
26469452e1 | |||
6ae2655923 | |||
815100cff8 | |||
33771ef8c0 | |||
b51a1684dc | |||
ba9abdc1d3 | |||
6a8803ec9f | |||
bcb5b981f9 | |||
5ea9e59d71 | |||
01b45e7d97 | |||
c41e5320c8 | |||
426c0f5559 | |||
c636f0e69e | |||
58342cfae8 | |||
193103cb2d | |||
f9c593d2f9 | |||
87d174ac2c | |||
cd83a2670b | |||
1bbc47c64f | |||
7a1a5830aa | |||
1ecbec4044 | |||
ab329b99df | |||
54af43dd75 | |||
188a2e72eb | |||
b7a14be2ac | |||
c99f20d5d8 | |||
5b968c97f4 | |||
d538cdcdf6 | |||
cad142fe85 | |||
b18ed03384 | |||
6a0b3dc823 | |||
402c45ee2b | |||
67f19166ac | |||
32b7b6b886 | |||
96df8fbc85 | |||
e742527e65 | |||
f426af6e9e | |||
aea86b6124 | |||
ce51344269 | |||
7d0311fd64 | |||
89e000f669 | |||
f341f1264d | |||
c687b867e7 | |||
4ee31ba661 | |||
a9126a4c82 | |||
6b70c4b49a | |||
d8fb876c81 | |||
73e6ad610f | |||
eee7553d09 | |||
130b5ebedf | |||
dae5fb9785 | |||
31a0eb8d14 | |||
b8b611fbb6 | |||
a285fcc4ec | |||
4fda65c862 | |||
a8cea7b5c9 | |||
01bdcc2b01 | |||
812d2d33f2 | |||
a59073c5ca | |||
7edc3ccd53 | |||
b217e23880 | |||
053b6c2e3f | |||
0d426ca479 | |||
a327056789 | |||
b006b73c69 | |||
3127cea1b2 | |||
a965d8a893 | |||
173e651e3f | |||
fa5cb828c0 | |||
5978810b7f | |||
6c251794c8 | |||
76917751e3 | |||
e75a9b89b0 | |||
a0fe61011f | |||
84a1b03d7d | |||
b9177e7892 | |||
fd12247a62 | |||
20a71300a5 | |||
70c5b24678 | |||
a87e87f93c | |||
1b54ff0ad3 | |||
3075e1eda2 | |||
8d1e014a40 | |||
0c52fe0c7c | |||
bb25f8d02a | |||
42c955c5eb | |||
268223ac52 | |||
b81b8c1d31 | |||
5b2a016241 | |||
a665121b52 | |||
02d312f2d2 | |||
c23c150fe9 | |||
2e5bdb338e | |||
c51ef05067 | |||
dbe152a4c1 | |||
3f42e53d95 | |||
54b0dc5273 | |||
d6b67c3388 | |||
a277224ef4 | |||
f87a10ae0b | |||
f18fb3f26d | |||
71359a3ff2 | |||
6edc6ac680 | |||
bf2b6c3c96 | |||
b904e640f7 | |||
1ddb4eb60c | |||
891abd1d4a | |||
aed7db34ea | |||
90608e9e1a | |||
70b4b14984 | |||
9fbbb474db | |||
bc7a6ebdde | |||
353d920e25 | |||
6110098e97 | |||
b5092c338c | |||
cce7e9932e | |||
e6c30ec137 | |||
9bcd0434db | |||
debdf112cc | |||
533bd173b2 | |||
e05538e480 | |||
38f554b480 | |||
7d487553b2 | |||
ca8fd08e81 | |||
bc67d969cb | |||
c449fc0867 | |||
18b2d81985 | |||
533af96c4f | |||
be8b4d2735 | |||
7d077d543b | |||
9b09c9c7a0 | |||
592bcc8d7e | |||
30529ee4e4 | |||
ee2cdb2c9b | |||
1371c1341f | |||
05bf08a438 | |||
1e03aa1360 | |||
7463e31f95 | |||
83caa3f55a | |||
787465d626 | |||
33357a5992 | |||
cd2532867c | |||
8f80e4fa65 | |||
125a95e9e1 | |||
58f8cdd8c8 | |||
b164a2f3fb | |||
262c9f9e13 | |||
2c4c8c58d5 | |||
daec1baebc | |||
0674e13bab | |||
aee076dc3b | |||
66969f1a65 | |||
e964c1a298 | |||
941b4c1c20 | |||
95e39e7bd7 | |||
0785ca6024 | |||
6543fc1e5b | |||
9133247cdf | |||
bf7f6f40bd | |||
43a904917f | |||
9fe6e5ffcb | |||
a46e421bf6 | |||
20090aee03 | |||
c4ca7fe0d2 | |||
6b41752415 | |||
2bc53d12ea | |||
2f6dc5279b | |||
c8b2867b1f | |||
e56132ae3b | |||
45d4091c20 | |||
60c53a5894 | |||
032c823d3a | |||
66f724a3be | |||
bf0c81b484 | |||
aa72a17f44 | |||
8825e82634 | |||
f700d50dc8 | |||
a585270d21 | |||
7a23dda294 | |||
f3c324038f | |||
34c9bdc84c | |||
38a206892b | |||
12a737a49e | |||
e7946189c6 | |||
850720d8f2 | |||
b130a13c8a | |||
75c090e8b9 | |||
f983f0771b | |||
9f1e5a55f4 | |||
5fcfd5fa4f | |||
e135309670 | |||
e97b616811 | |||
c504ecffe6 | |||
9534db823d | |||
1ba1bec066 | |||
aad4a720dc | |||
a978348123 | |||
00cf797c20 | |||
6b0f58dab2 | |||
04cf5dfda1 | |||
fe1989dea1 | |||
5d19b43888 | |||
06ed345f29 | |||
e0cd34c996 | |||
06641d5709 | |||
a0d2d5cd24 | |||
e9cdbfb8da | |||
df64fdac9e | |||
4dbbbd04cc | |||
c9c3ee9014 | |||
67191c2a75 | |||
8ba4522b3e | |||
52eaf62b58 | |||
8d43f412ac | |||
e9ea90f527 | |||
5dc0d84300 | |||
ec8923ef08 | |||
5a414572f9 | |||
7f40307b0a | |||
a12485d10f | |||
4695bbf483 | |||
20ee77a55e | |||
78a0ac8674 | |||
e49c417e54 | |||
b39961ec49 | |||
8894b4c7b9 | |||
cdf3deb458 | |||
b5fc21239b | |||
93cc9edd9a | |||
dcd9ca3a93 | |||
c202cc1ffb | |||
093af22942 | |||
9d966e41b1 | |||
240aa7aa5f | |||
654e9cd623 | |||
73c3888309 | |||
4f0633fdc1 | |||
f41854ebe7 | |||
f398266206 | |||
4c17f98520 | |||
398815857f | |||
4c5020a396 | |||
df84ce6e90 | |||
7161378da1 | |||
224b612ae7 | |||
19d7522722 | |||
ceace2a678 | |||
d627454b2a | |||
7ccbfad6ad | |||
91f8a158d2 | |||
8925dcde01 | |||
3d1a586314 | |||
d04b278802 | |||
7345f656c1 | |||
530abac3a7 | |||
e702d9a881 | |||
b0aeccb793 | |||
43d8d748ce | |||
b43ea5c7d3 | |||
f56759222d | |||
c8b7bb570c | |||
d536b29550 | |||
ecbda018c5 | |||
5187311ff0 | |||
d9a94ac7b0 | |||
3526e322ef | |||
99cabd545d | |||
1f7f7b10de | |||
b2421b592a | |||
5322f4c62f | |||
7ab8647fc8 | |||
50c76f3d7e | |||
2f4c56176d | |||
7c5f38311b | |||
e568bc9c8d | |||
c2c4172634 | |||
73de5b5773 | |||
aa1fed0b16 | |||
22331ae9f1 | |||
8b436276bf | |||
c61db87fd6 | |||
388cb4df39 | |||
9feffb2972 | |||
acea5cdb24 | |||
55ed577b6a | |||
20b206a161 | |||
9c028a0ecc | |||
b677c3d7ad | |||
aa6bc2df2f | |||
a16579fd21 | |||
ae5a816df1 | |||
1532f2ab23 | |||
5370fc5c83 | |||
8482a1a320 | |||
f3603ac3fa | |||
44fe647a49 | |||
928a89e599 | |||
80d6d806c4 | |||
aeecf40191 | |||
f368ed572d | |||
5291bf616e | |||
a00407a475 | |||
4f47ec49b1 | |||
c48afb7880 | |||
5d3fb359b8 | |||
0227dfa7d8 | |||
b9915b4b94 | |||
f4c1313c19 | |||
7681d63876 | |||
3bed21bd95 | |||
99cdfd60a1 | |||
c6e5937deb | |||
4404e999eb | |||
3684024a58 | |||
1903b1bcdf | |||
9644833d26 | |||
93e3f7cdd9 | |||
617ae146c1 | |||
3459387f04 | |||
4d483bf66c | |||
9e65b67bc1 | |||
722b153fcd | |||
27a0ec9424 | |||
6520a466f3 | |||
698d7289af | |||
11063a8924 | |||
1071ef5bf9 | |||
28caa00c3f | |||
894ac8088d | |||
148481eccc | |||
26bd4d0833 | |||
b6d5ba43ec | |||
6cbcfd75d1 | |||
ce39369d84 | |||
e73eb87c7e | |||
daf2cf4b07 | |||
beba315ec5 | |||
880152d0a0 | |||
4314853640 | |||
dc10139f80 | |||
05a97500aa | |||
eb630ab551 | |||
30d6a0cd5f | |||
b2ffd7d3ca | |||
245a5ef3d7 | |||
5d858344f4 | |||
fea7ed96b3 | |||
fdc0197433 | |||
044bcb359e | |||
18dfc17439 | |||
35ac236a00 | |||
dd17100a53 | |||
f8b4622093 | |||
1216968c60 | |||
1d2bd227f1 | |||
6cec6b2e16 | |||
98bc9b0c4b | |||
a637949e84 | |||
d784669699 | |||
ba340172ee | |||
bb193ff152 | |||
55b085c4d0 | |||
dd72a973d6 | |||
1b8b5d6ee4 | |||
c105063ad9 | |||
ff43701e97 | |||
f477fdf9e2 | |||
49038e3ca9 | |||
5f96172dbd | |||
2bd6a8390c | |||
3e68cec6ea | |||
b24d763d40 | |||
d690560fc2 | |||
d46d40fa17 | |||
18001e7799 | |||
aa39aa8a58 | |||
c7c48bbe3c | |||
484617e2d7 | |||
841cc957c9 | |||
e89e87de62 | |||
b7ea8c3875 | |||
a67e495910 | |||
97d6216409 | |||
c55faa3505 |
7
.gitignore
vendored
@ -2,3 +2,10 @@ node_modules
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
.DS_Store
|
||||
aws.json
|
||||
docs/index.dev.html
|
||||
*.mp4
|
||||
index-dev.html
|
||||
notes.txt
|
||||
*.vtt
|
||||
docs/index.dev.php
|
||||
|
13
.jshintrc
@ -8,12 +8,11 @@
|
||||
"node" : false,
|
||||
"rhino" : false,
|
||||
"couch" : false,
|
||||
"wsh" : true, // Windows Scripting Host.
|
||||
"jquery" : true,
|
||||
"predef" : [ "jQuery", "$" ],
|
||||
"wsh" : false, // Windows Scripting Host.
|
||||
"jquery" : false,
|
||||
|
||||
// Development.
|
||||
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||
"debug" : true, // Allow debugger statements e.g. browser breakpoints.
|
||||
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
||||
|
||||
// ECMAScript 5.
|
||||
@ -26,7 +25,7 @@
|
||||
"bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.).
|
||||
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
||||
"curly" : true, // Require {} for every new block or scope.
|
||||
"eqeqeq" : false, // Require triple equals i.e. `===`.
|
||||
"eqeqeq" : true, // Require triple equals i.e. `===`.
|
||||
"eqnull" : false, // Tolerate use of `== null`.
|
||||
"evil" : false, // Tolerate use of `eval`.
|
||||
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||
@ -51,6 +50,6 @@
|
||||
"plusplus" : false, // Prohibit use of `++` & `--`.
|
||||
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||
"trailing" : true, // Prohibit trailing whitespaces.
|
||||
"white" : false, // Check against strict whitespace and indentation rules.
|
||||
"indent" : 2 // Specify indentation spacing
|
||||
"white" : true, // Check against strict whitespace and indentation rules.
|
||||
"indent" : 4 // Specify indentation spacing
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 726 B |
@ -1,13 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 2.1 KiB |
@ -1,13 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 2.1 KiB |
@ -1,6 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 635 B |
@ -1,14 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 2.3 KiB |
@ -1,13 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,6 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 515 B |
@ -1,7 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1,10 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 1021 B |
@ -1,7 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,15 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Docs example
|
||||
// ==========================================================================
|
||||
|
||||
/*global plyr, templates */
|
||||
|
||||
// Setup the player
|
||||
plyr.setup({
|
||||
debug: true,
|
||||
title: "Video demo",
|
||||
html: templates.controls.render({}),
|
||||
captions: {
|
||||
defaultActive: true
|
||||
}
|
||||
});
|
@ -1,802 +0,0 @@
|
||||
/*!
|
||||
* 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, '&')
|
||||
.replace(rLt, '<')
|
||||
.replace(rGt, '>')
|
||||
.replace(rApos, ''')
|
||||
.replace(rQuot, '"') :
|
||||
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);
|
@ -1,979 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Plyr
|
||||
// plyr.js v1.0.0
|
||||
// https://github.com/sampotts/plyr
|
||||
// ==========================================================================
|
||||
// Credits: http://paypal.github.io/accessible-html5-video-player/
|
||||
// ==========================================================================
|
||||
|
||||
/*global ActiveXObject*/
|
||||
|
||||
(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: ".player-progress",
|
||||
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: {
|
||||
active: "captions-active",
|
||||
enabled: "captions-enabled"
|
||||
},
|
||||
fullscreen: {
|
||||
enabled: "fullscreen-enabled"
|
||||
}
|
||||
},
|
||||
captions: {
|
||||
defaultActive: false
|
||||
},
|
||||
fullscreen: {
|
||||
enabled: true
|
||||
}
|
||||
};
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
fullscreen.fullScreenEventName = fullscreen.prefix + "fullscreenchange";
|
||||
|
||||
fullscreen.isFullScreen = function() {
|
||||
switch (this.prefix) {
|
||||
case "":
|
||||
return document.fullScreen;
|
||||
case "webkit":
|
||||
return document.webkitIsFullScreen;
|
||||
default:
|
||||
return document[this.prefix + "FullScreen"];
|
||||
}
|
||||
};
|
||||
fullscreen.requestFullScreen = function(element) {
|
||||
return (this.prefix === "") ? element.requestFullScreen() : element[this.prefix + "RequestFullScreen"](this.prefix === "webkit" ? element.ALLOW_KEYBOARD_INPUT : null);
|
||||
};
|
||||
fullscreen.cancelFullScreen = function() {
|
||||
return (this.prefix === "") ? document.cancelFullScreen() : document[this.prefix + "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];
|
||||
}
|
||||
|
||||
// Insert controls
|
||||
function _injectControls() {
|
||||
// Insert custom video controls
|
||||
if (config.debug) {
|
||||
console.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() {
|
||||
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.bar = _getElement(config.selectors.progress);
|
||||
player.progress.text = player.progress.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);
|
||||
}
|
||||
|
||||
// Setup media
|
||||
function _setupMedia() {
|
||||
player.media = player.container.querySelectorAll("audio, video")[0];
|
||||
|
||||
// If there's no media, bail
|
||||
if(!player.media) {
|
||||
console.error("No audio or video element found!");
|
||||
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;
|
||||
if (config.debug) {
|
||||
console.log("No caption track found.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (config.debug) {
|
||||
console.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 {
|
||||
var track = {}, tracks, j;
|
||||
|
||||
// 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)) {
|
||||
if (config.debug) {
|
||||
console.log("Detected IE 10/11 or Firefox 31+ or Safari 7+");
|
||||
}
|
||||
// set to false so skips to "manual" captioning
|
||||
player.isTextTracks = false;
|
||||
|
||||
// turn off native caption rendering to avoid double captions [doesn"t work in Safari 7; see patch below]
|
||||
track = {};
|
||||
tracks = player.media.textTracks;
|
||||
for (j=0; j < tracks.length; j++) {
|
||||
track = player.media.textTracks[j];
|
||||
track.mode = "hidden";
|
||||
}
|
||||
}
|
||||
|
||||
// Rendering caption tracks - native support required - http://caniuse.com/webvtt
|
||||
if (player.isTextTracks) {
|
||||
if (config.debug) {
|
||||
console.log("textTracks supported");
|
||||
}
|
||||
_showCaptions(player);
|
||||
|
||||
track = {};
|
||||
tracks = player.media.textTracks;
|
||||
for (j=0; j < tracks.length; j++) {
|
||||
track = player.media.textTracks[j];
|
||||
track.mode = "hidden";
|
||||
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 {
|
||||
if (config.debug) {
|
||||
console.log("textTracks not supported so rendering captions manually");
|
||||
}
|
||||
_showCaptions(player);
|
||||
|
||||
// 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;
|
||||
if (window.XMLHttpRequest) {
|
||||
xhr = new XMLHttpRequest();
|
||||
}
|
||||
else if (window.ActiveXObject) { // IE8
|
||||
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
if (config.debug) {
|
||||
console.log("xhr = 200");
|
||||
}
|
||||
|
||||
player.captions = [];
|
||||
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();
|
||||
|
||||
if (config.debug) {
|
||||
console.log("Successfully loaded the caption file via ajax.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (config.debug) {
|
||||
console.log("There was a problem loading the caption file via ajax.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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) {
|
||||
if (config.debug) {
|
||||
console.log("Safari 7 detected; removing track from DOM");
|
||||
}
|
||||
tracks = player.media.getElementsByTagName("track");
|
||||
player.media.removeChild(tracks[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
if(fullscreen.supportsFullScreen) {
|
||||
if(config.debug) {
|
||||
console.log("Fullscreen enabled");
|
||||
}
|
||||
|
||||
_toggleClass(player.container, config.classes.fullscreen.enabled, true);
|
||||
}
|
||||
else if(config.debug) {
|
||||
console.warn("Fullscreen not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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() {
|
||||
if(!fullscreen.isFullScreen()) {
|
||||
fullscreen.requestFullScreen(player.container);
|
||||
}
|
||||
else {
|
||||
fullscreen.cancelFullScreen();
|
||||
}
|
||||
}
|
||||
|
||||
// Set volume
|
||||
function _setVolume(volume) {
|
||||
// Use default if needed
|
||||
if(typeof volume === "undefined") {
|
||||
volume = config.volume;
|
||||
}
|
||||
// Maximum is 10
|
||||
if(volume > 10) {
|
||||
volume = 10;
|
||||
}
|
||||
|
||||
player.volume.value = volume;
|
||||
player.media.volume = parseFloat(volume / 10);
|
||||
_checkMute();
|
||||
}
|
||||
|
||||
// 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));
|
||||
}
|
||||
|
||||
// Listen for events
|
||||
function _listeners() {
|
||||
// Fullscreen
|
||||
_on(player.buttons.fullscreen, "click", _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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 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);
|
||||
});
|
||||
|
||||
// Duration
|
||||
_on(player.media, "timeupdate", function() {
|
||||
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;
|
||||
});
|
||||
|
||||
// Progress bar
|
||||
_on(player.media, "timeupdate", function() {
|
||||
player.percent = (100 / player.media.duration) * player.media.currentTime;
|
||||
|
||||
if (player.percent > 0) {
|
||||
player.progress.bar.value = player.percent;
|
||||
player.progress.text.innerHTML = player.percent;
|
||||
}
|
||||
});
|
||||
|
||||
// Skip when clicking progress bar
|
||||
_on(player.progress.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);
|
||||
});
|
||||
}
|
||||
|
||||
function _init() {
|
||||
// Setup the fullscreen api
|
||||
fullscreen = _fullscreen();
|
||||
|
||||
// Sniff
|
||||
player.browserInfo = _browserSniff();
|
||||
player.browserName = player.browserInfo[0];
|
||||
player.browserMajorVersion = player.browserInfo[1];
|
||||
|
||||
// Debug info
|
||||
if(config.debug) {
|
||||
console.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) ) {
|
||||
if(config.debug) {
|
||||
console.error("Browser not suppported.");
|
||||
}
|
||||
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
|
||||
_findElements();
|
||||
|
||||
// Set volume
|
||||
_setVolume(config.volume);
|
||||
|
||||
// Setup fullscreen
|
||||
_setupFullscreen();
|
||||
|
||||
// Captions
|
||||
_setupCaptions();
|
||||
|
||||
// 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
|
||||
element.plyr = new Plyr(element);
|
||||
|
||||
// Add to return array
|
||||
players.push(element.plyr);
|
||||
}
|
||||
|
||||
return players;
|
||||
}
|
||||
}(this.plyr = this.plyr || {}));
|
@ -1,117 +0,0 @@
|
||||
// ==========================================================================
|
||||
// HTML5 Video Player Demo Page
|
||||
// ==========================================================================
|
||||
|
||||
// Reset
|
||||
@import "docs/normalize.less";
|
||||
// Mixins
|
||||
@import "docs/mixins.less";
|
||||
// Fonts
|
||||
@import "docs/fontface.less";
|
||||
|
||||
// Variables
|
||||
// ---------------------------------------
|
||||
// Colors
|
||||
@blue: #3498DB;
|
||||
@gray-dark: #343f4a;
|
||||
@gray: #565d64;
|
||||
@gray-light: #cbd0d3;
|
||||
|
||||
// Elements
|
||||
@link-color: @blue;
|
||||
|
||||
// BORDER-BOX ALL THE THINGS!
|
||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||
*, *::after, *::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html {
|
||||
font-size: 62.5%;
|
||||
}
|
||||
body {
|
||||
font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
background: #fff;
|
||||
.font-size(16);
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
color: #6D797F;
|
||||
}
|
||||
h1,
|
||||
h2 {
|
||||
letter-spacing: -.025em;
|
||||
color: #2E3C44;
|
||||
margin: 0 0 10px;
|
||||
line-height: 1.2;
|
||||
.font-smoothing();
|
||||
}
|
||||
h1 {
|
||||
.font-size(64);
|
||||
color: #3498DB;
|
||||
}
|
||||
p,
|
||||
small {
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
small {
|
||||
display: block;
|
||||
.font-size(14);
|
||||
}
|
||||
header {
|
||||
padding: 60px 0;
|
||||
margin-bottom: 20px;
|
||||
|
||||
p {
|
||||
.font-size(18);
|
||||
}
|
||||
}
|
||||
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: 10px 25px;
|
||||
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%);
|
||||
}
|
||||
}
|
||||
|
||||
section {
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
// Players
|
||||
.example-audio .player {
|
||||
max-width: 480px;
|
||||
}
|
||||
.example-video .player {
|
||||
max-width: 1200px;
|
||||
}
|
||||
.example-audio .player,
|
||||
.example-video .player {
|
||||
margin: 0 auto 20px;
|
||||
|
||||
&:fullscreen,
|
||||
&-fullscreen {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
@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;
|
||||
}
|
@ -1,407 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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: @gray;
|
||||
@progress-value-bg: @blue;
|
||||
|
||||
// Range
|
||||
@range-track-height: 6px;
|
||||
@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;
|
||||
|
||||
// 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: @gray;
|
||||
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
|
||||
background: #000;
|
||||
|
||||
// BORDER-BOX ALL THE THINGS!
|
||||
// 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;
|
||||
text-shadow: 0 1px 1px rgba(0,0,0, .75);
|
||||
text-align: center;
|
||||
.font-smoothing();
|
||||
|
||||
@media (min-width: 560px) {
|
||||
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;
|
||||
|
||||
// Layout
|
||||
&-sound {
|
||||
display: block;
|
||||
margin: @control-spacing auto 0;
|
||||
}
|
||||
@media (min-width: 560px) {
|
||||
&-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;
|
||||
}
|
||||
button:hover,
|
||||
label:hover {
|
||||
background: @control-color-active;
|
||||
|
||||
svg {
|
||||
fill: #fff;
|
||||
}
|
||||
}
|
||||
input:focus + label,
|
||||
button:focus {
|
||||
.tab-focus();
|
||||
|
||||
svg {
|
||||
fill: #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;
|
||||
margin: 0;
|
||||
vertical-align: top;
|
||||
|
||||
&[value] {
|
||||
-webkit-appearance: none;
|
||||
border: none;
|
||||
background: @progress-bg;
|
||||
cursor: pointer;
|
||||
color: @progress-value-bg;
|
||||
|
||||
&::-webkit-progress-bar {
|
||||
background: @progress-bg;
|
||||
}
|
||||
|
||||
// Inherit from currentColor;
|
||||
&::-webkit-progress-value {
|
||||
background: currentColor;
|
||||
}
|
||||
&::-moz-progress-bar {
|
||||
background: currentColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 999999;
|
||||
|
||||
.player-video-wrapper {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
video {
|
||||
height: 100%;
|
||||
}
|
||||
.player-captions {
|
||||
top: auto;
|
||||
bottom: 90px;
|
||||
|
||||
@media (min-width: 560px) and (max-width: 767px) {
|
||||
bottom: 60px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
<div class="player-controls">
|
||||
<progress class="player-progress" max="100" value="0">
|
||||
<span>0</span>% played
|
||||
</progress>
|
||||
<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>
|
60
bower.json
@ -1,29 +1,33 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"description": "A simple HTML5 media player using custom controls",
|
||||
"homepage": "http://plyr.io",
|
||||
"keywords": [
|
||||
"Audio",
|
||||
"Video",
|
||||
"HTML5 Audio",
|
||||
"HTml5 Video"
|
||||
],
|
||||
"authors": [
|
||||
"Sam Potts <me@sampotts.me>"
|
||||
],
|
||||
"dependencies": {},
|
||||
"main": [
|
||||
"dist/css/plyr.css",
|
||||
"dist/js/plyr.js"
|
||||
],
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
".gitignore"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/selz/plyr.git"
|
||||
},
|
||||
"license": "BSD"
|
||||
}
|
||||
"name": "plyr",
|
||||
"description": "A simple HTML5 media player using custom controls",
|
||||
"homepage": "http://plyr.io",
|
||||
"keywords": [
|
||||
"Audio",
|
||||
"Video",
|
||||
"HTML5 Audio",
|
||||
"HTml5 Video"
|
||||
],
|
||||
"authors": [
|
||||
"Sam Potts <me@sampotts.me>"
|
||||
],
|
||||
"dependencies": {},
|
||||
"main": [
|
||||
"dist/plyr.css",
|
||||
"dist/plyr.js",
|
||||
"dist/plyr.svg",
|
||||
"src/less/plyr.less",
|
||||
"src/scss/plyr.scss",
|
||||
"src/js/plyr.js"
|
||||
],
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
".gitignore"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/selz/plyr.git"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
36
bundles.json
@ -1,14 +1,24 @@
|
||||
{
|
||||
"less": {
|
||||
"plyr.css": ["assets/less/plyr.less"],
|
||||
"docs.css": ["assets/less/docs.less"]
|
||||
},
|
||||
"js": {
|
||||
"plyr.js": ["assets/js/plyr.js"],
|
||||
"docs.js": [
|
||||
"assets/js/lib/hogan-3.0.2.mustache.js",
|
||||
"dist/js/templates.js",
|
||||
"assets/js/docs.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
"plyr": {
|
||||
"less": {
|
||||
"plyr.css": ["src/less/plyr.less"]
|
||||
},
|
||||
"scss": {
|
||||
"plyr.css": ["src/scss/plyr.scss"]
|
||||
},
|
||||
"js": {
|
||||
"plyr.js": ["src/js/plyr.js"]
|
||||
}
|
||||
},
|
||||
"demo": {
|
||||
"less": {
|
||||
"demo.css": ["demo/src/less/demo.less"]
|
||||
},
|
||||
"js": {
|
||||
"demo.js": [
|
||||
"demo/src/js/lib/classlist.js",
|
||||
"demo/src/js/main.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
483
changelog.md
Normal file
@ -0,0 +1,483 @@
|
||||
# Changelog
|
||||
|
||||
# v2.0.0
|
||||
This version contains several potential ***breaking changes***:
|
||||
|
||||
- `setup()` has been reverted to pre v1.8.0 behaviour; meaning it will return the *instance* rather than the *element*. This is because the reference to the instance is no longer added to the original element (see below).
|
||||
- The reference to the `plyr` instance is now added to the media element rather than original container. This is because if a container with multiple children was passed to `setup()` the references to all instances would have been added to the container, creating issues. I would recommend using the return value from `setup()` or the new `get()` method to access the instance.
|
||||
- Players will always be wrapped in their own div now - this makes `setup()` and `destroy()` cleaner. This *may* break any custom styling based on DOM position.
|
||||
- Players no longer seek to 0 on 'ended' - this is to fix a bug with Microsoft Edge as it triggers 'ended' on media change for whatever reason. They'll never change ;-)
|
||||
|
||||
And some other changes and bug fixes:
|
||||
|
||||
- New `get()` method on the global plyr object to get all instances inside a container
|
||||
- New API methods:
|
||||
- `getOriginal()` to get the original, *unmodified* element plyr was setup on (`<video>`, `<audio>` or empty `<div>` for YouTube and Vimeo)
|
||||
- `getContainer()` to get the players outer wrapper element
|
||||
- `getMedia()` to get the players media element (`<video>`, `<audio>` or empty `<div>` for YouTube and Vimeo)
|
||||
- `getEmbed()` to access the YouTube or Vimeo API directly
|
||||
- `getType()` to get the type of the player
|
||||
- `isReady()` to determine if an instance has completed setup and necessary APIs are loaded (for YouTube / Vimeo)
|
||||
- `on()` to provide an easy way to listen to events
|
||||
- `stop()` to, you guessed it, stop the player
|
||||
- `destroy()` now works correctly for YouTube and Vimeo (fixes #272)
|
||||
- New `destroyed` event when `destroy()` has completed (original element is passed as event.target)
|
||||
- Default volume is now 10 (max) rather than 5
|
||||
- Sprite is only loaded once (fixes #259)
|
||||
- Fixes for Vimeo post message bugs on source change or destroy (fixes #318)
|
||||
- Save caption state in storage (fixes #311)
|
||||
- Added keyboard shortcuts to the current focused player (with `keyboardShortcuts` boolean option to disable) (fixes #309)
|
||||
- Fix for captions bug (fixes #332)
|
||||
- Change to AMD (fixes #298)
|
||||
|
||||
## v1.8.12
|
||||
- Vimeo keyboard focus fix (Fixes #317)
|
||||
- Fix for Vimeo on basic support devices
|
||||
|
||||
## v1.8.11
|
||||
- Fix for keyboard navigation on Vimeo (Fixes #317)
|
||||
- Fix for bug introduced in v1.8.9 related to additional controls
|
||||
- Vimeo API upgrade
|
||||
- Fix for YouTube bug introduced in v1.8.9
|
||||
- Added support for passing array to .setup() (Fixes #319)
|
||||
|
||||
## v1.8.10
|
||||
- Fix for seek issues introduced in v1.8.9
|
||||
|
||||
## v1.8.9
|
||||
- Fix for fullscreen not being defined (Fixes #295)
|
||||
- Fix for multiline captions (Fixes #314)
|
||||
- Clean up of type checks and fix for `restart()` (Fixes #315)
|
||||
- Fix for `MEDIA_ERR_SRC_NOT_SUPPORTED` when calling `.source()` API method
|
||||
|
||||
## v1.8.8
|
||||
- Added getCurrentTime API method (fixes #292)
|
||||
- Fix for !hideControls on touch devices (fixes #303)
|
||||
|
||||
## v1.8.7
|
||||
- Line height fix
|
||||
|
||||
## v1.8.6
|
||||
- Reverted font size change
|
||||
|
||||
## v1.8.5
|
||||
- Fixed overflow issues (fixes #286)
|
||||
|
||||
## v1.8.4
|
||||
- Fix for large play button on small videos
|
||||
|
||||
## v1.8.3
|
||||
- Disabled iPad support for YouTube and Vimeo due to iOS limitations with iFrame playback
|
||||
- Fixed IE11 icon loading (fixes #269)
|
||||
- Updated screenshot (fixes #281)
|
||||
- Added WordPress plugin (fixes #239)
|
||||
- Added Neos plugin
|
||||
- Added HLS, Shaka and dash.js examples (see #235 for more)
|
||||
- Improvements for controls hiding and showing on touch devices
|
||||
|
||||
## v1.8.2
|
||||
- Fixed event bubbling
|
||||
|
||||
## v1.8.1
|
||||
- Fixed inaccurate log message
|
||||
|
||||
# v1.8.0
|
||||
- ***(Important)*** `setup()` now returns the element Plyr was setup on rather than the `plyr` object. This means `var player = plyr.setup()[0];` would now be `var player = plyr.setup()[0].plyr;`. This improves support for React and other virtual dom frameworks as mentioned in #254
|
||||
- Fixed using a relative URL for `iconUrl` in IE (fixes #269)
|
||||
|
||||
# v1.7.0
|
||||
- SASS cleanup (fixes #265)
|
||||
- Docs tidy up to help quick start (fixes #253)
|
||||
- Fix for issues with data attribute options passing (fixes #257)
|
||||
- ***(Important)*** Removed the requirement for a wrapper div to setup Plyr and removed the dependency on the `plyr` classname as a JS hook. By default it will now look for `<video>`, `<audio>` and `[data-type]` elements. If you are just calling `setup()` with a `<div class="plyr">` you may want to give it a good test after upgrading. You can probably remove the wrapper div. The reason behind this is to make setup easier for newcomers and prevent the styling being used on unsupported players (because the plyr classname was used as a CSS and JS hook - which isn't ideal)
|
||||
- Renamed the 'docs' folder to `demo` to avoid confusion - the readme is the docs after all
|
||||
|
||||
## v1.6.20
|
||||
- Fix for multiple sprites being requested (fixes #259)
|
||||
|
||||
## v1.6.19
|
||||
- Fix for scroll direction issues on volume control (fixes #258)
|
||||
|
||||
## v1.6.18
|
||||
- Reduced rounding of seek value from 1 decimal point to 4 (fixes #242)
|
||||
|
||||
## v1.6.17
|
||||
- Added `disableContextMenu` option to hide the right click context menu (fixes #248 and #225)
|
||||
|
||||
## v1.6.16
|
||||
- Always hide standard controls (fixes #225)
|
||||
- Fix for Tooltips overflowing (fixes #230)
|
||||
|
||||
## v1.6.15
|
||||
- Restore scroll position when exiting full screen (fixes #236)
|
||||
|
||||
## v1.6.14
|
||||
- SVG sprite loading automatically for an easier setup
|
||||
- Touch devices now show controls on touch rather than pausing playback
|
||||
|
||||
## v1.6.13
|
||||
- Decreased sensitivity and inverted scroll on volume slider (scroll up to increase, down to decrease)
|
||||
|
||||
## v1.6.12
|
||||
- Fix for undefined buffer error
|
||||
- Add scroll listener on volume slider (PR #227 bty @igoradamenko)
|
||||
|
||||
## v1.6.11
|
||||
- Fix for Vimeo fullscreen (fixes #214)
|
||||
|
||||
## v1.6.10
|
||||
- Changed default icon prefix from 'icon' to 'plyr' to avoid clashes
|
||||
|
||||
## v1.6.9
|
||||
- Added 'latest' CDN option
|
||||
- Renamed `sprite.svg` to `plyr.svg` to be inline with the other package files
|
||||
|
||||
## v1.6.8
|
||||
- Fix for bug introduced in v1.6.7
|
||||
|
||||
## v1.6.7
|
||||
- Fixes for using `source` API method on iOS
|
||||
|
||||
## v1.6.6
|
||||
- Icons cleaned up
|
||||
- IE11 button fix for tooltips (fixes #210)
|
||||
|
||||
## v1.6.5
|
||||
- IE UI bug fixes
|
||||
|
||||
## v1.6.4
|
||||
- Bug fix for undefined progress bar
|
||||
|
||||
## v1.6.3
|
||||
- Seek back to 0 for all media on ended
|
||||
- Check for HTML5 video on ended reload
|
||||
- Update to docs for `showPosterOnEnd` option
|
||||
|
||||
## v1.6.2
|
||||
- Fix for tooltip displaying when duration is not set (fixes #177)
|
||||
- `showPosterOnEnd` option to show poster when HTML5 video ended (fixes #59)
|
||||
- Error handler for YouTube (fixes #189)
|
||||
- Initial SoundCloud support (fixes #194)
|
||||
- Other minor bug fixes
|
||||
|
||||
## v1.6.1
|
||||
- Tooltip changes for accessibility
|
||||
|
||||
## v1.6.0
|
||||
- New, cleaner, UI:
|
||||
- Controls are now overlaid, maintaining the video's ratio and making sizing easier
|
||||
- A large play button can now be overlaid over videos
|
||||
- Default number of control buttons reduced
|
||||
- New play, pause, rewind and fast forward icons
|
||||
- Flexbox all the things!
|
||||
- Tidied up the LESS (and SCSS) as part of the above, variables and mixins in seprate files amking customization and upgrades easier
|
||||
- Toggle mute bug fix; if a player was muted previously and the user refreshed, unmuting would have meant volume was still zero (effectively muted), now the config default value is used. Not ideal but good for now
|
||||
- New `iconUrl` option allowing specifying a same origin SVG sprite location. Loading this way means you don't need the AJAX sprite loading JavaScript
|
||||
- `click` option renamed to `clickToPlay` to make it a bit more self explanatory. Unfortunately cross origin SVG sprites is not supported in any browser yet :-(
|
||||
- `hideControls` is now a global option, rather than being exclusive to fullscreen. Controls are now hidden after 2 seconds of no mouse movement. Controls are always shown when media is paused or stopped. This is defaulted to true.
|
||||
- `sass` folder in `src` renamed from to `scss`
|
||||
|
||||
## v1.5.21
|
||||
- Bug fix for embeds: `play` not being defined (fixes #185 and #186)
|
||||
|
||||
## v1.5.20
|
||||
- Bug fix for autoplay option
|
||||
|
||||
## v1.5.19
|
||||
- Fix for accessing `embed` property after `ready` event fired
|
||||
|
||||
## v1.5.18
|
||||
- Added 'ready' event for initial setup complete or source change occurs
|
||||
- Fixed SASS stylesheet references to transparentize
|
||||
- Added default font stack to controls
|
||||
- Docs fixes inc controls HTML (fixes #180)
|
||||
|
||||
## v1.5.17
|
||||
- Expose YouTube and Vimeo API (docs update required) (fixes #176)
|
||||
- Auto set title based on YouTube getVideoData() title property
|
||||
- Bug fix for Vimeo API change (Uncaught TypeError: Cannot read property 'value' of undefined) due to a change their end
|
||||
|
||||
## v1.5.16
|
||||
- Cancel requests on source change (fixes #174)
|
||||
|
||||
## v1.5.15
|
||||
- Fix for CustomEvent polyfill and related bug (see #172)
|
||||
|
||||
## v1.5.14
|
||||
- Volume storage fix (fixes #171)
|
||||
|
||||
## v1.5.13
|
||||
- Fix for manual caption rendering
|
||||
|
||||
## v1.5.12
|
||||
- Added a duration option to pass the duration of the file
|
||||
- Added the ability to set options per element by setting a data-plyr attribute on the target elements (this might be useful for the duration option for example)
|
||||
- Fixes for Chrome and Safari caption rendering, they now use the default texttrack and cuechange events
|
||||
- Firefox bug fix for event not defined
|
||||
|
||||
## v1.5.11
|
||||
- iOS embed bug fixes (fixes #166)
|
||||
- Hide IE/Edge <input type='range'> tooltip (since we have a styled one) (fixes #160)
|
||||
- SASS bug fix for default values (fixes #158)
|
||||
|
||||
## v1.5.9 + v1.5.10
|
||||
- NPM bug fixes
|
||||
|
||||
## v1.5.8
|
||||
- Fix for touch device seek tooltip
|
||||
- Seek improvements
|
||||
|
||||
## v1.5.7
|
||||
- Fix for control tooltips always showing
|
||||
|
||||
## v1.5.6
|
||||
- Seek tooltip (option for tooltips changed, please check docs)
|
||||
- SASS compile error fixes (fixes #148)
|
||||
- Fullscreen fixes for controls not always hiding/showing (fixes #149)
|
||||
- Screen reader icon fixes (title was being read twice due to the tooltip/hidden label)
|
||||
|
||||
## v1.5.5
|
||||
- Fixed controls.md example
|
||||
- Bug fix for docs error page
|
||||
- Bug fix for controls tooltips
|
||||
|
||||
## v1.5.4
|
||||
- Minor bug fix for clicking video to play/pause after source change
|
||||
|
||||
## v1.5.3
|
||||
- Minor bug fix for occasional display of 0:00 as the media duration
|
||||
|
||||
## v1.5.2
|
||||
- `handlers` option renamed to `listeners`
|
||||
- Added event listeners for all types to the plyr container (playback, fullscreen, captions etc - see docs)
|
||||
- Removed onSetup config option (use the 'setup' event instead, plyr element is event.plyr)
|
||||
- Style bug fixes
|
||||
- Vimeo seek bug fix (requires whole seconds when seeking)
|
||||
- Fix for fullscreen player (using class hook, not browser fullscreen)
|
||||
|
||||
## v1.5.1
|
||||
- Fix for event listeners being duplicated on source change
|
||||
|
||||
# v1.5.0
|
||||
- Vimeo support (fixes #8)
|
||||
- New options for initialization (you can now pass a selector, HTMLElement or NodeList) (fixes #118)
|
||||
- Switched to BEM methodology (you will need to change CSS and probably HTML)
|
||||
- Decoupled CSS and JS hooks (fixes #129)
|
||||
- Custom controls container (fixes #98)
|
||||
- Fix for private/incognito mode local storage bug (fixes #131)
|
||||
- UMD module setup (fixes #121)
|
||||
- Specify iframe title for Vimeo and YouTube (fixes #124)
|
||||
- Better handling of mission controls (fixes #132)
|
||||
- Retain classname on source change (fixes #120)
|
||||
- Increased thumb size on seek (partially fixes #130)
|
||||
- Passing no argument to `source` api method, now returns current source (by @gurupras)
|
||||
- Ability to add custom handlers to controls prior to Plyr bindings (by @gurupras)
|
||||
- Keyboard navigation improvements (focus on seek, focus trap in fullscreen) (fixes #135)
|
||||
|
||||
## v1.3.5
|
||||
- Fixed bug with API use on basic supported browsers
|
||||
|
||||
## v1.3.4
|
||||
- Code cleanup by @calvintam236
|
||||
|
||||
## v1.3.3
|
||||
- Removed captions being read by screen readers
|
||||
|
||||
## v1.3.2
|
||||
- Voiceover fix for captions
|
||||
|
||||
## v1.3.1
|
||||
- ARIA improvements for captions being read
|
||||
|
||||
## v1.3.0
|
||||
- Internationalization support (i18n) using default controls (required markup changes to controls)
|
||||
- ARIA enhancements for controls (required markup changes to controls)
|
||||
- Captions legibility improvements
|
||||
- YouTube bug fixes
|
||||
|
||||
## v1.2.6
|
||||
- SASS updates and fixes (cheers @ChristianPV)
|
||||
|
||||
## v1.2.5
|
||||
- Fix for YouTube quality (let them decide quality)
|
||||
|
||||
## v1.2.4
|
||||
- Fix for omitted kind attribute on <track> (fixes #88)
|
||||
|
||||
## v1.2.3
|
||||
- Fix for YouTube on iPhone or unsupported browsers (fallback to YouTube native)
|
||||
- Docs tidy up
|
||||
- Fullscreen for Safari fix (fixes #96)
|
||||
|
||||
## v1.2.2
|
||||
- Fix for :focus keyboard vs mouse (fixes #61)
|
||||
- Fix for caption positioning in full screen (fixes #92)
|
||||
|
||||
## v1.2.1
|
||||
- Tooltip bug fix
|
||||
|
||||
# v1.2.0
|
||||
- Added YouTube support
|
||||
|
||||
## v1.1.13
|
||||
- Added icon prefix option for when using default controls
|
||||
|
||||
## v1.1.13
|
||||
- Logic tweaks for hiding controls in fullscreen
|
||||
|
||||
## v1.1.12
|
||||
- Bug fix for Chrome Canary
|
||||
|
||||
## v1.1.11
|
||||
- Bug fix
|
||||
|
||||
## v1.1.10
|
||||
- Bug fix
|
||||
|
||||
## v1.1.9
|
||||
- Bug fix for 1.1.8
|
||||
|
||||
## v1.1.8
|
||||
- setVolume API method improvements (fixes #83)
|
||||
|
||||
## v1.1.7
|
||||
- Restore classname on destroy()
|
||||
|
||||
## v1.1.6
|
||||
- New API methods (fixes #77), Fix for non strict mode (fixes #78)
|
||||
|
||||
## v1.1.5
|
||||
- Fix for incorrect `isFullscreen()` return value in Mozilla (fixes #38)
|
||||
|
||||
## v1.1.4
|
||||
- Minor bug fixes
|
||||
|
||||
## v1.1.3
|
||||
- Fixes for random id used in controls with multiple instances and one call to setup
|
||||
- Audio player UI improvements
|
||||
|
||||
## v1.1.2
|
||||
- Added an onSetup callback option
|
||||
- Added fullscreen API methods `toggleFullscreen()` (must be user iniated), and `isFullscreen()`
|
||||
|
||||
## v1.1.1
|
||||
- Fix for unsupported browser handling
|
||||
- Fix for config.controls having no effect
|
||||
|
||||
## v1.1.0
|
||||
- Added config option to set which controls are shown (if using the default controls html) and better handling of missing controls
|
||||
|
||||
## v1.0.31
|
||||
- Display duration on `metadataloaded`
|
||||
|
||||
## v1.0.30
|
||||
- Fixed bug with media longer than 60 minutes (fixes #69)
|
||||
|
||||
## v1.0.29
|
||||
- Added option to hide controls on fullscreen (default `true`) while palying, after 1s. Pause, mouse hover on progress, or focus on a child control re-shows the controls. On touch a tap of the video (which plays/pauses the video by default) is required. (fixes #47)
|
||||
- Fixed a bug with caption toggle in 1.0.28
|
||||
|
||||
## v1.0.28
|
||||
- Added API support for browsers that don't have full plyr support (pretty much <=IE9 and `<video>` on iPhone/iPod)
|
||||
|
||||
## v1.0.27
|
||||
- Keyboard accessibility improvements (fixes #66)
|
||||
|
||||
## v1.0.26
|
||||
- Fixes for SASS (cheers @brunowego)
|
||||
- Indentation reset to 4 spaces
|
||||
|
||||
## v1.0.25
|
||||
- Fixes for iOS volume controls (hidden)
|
||||
- Classnames for left/right controls changed
|
||||
|
||||
## v1.0.24
|
||||
- Added tooltip option to display labels as tooltips (fixes #50)
|
||||
|
||||
## v1.0.23
|
||||
- Handling loading states in the UI (fixes #36)
|
||||
|
||||
## v1.0.22
|
||||
- Added support() API method for checking mimetype support
|
||||
- Added source() API method for setting media source(s) (fixes #44)
|
||||
- Added poster() API method for setting poster source
|
||||
- Refactored captions logic for manual captions
|
||||
|
||||
## v1.0.21
|
||||
- Added an <input type="range"> for seeking to improve experience (and support dragging) (fixes #40, #42)
|
||||
- Icons for restart and captions improved (and some IDs changed) (fixes #49)
|
||||
|
||||
## v1.0.20
|
||||
- Default controls included (Fixes #45)
|
||||
- Volume changes on `input` as well as `change` (fixes #43)
|
||||
- Fix for undefined Play text
|
||||
- License changed to MIT
|
||||
|
||||
## v1.0.19
|
||||
- Fixed firefox fullscreen issue (fixes #38)
|
||||
|
||||
## v1.0.18
|
||||
- Added CDN references
|
||||
|
||||
## v1.0.17
|
||||
- SASS support added (thanks to @brunowego)
|
||||
- Docs completely separated to avoid any confusion
|
||||
- New gulp tasks (will add more documentation for this)
|
||||
|
||||
## v1.0.16
|
||||
- Aria label is now dynamic
|
||||
|
||||
## v1.0.15
|
||||
- Fix for seek time display in controls
|
||||
- More documentation for controls html
|
||||
|
||||
## v1.0.14
|
||||
- Minor change for bootstrap compatibility
|
||||
|
||||
## v1.0.13
|
||||
- Minor tweaks
|
||||
|
||||
## v1.0.12
|
||||
- Handle native events (issue #34)
|
||||
|
||||
## v1.0.11
|
||||
- Bug fixes for fullscreen mode
|
||||
|
||||
## v1.0.10
|
||||
- Bower includes src files now
|
||||
- Folder re-arrangement
|
||||
|
||||
## v1.0.9
|
||||
- Added buffer progress bar
|
||||
- Fixed Safari 8 caption track (it needs to be removed from the DOM like in Safari 7)
|
||||
- Added validation (it works or it doesn't basically) of the `html` option passed
|
||||
|
||||
## v1.0.8
|
||||
- Bug fix
|
||||
|
||||
## v1.0.7
|
||||
- Storing user selected volume in local storage
|
||||
|
||||
## v1.0.6
|
||||
- Fullscreen fallback for older browsers to use "full window"
|
||||
|
||||
## v1.0.5
|
||||
- More minor bug fixes and improvements
|
||||
|
||||
## v1.0.4
|
||||
- Fixed caption legibility issues
|
||||
|
||||
## v1.0.3
|
||||
- Minor bug fixes
|
||||
|
||||
## v1.0.2
|
||||
- Added OGG to <audio> example for Firefox
|
||||
- Fixed IE11 fullscreen issues
|
||||
|
||||
## v1.0.1
|
||||
- Bug fixes for IE (as per usual)
|
||||
- Added CSS hooks for media type
|
||||
- Return instances of Plyr to the element
|
||||
|
||||
## v1.0.0
|
||||
- Initial release
|
112
controls.md
Normal file
@ -0,0 +1,112 @@
|
||||
# Controls
|
||||
|
||||
This is the markup that is rendered for the Plyr controls. You can use the default controls or provide a customized version of markup based on your needs.
|
||||
|
||||
## Internationalization using default controls
|
||||
|
||||
You can provide an `i18n` object as one of your options when initialising the plugin which we be used when rendering the controls.
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
i18n: {
|
||||
restart: "Restart",
|
||||
rewind: "Rewind {seektime} secs",
|
||||
play: "Play",
|
||||
pause: "Pause",
|
||||
forward: "Forward {seektime} secs",
|
||||
buffered: "buffered",
|
||||
currentTime: "Current time",
|
||||
duration: "Duration",
|
||||
volume: "Volume",
|
||||
toggleMute: "Toggle Mute",
|
||||
toggleCaptions: "Toggle Captions",
|
||||
toggleFullscreen: "Toggle Fullscreen"
|
||||
}
|
||||
```
|
||||
|
||||
Note: `{seektime}` will be replaced with your configured seek time or the default. For example "Forward {seektime} secs" would render as "Forward 10 secs".
|
||||
|
||||
## Using custom HTML
|
||||
|
||||
You can specify the HTML for the controls using the `html` option.
|
||||
|
||||
The classes and data attributes used in your template should match the `selectors` option.
|
||||
|
||||
You need to add several placeholders to your html template that are replaced when rendering:
|
||||
|
||||
- `{id}` - the dynamically generated ID for the player (for form controls)
|
||||
- `{seektime}` - the seek time specified in options for fast forward and rewind
|
||||
|
||||
You can include only the controls you need when specifying custom html.
|
||||
|
||||
### Example
|
||||
|
||||
This is an example `html` option with all controls.
|
||||
|
||||
```javascript
|
||||
var controls = ["<div class='plyr__controls'>",
|
||||
"<button type='button' data-plyr='restart'>",
|
||||
"<svg><use xlink:href='#plyr-restart'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Restart</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='rewind'>",
|
||||
"<svg><use xlink:href='#plyr-rewind'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Rewind {seektime} secs</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='play'>",
|
||||
"<svg><use xlink:href='#plyr-play'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Play</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='pause'>",
|
||||
"<svg><use xlink:href='#plyr-pause'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Pause</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='fast-forward'>",
|
||||
"<svg><use xlink:href='#plyr-fast-forward'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Forward {seektime} secs</span>",
|
||||
"</button>",
|
||||
"<span class='plyr__progress'>",
|
||||
"<label for='seek{id}' class='plyr__sr-only'>Seek</label>",
|
||||
"<input id='seek{id}' class='plyr__progress--seek' type='range' min='0' max='100' step='0.1' value='0' data-plyr='seek'>",
|
||||
"<progress class='plyr__progress--played' max='100' value='0' role='presentation'></progress>",
|
||||
"<progress class='plyr__progress--buffer' max='100' value='0'>",
|
||||
"<span>0</span>% buffered",
|
||||
"</progress>",
|
||||
"<span class='plyr__tooltip'>00:00</span>",
|
||||
"</span>",
|
||||
"<span class='plyr__time'>",
|
||||
"<span class='plyr__sr-only'>Current time</span>",
|
||||
"<span class='plyr__time--current'>00:00</span>",
|
||||
"</span>",
|
||||
"<span class='plyr__time'>",
|
||||
"<span class='plyr__sr-only'>Duration</span>",
|
||||
"<span class='plyr__time--duration'>00:00</span>",
|
||||
"</span>",
|
||||
"<button type='button' data-plyr='mute'>",
|
||||
"<svg class='icon--muted'><use xlink:href='#plyr-muted'></use></svg>",
|
||||
"<svg><use xlink:href='#plyr-volume'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Toggle Mute</span>",
|
||||
"</button>",
|
||||
"<span class='plyr__volume'>",
|
||||
"<label for='volume{id}' class='plyr__sr-only'>Volume</label>",
|
||||
"<input id='volume{id}' class='plyr__volume--input' type='range' min='0' max='10' value='5' data-plyr='volume'>",
|
||||
"<progress class='plyr__volume--display' max='10' value='0' role='presentation'></progress>",
|
||||
"</span>",
|
||||
"<button type='button' data-plyr='captions'>",
|
||||
"<svg class='icon--captions-on'><use xlink:href='#plyr-captions-on'></use></svg>",
|
||||
"<svg><use xlink:href='#plyr-captions-off'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Toggle Captions</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='fullscreen'>",
|
||||
"<svg class='icon--exit-fullscreen'><use xlink:href='#plyr-exit-fullscreen'></use></svg>",
|
||||
"<svg><use xlink:href='#plyr-enter-fullscreen'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Toggle Fullscreen</span>",
|
||||
"</button>",
|
||||
"</div>"].join("");
|
||||
|
||||
// Setup the player
|
||||
plyr.setup('.js-player', {
|
||||
html: controls
|
||||
});
|
||||
```
|
1
demo/dist/demo.css
vendored
Normal file
1
demo/dist/demo.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,s=arguments.length;for(i=0;s>i;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",s=e.Element[i],o=Object,n=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=n.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],s=0,o=i.length;o>s;s++)this.push(i[s]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,i=0,s=t.length,o=!1;do e=t[i]+"",-1===c(this,e)&&(this.push(e),o=!0);while(++i<s);o&&this._updateClassName()},u.remove=function(){var e,t,i=arguments,s=0,o=i.length,n=!1;do for(e=i[s]+"",t=c(this,e);-1!==t;)this.splice(t,1),n=!0,t=c(this,e);while(++s<o);n&&this._updateClassName()},u.toggle=function(e,t){e+="";var i=this.contains(e),s=i?t!==!0&&"remove":t!==!1&&"add";return s&&this[s](e),t===!0||t===!1?t:!i},u.toString=function(){return this.join(" ")},o.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{o.defineProperty(s,t,p)}catch(h){-2146823252===h.number&&(p.enumerable=!1,o.defineProperty(s,t,p))}}else o[i].__defineGetter__&&s.__defineGetter__(t,d)}}(self)),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=s+(i?" "+t:"")}}function t(t,i){if(t in n&&(i||t!=r)&&(r.length||t!=n.video)){switch(t){case n.video:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"},{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm",type:"video/webm"}],poster:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt","default":!0}]});break;case n.audio:s.source({type:"audio",title:"Kishi Bashi – “It All Began With A Burst”",sources:[{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]});break;case n.youtube:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}r=t;for(var a=o.length-1;a>=0;a--)e(o[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}var i=plyr.setup({debug:!0,title:"Video demo",iconUrl:"../dist/plyr.svg",tooltips:{controls:!0},captions:{defaultActive:!0}});plyr.loadSprite("dist/demo.svg");for(var s=i[0],o=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},r=window.location.hash.replace("#",""),a=window.history&&window.history.pushState,c=o.length-1;c>=0;c--)o[c].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),a&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),a){var l=!r.length;l&&(r=n.video),r in n&&history.replaceState({type:r},"",l?"":"#"+r),r!==n.video&&t(r,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,s,o,n,r){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,n=t.createElement(i),r=t.getElementsByTagName(i)[0],n.async=1,n.src=s,r.parentNode.insertBefore(n,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));
|
1
demo/dist/demo.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon-github" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 .2c-4.4 0-8 3.6-8 8 0 3.5 2.3 6.5 5.5 7.6.4.1.5-.2.5-.4V14c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.3 1.9.9 2.3.7.1-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8.6-.2 1.3-.3 2-.3s1.4.1 2 .3c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.6.8 1.3.8 2.1 0 3.1-1.9 3.7-3.7 3.9.3.4.6.9.6 1.6v2.2c0 .2.1.5.6.4 3.2-1.1 5.5-4.1 5.5-7.6-.1-4.4-3.7-8-8.1-8z"/></symbol><symbol id="icon-twitter" viewBox="0 0 16 16"><title>Twitter</title><path d="M16 3c-.6.3-1.2.4-1.9.5.7-.4 1.2-1 1.4-1.8-.6.4-1.3.6-2.1.8-.6-.6-1.5-1-2.4-1-1.7 0-3.2 1.5-3.2 3.3 0 .3 0 .5.1.7-2.7-.1-5.2-1.4-6.8-3.4-.3.5-.4 1-.4 1.7 0 1.1.6 2.1 1.5 2.7-.5 0-1-.2-1.5-.4C.7 7.7 1.8 9 3.3 9.3c-.3.1-.6.1-.9.1-.2 0-.4 0-.6-.1.4 1.3 1.6 2.3 3.1 2.3-1.1.9-2.5 1.4-4.1 1.4H0c1.5.9 3.2 1.5 5 1.5 6 0 9.3-5 9.3-9.3v-.4C15 4.3 15.6 3.7 16 3z"/></symbol><symbol id="icon-vimeo" viewBox="0 0 16 16"><path d="M16 4.3c-.1 1.6-1.2 3.7-3.3 6.4-2.2 2.8-4 4.2-5.5 4.2-.9 0-1.7-.9-2.4-2.6C4 9.9 3.4 5 2 5c-.1 0-.5.3-1.2.8l-.8-1c.8-.7 3.5-3.4 4.7-3.5 1.2-.1 2 .7 2.3 2.5.3 2 .8 6.1 1.8 6.1.9 0 2.5-3.4 2.6-4 .1-.9-.3-1.9-2.3-1.1.8-2.6 2.3-3.8 4.5-3.8 1.7.1 2.5 1.2 2.4 3.3z"/></symbol><symbol id="icon-youtube" viewBox="0 0 16 16"><path d="M15.8 4.8c-.2-1.3-.8-2.2-2.2-2.4C11.4 2 8 2 8 2s-3.4 0-5.6.4C1 2.6.3 3.5.2 4.8 0 6.1 0 8 0 8s0 1.9.2 3.2c.2 1.3.8 2.2 2.2 2.4C4.6 14 8 14 8 14s3.4 0 5.6-.4c1.4-.3 2-1.1 2.2-2.4C16 9.9 16 8 16 8s0-1.9-.2-3.2zM6 11V5l5 3-5 3z"/></symbol></svg>
|
After Width: | Height: | Size: 1.7 KiB |
18
demo/error.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="error">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Doh. Looks like something went wrong.</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="dist/docs.css">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Doh.</h1>
|
||||
<p>Looks like something went wrong.</p>
|
||||
<a href="http://plyr.io" class="btn btn--primary">Back to plyr.io</a>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
88
demo/index.html
Normal file
@ -0,0 +1,88 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Plyr - A simple HTML5 media player</title>
|
||||
<meta name="description" content="A simple HTML5 media player with custom controls and WebVTT captions.">
|
||||
<meta name="author" content="Sam Potts">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="../dist/plyr.css">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="dist/demo.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Plyr</h1>
|
||||
<p>A simple, accessible HTML5 media player by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a> from <a href="https://twitter.com/selz" target="_blank">@selz</a></p>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/selz/plyr" target="_blank" class="btn btn--large btn--primary" data-shr-network="github">
|
||||
<svg class="icon"><use xlink:href="#icon-github"/></svg>Download on GitHub
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn btn--large btn--twitter" data-shr-network="twitter">
|
||||
<svg class="icon"><use xlink:href="#icon-twitter"/></svg>Tweet
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main role="main" id="main">
|
||||
<nav class="btn__bar">
|
||||
<ul>
|
||||
<li class="active">
|
||||
<button type="button" class="btn" data-source="video">Video</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" class="btn" data-source="audio">Audio</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" class="btn btn--youtube" data-source="youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" class="btn btn--vimeo" data-source="vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</button>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<section>
|
||||
<video poster="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg" controls crossorigin>
|
||||
<!-- Video files -->
|
||||
<source src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4" type="video/mp4">
|
||||
<source src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm" type="video/webm">
|
||||
|
||||
<!-- Text track file -->
|
||||
<track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt" default>
|
||||
|
||||
<!-- Fallback for browsers that don't support the <video> element -->
|
||||
<a href="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4" download>Download</a>
|
||||
</video>
|
||||
|
||||
<ul>
|
||||
<li class="plyr__cite plyr__cite--video"><small><a href="http://viewfromabluemoon.com/" target="_blank">View From A Blue Moon</a> © Brainfarm</small></li>
|
||||
<li class="plyr__cite plyr__cite--audio"><small><a href="http://www.kishibashi.com/" target="_blank">Kishi Bashi – “It All Began With A Burst”</a> © Kishi Bashi</small></li>
|
||||
<li class="plyr__cite plyr__cite--youtube"><small><a href="https://www.youtube.com/watch?v=bTqVqk7FSmY" target="_blank">View From A Blue Moon</a> on <span class="color--youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</span></small>
|
||||
<li class="plyr__cite plyr__cite--vimeo"><small><a href="https://vimeo.com/ondemand/viewfromabluemoon4k" target="_blank">View From A Blue Moon</a> on <span class="color--vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</span></small>
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Plyr core script -->
|
||||
<script src="../dist/plyr.js"></script>
|
||||
|
||||
<!-- Docs script -->
|
||||
<script src="dist/demo.js"></script>
|
||||
|
||||
<!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
|
||||
<script src="https://cdn.rangetouch.com/0.0.9/rangetouch.js" async></script>
|
||||
|
||||
<!-- Sharing libary (https://shr.one) -->
|
||||
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
|
||||
<script>if(window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }</script>
|
||||
</body>
|
||||
</html>
|
237
demo/src/js/lib/classlist.js
Normal file
@ -0,0 +1,237 @@
|
||||
/*
|
||||
* classList.js: Cross-browser full element.classList implementation.
|
||||
* 1.1.20150312
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* License: Dedicated to the public domain.
|
||||
* See https://github.com/eligrey/classList.js/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
/*global self, document, DOMException */
|
||||
|
||||
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
|
||||
|
||||
if ("document" in self) {
|
||||
|
||||
// Full polyfill for browsers with no classList support
|
||||
if (!("classList" in document.createElement("_"))) {
|
||||
|
||||
(function (view) {
|
||||
|
||||
"use strict";
|
||||
|
||||
if (!('Element' in view)) return;
|
||||
|
||||
var
|
||||
classListProp = "classList"
|
||||
, protoProp = "prototype"
|
||||
, elemCtrProto = view.Element[protoProp]
|
||||
, objCtr = Object
|
||||
, strTrim = String[protoProp].trim || function () {
|
||||
return this.replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
, arrIndexOf = Array[protoProp].indexOf || function (item) {
|
||||
var
|
||||
i = 0
|
||||
, len = this.length
|
||||
;
|
||||
for (; i < len; i++) {
|
||||
if (i in this && this[i] === item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
// Vendors: please allow content code to instantiate DOMExceptions
|
||||
, DOMEx = function (type, message) {
|
||||
this.name = type;
|
||||
this.code = DOMException[type];
|
||||
this.message = message;
|
||||
}
|
||||
, checkTokenAndGetIndex = function (classList, token) {
|
||||
if (token === "") {
|
||||
throw new DOMEx(
|
||||
"SYNTAX_ERR"
|
||||
, "An invalid or illegal string was specified"
|
||||
);
|
||||
}
|
||||
if (/\s/.test(token)) {
|
||||
throw new DOMEx(
|
||||
"INVALID_CHARACTER_ERR"
|
||||
, "String contains an invalid character"
|
||||
);
|
||||
}
|
||||
return arrIndexOf.call(classList, token);
|
||||
}
|
||||
, ClassList = function (elem) {
|
||||
var
|
||||
trimmedClasses = strTrim.call(elem.getAttribute("class") || "")
|
||||
, classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
|
||||
, i = 0
|
||||
, len = classes.length
|
||||
;
|
||||
for (; i < len; i++) {
|
||||
this.push(classes[i]);
|
||||
}
|
||||
this._updateClassName = function () {
|
||||
elem.setAttribute("class", this.toString());
|
||||
};
|
||||
}
|
||||
, classListProto = ClassList[protoProp] = []
|
||||
, classListGetter = function () {
|
||||
return new ClassList(this);
|
||||
}
|
||||
;
|
||||
// Most DOMException implementations don't allow calling DOMException's toString()
|
||||
// on non-DOMExceptions. Error's toString() is sufficient here.
|
||||
DOMEx[protoProp] = Error[protoProp];
|
||||
classListProto.item = function (i) {
|
||||
return this[i] || null;
|
||||
};
|
||||
classListProto.contains = function (token) {
|
||||
token += "";
|
||||
return checkTokenAndGetIndex(this, token) !== -1;
|
||||
};
|
||||
classListProto.add = function () {
|
||||
var
|
||||
tokens = arguments
|
||||
, i = 0
|
||||
, l = tokens.length
|
||||
, token
|
||||
, updated = false
|
||||
;
|
||||
do {
|
||||
token = tokens[i] + "";
|
||||
if (checkTokenAndGetIndex(this, token) === -1) {
|
||||
this.push(token);
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
while (++i < l);
|
||||
|
||||
if (updated) {
|
||||
this._updateClassName();
|
||||
}
|
||||
};
|
||||
classListProto.remove = function () {
|
||||
var
|
||||
tokens = arguments
|
||||
, i = 0
|
||||
, l = tokens.length
|
||||
, token
|
||||
, updated = false
|
||||
, index
|
||||
;
|
||||
do {
|
||||
token = tokens[i] + "";
|
||||
index = checkTokenAndGetIndex(this, token);
|
||||
while (index !== -1) {
|
||||
this.splice(index, 1);
|
||||
updated = true;
|
||||
index = checkTokenAndGetIndex(this, token);
|
||||
}
|
||||
}
|
||||
while (++i < l);
|
||||
|
||||
if (updated) {
|
||||
this._updateClassName();
|
||||
}
|
||||
};
|
||||
classListProto.toggle = function (token, force) {
|
||||
token += "";
|
||||
|
||||
var
|
||||
result = this.contains(token)
|
||||
, method = result ?
|
||||
force !== true && "remove"
|
||||
:
|
||||
force !== false && "add"
|
||||
;
|
||||
|
||||
if (method) {
|
||||
this[method](token);
|
||||
}
|
||||
|
||||
if (force === true || force === false) {
|
||||
return force;
|
||||
} else {
|
||||
return !result;
|
||||
}
|
||||
};
|
||||
classListProto.toString = function () {
|
||||
return this.join(" ");
|
||||
};
|
||||
|
||||
if (objCtr.defineProperty) {
|
||||
var classListPropDesc = {
|
||||
get: classListGetter
|
||||
, enumerable: true
|
||||
, configurable: true
|
||||
};
|
||||
try {
|
||||
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||
} catch (ex) { // IE 8 doesn't support enumerable:true
|
||||
if (ex.number === -0x7FF5EC54) {
|
||||
classListPropDesc.enumerable = false;
|
||||
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||
}
|
||||
}
|
||||
} else if (objCtr[protoProp].__defineGetter__) {
|
||||
elemCtrProto.__defineGetter__(classListProp, classListGetter);
|
||||
}
|
||||
|
||||
}(self));
|
||||
|
||||
} else {
|
||||
// There is full or partial native classList support, so just check if we need
|
||||
// to normalize the add/remove and toggle APIs.
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var testElement = document.createElement("_");
|
||||
|
||||
testElement.classList.add("c1", "c2");
|
||||
|
||||
// Polyfill for IE 10/11 and Firefox <26, where classList.add and
|
||||
// classList.remove exist but support only one argument at a time.
|
||||
if (!testElement.classList.contains("c2")) {
|
||||
var createMethod = function(method) {
|
||||
var original = DOMTokenList.prototype[method];
|
||||
|
||||
DOMTokenList.prototype[method] = function(token) {
|
||||
var i, len = arguments.length;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
token = arguments[i];
|
||||
original.call(this, token);
|
||||
}
|
||||
};
|
||||
};
|
||||
createMethod('add');
|
||||
createMethod('remove');
|
||||
}
|
||||
|
||||
testElement.classList.toggle("c3", false);
|
||||
|
||||
// Polyfill for IE 10 and Firefox <24, where classList.toggle does not
|
||||
// support the second argument.
|
||||
if (testElement.classList.contains("c3")) {
|
||||
var _toggle = DOMTokenList.prototype.toggle;
|
||||
|
||||
DOMTokenList.prototype.toggle = function(token, force) {
|
||||
if (1 in arguments && !this.contains(token) === !force) {
|
||||
return force;
|
||||
} else {
|
||||
return _toggle.call(this, token);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
testElement = null;
|
||||
}());
|
||||
|
||||
}
|
||||
|
||||
}
|
185
demo/src/js/main.js
Normal file
@ -0,0 +1,185 @@
|
||||
// ==========================================================================
|
||||
// Plyr.io demo
|
||||
// This code is purely for the plyr.io website
|
||||
// Please see readme.md in the root or github.com/selz/plyr
|
||||
// ==========================================================================
|
||||
|
||||
/*global plyr*/
|
||||
|
||||
// General functions
|
||||
;(function() {
|
||||
//document.body.addEventListener('ready', function(event) { console.log(event); });
|
||||
|
||||
// Setup the player
|
||||
var instances = plyr.setup({
|
||||
debug: true,
|
||||
title: 'Video demo',
|
||||
iconUrl: '../dist/plyr.svg',
|
||||
tooltips: {
|
||||
controls: true
|
||||
},
|
||||
captions: {
|
||||
defaultActive: true
|
||||
}
|
||||
});
|
||||
plyr.loadSprite('dist/demo.svg');
|
||||
|
||||
// Plyr returns an array regardless
|
||||
var player = instances[0];
|
||||
|
||||
// Setup type toggle
|
||||
var buttons = document.querySelectorAll('[data-source]'),
|
||||
types = {
|
||||
video: 'video',
|
||||
audio: 'audio',
|
||||
youtube: 'youtube',
|
||||
vimeo: 'vimeo'
|
||||
},
|
||||
currentType = window.location.hash.replace('#', ''),
|
||||
historySupport = (window.history && window.history.pushState);
|
||||
|
||||
// Bind to each button
|
||||
for (var i = buttons.length - 1; i >= 0; i--) {
|
||||
buttons[i].addEventListener('click', function() {
|
||||
var type = this.getAttribute('data-source');
|
||||
|
||||
newSource(type);
|
||||
|
||||
if (historySupport) {
|
||||
history.pushState({ 'type': type }, '', '#' + type);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// List for backwards/forwards
|
||||
window.addEventListener('popstate', function(event) {
|
||||
if(event.state && 'type' in event.state) {
|
||||
newSource(event.state.type);
|
||||
}
|
||||
});
|
||||
|
||||
// On load
|
||||
if(historySupport) {
|
||||
var video = !currentType.length;
|
||||
|
||||
// If there's no current type set, assume video
|
||||
if(video) {
|
||||
currentType = types.video;
|
||||
}
|
||||
|
||||
// Replace current history state
|
||||
if(currentType in types) {
|
||||
history.replaceState({ 'type': currentType }, '', (video ? '' : '#' + currentType));
|
||||
}
|
||||
|
||||
// If it's not video, load the source
|
||||
if(currentType !== types.video) {
|
||||
newSource(currentType, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle class on an element
|
||||
function toggleClass(element, className, state) {
|
||||
if (element) {
|
||||
if (element.classList) {
|
||||
element.classList[state ? 'add' : 'remove'](className);
|
||||
}
|
||||
else {
|
||||
var name = (' ' + element.className + ' ').replace(/\s+/g, ' ').replace(' ' + className + ' ', '');
|
||||
element.className = name + (state ? ' ' + className : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set a new source
|
||||
function newSource(type, init) {
|
||||
// Bail if new type isn't known, it's the current type, or current type is empty (video is default) and new type is video
|
||||
if(!(type in types) || (!init && type == currentType) || (!currentType.length && type == types.video)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch(type) {
|
||||
case types.video:
|
||||
player.source({
|
||||
type: 'video',
|
||||
title: 'View From A Blue Moon',
|
||||
sources: [{
|
||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4',
|
||||
type: 'video/mp4'
|
||||
},
|
||||
{
|
||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm',
|
||||
type: 'video/webm'
|
||||
}],
|
||||
poster: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg',
|
||||
tracks: [{
|
||||
kind: 'captions',
|
||||
label: 'English',
|
||||
srclang:'en',
|
||||
src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt',
|
||||
default: true
|
||||
}]
|
||||
});
|
||||
break;
|
||||
|
||||
case types.audio:
|
||||
player.source({
|
||||
type: 'audio',
|
||||
title: 'Kishi Bashi – “It All Began With A Burst”',
|
||||
sources: [{
|
||||
src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3',
|
||||
type: 'audio/mp3'
|
||||
},
|
||||
{
|
||||
src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg',
|
||||
type: 'audio/ogg'
|
||||
}]
|
||||
});
|
||||
break;
|
||||
|
||||
case types.youtube:
|
||||
player.source({
|
||||
type: 'video',
|
||||
title: 'View From A Blue Moon',
|
||||
sources: [{
|
||||
src: 'bTqVqk7FSmY',
|
||||
type: 'youtube'
|
||||
}]
|
||||
});
|
||||
break;
|
||||
|
||||
case types.vimeo:
|
||||
player.source({
|
||||
type: 'video',
|
||||
title: 'View From A Blue Moon',
|
||||
sources: [{
|
||||
src: '143418951',
|
||||
type: 'vimeo'
|
||||
}]
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
// Set the current type for next time
|
||||
currentType = type;
|
||||
|
||||
// Remove active classes
|
||||
for (var x = buttons.length - 1; x >= 0; x--) {
|
||||
toggleClass(buttons[x].parentElement, 'active', false);
|
||||
}
|
||||
|
||||
// Set active on parent
|
||||
toggleClass(document.querySelector('[data-source="'+ type +'"]').parentElement, 'active', true);
|
||||
}
|
||||
})();
|
||||
|
||||
// Google analytics
|
||||
// For demo site (http://[www.]plyr.io) only
|
||||
if(document.domain.indexOf('plyr.io') > -1) {
|
||||
(function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-40881672-11', 'auto');
|
||||
ga('send', 'pageview');
|
||||
}
|
48
demo/src/less/components/base.less
Normal file
@ -0,0 +1,48 @@
|
||||
// ==========================================================================
|
||||
// Base layout
|
||||
// ==========================================================================
|
||||
|
||||
// BORDER-BOX ALL THE THINGS!
|
||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||
*, *::after, *::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// Hidden
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Base
|
||||
html {
|
||||
height: 100%;
|
||||
background: @body-background fixed;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: (@padding-base / 2);
|
||||
}
|
||||
|
||||
// Header
|
||||
header {
|
||||
padding: @padding-base;
|
||||
margin-bottom: @padding-base;
|
||||
|
||||
p {
|
||||
.font-size(18);
|
||||
}
|
||||
@media (min-width: @screen-sm) {
|
||||
padding-top: (@padding-base * 3);
|
||||
padding-bottom: (@padding-base * 3);
|
||||
}
|
||||
}
|
||||
|
||||
// Sections
|
||||
section {
|
||||
max-width: @example-width-video;
|
||||
margin: 0 auto @padding-base;
|
||||
|
||||
@media (min-width: @screen-sm) {
|
||||
margin-bottom: (@padding-base * 2);
|
||||
}
|
||||
}
|
172
demo/src/less/components/buttons.less
Normal file
@ -0,0 +1,172 @@
|
||||
// ==========================================================================
|
||||
// Buttons
|
||||
// ==========================================================================
|
||||
|
||||
nav {
|
||||
ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 0;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
margin-top: (@padding-base / 2);
|
||||
.font-size();
|
||||
white-space: nowrap;
|
||||
}
|
||||
li + li {
|
||||
margin-left: @padding-base;
|
||||
}
|
||||
}
|
||||
|
||||
// Tabs
|
||||
.btn__bar {
|
||||
position: relative;
|
||||
margin: 0 auto @padding-base;
|
||||
max-width: @example-width-video;
|
||||
white-space: nowrap;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
background: @gray-lighter;
|
||||
}
|
||||
|
||||
ul {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: inline-block;
|
||||
user-select: none;
|
||||
}
|
||||
li {
|
||||
margin: 0;
|
||||
|
||||
&:first-child .btn {
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
&:last-child .btn {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
& + li .btn {
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
&.active .btn {
|
||||
&:extend(.btn--primary);
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0, .2);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
.icon {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
&.active + li .btn:hover {
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
position: relative;
|
||||
display: block;
|
||||
border-radius: 0;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 560px) {
|
||||
margin-bottom: (@padding-base * 2);
|
||||
}
|
||||
}
|
||||
|
||||
// Shared
|
||||
.btn,
|
||||
.btn__count {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
border-radius: @border-radius-base;
|
||||
user-select: none;
|
||||
font-weight: @font-weight-bold;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
.btn {
|
||||
padding: (@padding-base / 2) ((@padding-base / 2) + 2);
|
||||
background: linear-gradient(lighten(@off-white, 2%), darken(@off-white, 3%));
|
||||
border: 1px solid @gray-light;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0, .05);
|
||||
text-shadow: 0 1px 1px #fff;
|
||||
color: @gray;
|
||||
transition: background .1s ease, color .1s ease;
|
||||
.font-size(@font-size-small);
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
border-color: darken(@gray-light, 8%);
|
||||
color: @gray;
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Sizes
|
||||
.btn--large {
|
||||
padding: (@padding-base / 2) @padding-base;
|
||||
.font-size();
|
||||
}
|
||||
|
||||
// Styles
|
||||
.btn--primary {
|
||||
background-image: linear-gradient(@link-color, darken(@link-color, 5%));
|
||||
background-color: @link-color;
|
||||
border-color: darken(@link-color, 10%);
|
||||
box-shadow: 0 1px 1px rgba(0,0,0, .15);
|
||||
text-shadow: 0 1px 1px rgba(0,0,0, .1);
|
||||
color: #fff;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: #fff;
|
||||
border-color: darken(@link-color, 20%);
|
||||
}
|
||||
}
|
||||
.btn--youtube .icon {
|
||||
color: @color-youtube;
|
||||
}
|
||||
.btn--vimeo .icon {
|
||||
color: @color-vimeo;
|
||||
}
|
||||
.btn--twitter .icon {
|
||||
color: @color-twitter;
|
||||
}
|
||||
|
||||
// Count bubble
|
||||
.btn__count {
|
||||
position: relative;
|
||||
margin-left: (@padding-base / 2);
|
||||
padding: (@padding-base / 2) (@padding-base * .75);
|
||||
background: #fff;
|
||||
border: 1px solid @gray-light;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: @arrow-size;
|
||||
height: @arrow-size;
|
||||
left: 1px;
|
||||
top: 50%;
|
||||
margin-top: -(@arrow-size / 2);
|
||||
|
||||
background: inherit;
|
||||
border: inherit;
|
||||
border-width: 1px 0 0 1px;
|
||||
transform: rotate(-45deg) translate(-50%, -50%);
|
||||
}
|
||||
}
|
19
demo/src/less/components/error.less
Normal file
@ -0,0 +1,19 @@
|
||||
// ==========================================================================
|
||||
// Errors (AWS pages)
|
||||
// ==========================================================================
|
||||
|
||||
// Error page
|
||||
html.error,
|
||||
.error body {
|
||||
height: 100%;
|
||||
}
|
||||
.error body {
|
||||
width: 100%;
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
}
|
||||
.error main {
|
||||
display: table-cell;
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
46
demo/src/less/components/examples.less
Normal file
@ -0,0 +1,46 @@
|
||||
// ==========================================================================
|
||||
// Examples
|
||||
// ==========================================================================
|
||||
|
||||
// For non supported browsers
|
||||
video {
|
||||
max-width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// Example players
|
||||
.plyr {
|
||||
margin: 0 auto;
|
||||
border-radius: @border-radius-large;
|
||||
}
|
||||
.plyr--audio {
|
||||
max-width: @example-width-audio;
|
||||
}
|
||||
.plyr__video-wrapper::after {
|
||||
content: "";
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border: 1px solid fade(#000, 15%);
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
// Style full supported player
|
||||
.plyr__cite {
|
||||
display: none;
|
||||
margin-top: @padding-base;
|
||||
|
||||
.icon {
|
||||
margin-right: (@padding-base / 4);
|
||||
}
|
||||
}
|
||||
|
||||
.plyr--video:not(.plyr--youtube):not(.plyr--vimeo) ~ ul .plyr__cite--video,
|
||||
.plyr--audio ~ ul .plyr__cite--audio,
|
||||
.plyr--youtube ~ ul .plyr__cite--youtube,
|
||||
.plyr--vimeo ~ ul .plyr__cite--vimeo {
|
||||
display: block;
|
||||
}
|
26
demo/src/less/components/icons.less
Normal file
@ -0,0 +1,26 @@
|
||||
// ==========================================================================
|
||||
// Icons
|
||||
// ==========================================================================
|
||||
|
||||
// Base size icon styles
|
||||
.icon {
|
||||
fill: currentColor;
|
||||
width: @icon-size;
|
||||
height: @icon-size;
|
||||
vertical-align: -3px;
|
||||
}
|
||||
|
||||
// Within elements
|
||||
a svg,
|
||||
button svg,
|
||||
label svg {
|
||||
pointer-events: none;
|
||||
}
|
||||
a .icon,
|
||||
.btn .icon {
|
||||
margin-right: (@padding-base / 2);
|
||||
}
|
||||
.btn:not(.btn-large) .icon {
|
||||
width: (@icon-size - 2);
|
||||
height: (@icon-size - 2);
|
||||
}
|
75
demo/src/less/components/type.less
Normal file
@ -0,0 +1,75 @@
|
||||
// ==========================================================================
|
||||
// Typography
|
||||
// ==========================================================================
|
||||
|
||||
// Base
|
||||
html {
|
||||
font-size: 100%;
|
||||
}
|
||||
body {
|
||||
font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
color: @gray;
|
||||
font-weight: @font-weight-base;
|
||||
.font-smoothing();
|
||||
}
|
||||
|
||||
// Headings
|
||||
h1,
|
||||
h2 {
|
||||
letter-spacing: -.025em;
|
||||
color: @brand-primary;
|
||||
margin: 0 0 (@padding-base / 2);
|
||||
line-height: 1.2;
|
||||
font-weight: @font-weight-bold;
|
||||
}
|
||||
h1 {
|
||||
.font-size(@font-size-h1);
|
||||
}
|
||||
|
||||
// Paragraph and small
|
||||
p,
|
||||
small {
|
||||
margin: 0 0 @padding-base;
|
||||
}
|
||||
small {
|
||||
display: block;
|
||||
padding: 0 (@padding-base / 2);
|
||||
.font-size(@font-size-small);
|
||||
}
|
||||
|
||||
// Lists
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
// Links
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: @link-color;
|
||||
border-bottom: 1px dotted currentColor;
|
||||
transition: background .3s ease, color .3s ease, border .3s ease;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: @gray-dark;
|
||||
border-bottom-color: rgba(0,0,0,0);
|
||||
}
|
||||
&:focus {
|
||||
.tab-focus();
|
||||
}
|
||||
&.logo {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.color--vimeo {
|
||||
color: @color-vimeo;
|
||||
}
|
||||
.color--youtube {
|
||||
color: @color-youtube;
|
||||
}
|
26
demo/src/less/demo.less
Normal file
@ -0,0 +1,26 @@
|
||||
// ==========================================================================
|
||||
// Plyr.io Demo Page
|
||||
// ==========================================================================
|
||||
|
||||
// CSS Reset
|
||||
@import "lib/normalize.less";
|
||||
|
||||
// Mixins
|
||||
@import "lib/mixins.less";
|
||||
|
||||
// Variables
|
||||
@import "variables.less";
|
||||
|
||||
// Animation
|
||||
@import "lib/animation.less";
|
||||
|
||||
// Type
|
||||
@import "lib/fontface.less";
|
||||
@import "components/type.less";
|
||||
|
||||
// Components
|
||||
@import "components/base.less";
|
||||
@import "components/icons.less";
|
||||
@import "components/buttons.less";
|
||||
@import "components/error.less";
|
||||
@import "components/examples.less";
|
9
demo/src/less/lib/animation.less
Normal file
@ -0,0 +1,9 @@
|
||||
// ==========================================================================
|
||||
// Animations
|
||||
// ==========================================================================
|
||||
|
||||
// Fade
|
||||
@keyframes fade-in {
|
||||
0% { opacity: 0 }
|
||||
100% { opacity: 1 }
|
||||
}
|
18
demo/src/less/lib/fontface.less
Normal file
@ -0,0 +1,18 @@
|
||||
// ==========================================================================
|
||||
// Fonts
|
||||
// ==========================================================================
|
||||
|
||||
@font-face {
|
||||
font-family: "Avenir";
|
||||
src: url("//cdn.plyr.io/fonts/avenir-medium.woff2") format("woff2"),
|
||||
url("//cdn.plyr.io/fonts/avenir-medium.woff") format("woff");
|
||||
font-style: normal;
|
||||
font-weight: @font-weight-base;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Avenir";
|
||||
src: url("//cdn.plyr.io/fonts/avenir-bold.woff2") format("woff2"),
|
||||
url("//cdn.plyr.io/fonts/avenir-bold.woff") format("woff");
|
||||
font-style: normal;
|
||||
font-weight: @font-weight-bold;
|
||||
}
|
@ -5,37 +5,37 @@
|
||||
// Contain floats: nicolasgallagher.com/micro-clearfix-hack/
|
||||
// ---------------------------------------
|
||||
.clearfix() {
|
||||
zoom: 1;
|
||||
&:before,
|
||||
&:after { content: ""; display: table; }
|
||||
&:after { clear: both; }
|
||||
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;
|
||||
// Default
|
||||
outline: thin dotted @gray-dark;
|
||||
// Webkit
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
// Use rems for font sizing
|
||||
// Leave <body> at 100%/16px
|
||||
// ---------------------------------------
|
||||
.font-size(@font-size: 16){
|
||||
@rem: (@font-size / 10);
|
||||
font-size: @font-size * 1px;
|
||||
font-size: ~"@{rem}rem";
|
||||
@rem: round((@font-size / 16), 3);
|
||||
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;
|
||||
-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;
|
||||
-moz-osx-font-smoothing: auto;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
}
|
48
demo/src/less/variables.less
Normal file
@ -0,0 +1,48 @@
|
||||
// ==========================================================================
|
||||
// Variables
|
||||
// ==========================================================================
|
||||
|
||||
// Colors
|
||||
@gray-dark: #343f4a;
|
||||
@gray: #55646b;
|
||||
@gray-light: #cbd0d3;
|
||||
@gray-lighter: #dbe3e8;
|
||||
@off-white: #f2f5f7;
|
||||
|
||||
@brand-primary: #3498db;
|
||||
@brand-secondary: #02BD9B;
|
||||
|
||||
// Brands
|
||||
@color-twitter: #4BAAF4;
|
||||
@color-youtube: #cc181e;
|
||||
@color-vimeo: #19b7ed;
|
||||
|
||||
// Base
|
||||
@body-background: @off-white; //linear-gradient(to left top, @brand-secondary, @brand-primary);
|
||||
|
||||
// Type
|
||||
@font-size-base: 16;
|
||||
@font-size-small: 14;
|
||||
@font-size-h1: 64;
|
||||
@font-weight-base: 500;
|
||||
@font-weight-bold: 700;
|
||||
|
||||
// Elements
|
||||
@link-color: @brand-primary;
|
||||
@padding-base: 20px;
|
||||
@arrow-size: 8px;
|
||||
|
||||
// Icons
|
||||
@icon-size: 18px;
|
||||
|
||||
// Breakpoints
|
||||
@screen-sm: 480px;
|
||||
@screen-md: 768px;
|
||||
|
||||
// Radii
|
||||
@border-radius-base: 4px;
|
||||
@border-radius-large: 6px;
|
||||
|
||||
// Examples
|
||||
@example-width-audio: 520px;
|
||||
@example-width-video: 1200px;
|
12
demo/src/sprite/icon-github.svg
Executable file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8,0.2c-4.4,0-8,3.6-8,8c0,3.5,2.3,6.5,5.5,7.6
|
||||
C5.9,15.9,6,15.6,6,15.4c0-0.2,0-0.7,0-1.4C3.8,14.5,3.3,13,3.3,13c-0.4-0.9-0.9-1.2-0.9-1.2c-0.7-0.5,0.1-0.5,0.1-0.5
|
||||
c0.8,0.1,1.2,0.8,1.2,0.8C4.4,13.4,5.6,13,6,12.8c0.1-0.5,0.3-0.9,0.5-1.1c-1.8-0.2-3.6-0.9-3.6-4c0-0.9,0.3-1.6,0.8-2.1
|
||||
c-0.1-0.2-0.4-1,0.1-2.1c0,0,0.7-0.2,2.2,0.8c0.6-0.2,1.3-0.3,2-0.3c0.7,0,1.4,0.1,2,0.3c1.5-1,2.2-0.8,2.2-0.8
|
||||
c0.4,1.1,0.2,1.9,0.1,2.1c0.5,0.6,0.8,1.3,0.8,2.1c0,3.1-1.9,3.7-3.7,3.9C9.7,12,10,12.5,10,13.2c0,1.1,0,1.9,0,2.2
|
||||
c0,0.2,0.1,0.5,0.6,0.4c3.2-1.1,5.5-4.1,5.5-7.6C16,3.8,12.4,0.2,8,0.2z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
11
demo/src/sprite/icon-twitter.svg
Executable file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<title>Twitter</title>
|
||||
<path d="M16,3c-0.6,0.3-1.2,0.4-1.9,0.5c0.7-0.4,1.2-1,1.4-1.8c-0.6,0.4-1.3,0.6-2.1,0.8c-0.6-0.6-1.5-1-2.4-1
|
||||
C9.3,1.5,7.8,3,7.8,4.8c0,0.3,0,0.5,0.1,0.7C5.2,5.4,2.7,4.1,1.1,2.1c-0.3,0.5-0.4,1-0.4,1.7c0,1.1,0.6,2.1,1.5,2.7
|
||||
c-0.5,0-1-0.2-1.5-0.4c0,0,0,0,0,0c0,1.6,1.1,2.9,2.6,3.2C3,9.4,2.7,9.4,2.4,9.4c-0.2,0-0.4,0-0.6-0.1c0.4,1.3,1.6,2.3,3.1,2.3
|
||||
c-1.1,0.9-2.5,1.4-4.1,1.4c-0.3,0-0.5,0-0.8,0c1.5,0.9,3.2,1.5,5,1.5c6,0,9.3-5,9.3-9.3c0-0.1,0-0.3,0-0.4C15,4.3,15.6,3.7,16,3z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 981 B |
9
demo/src/sprite/icon-vimeo.svg
Executable file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<path d="M16,4.3c-0.1,1.6-1.2,3.7-3.3,6.4c-2.2,2.8-4,4.2-5.5,4.2c-0.9,0-1.7-0.9-2.4-2.6C4,9.9,3.4,5,2,5
|
||||
C1.9,5,1.5,5.3,0.8,5.8L0,4.8c0.8-0.7,3.5-3.4,4.7-3.5C5.9,1.2,6.7,2,7,3.8c0.3,2,0.8,6.1,1.8,6.1c0.9,0,2.5-3.4,2.6-4
|
||||
c0.1-0.9-0.3-1.9-2.3-1.1c0.8-2.6,2.3-3.8,4.5-3.8C15.3,1.1,16.1,2.2,16,4.3z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 779 B |
9
demo/src/sprite/icon-youtube.svg
Executable file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
||||
<path d="M15.8,4.8c-0.2-1.3-0.8-2.2-2.2-2.4C11.4,2,8,2,8,2S4.6,2,2.4,2.4C1,2.6,0.3,3.5,0.2,4.8C0,6.1,0,8,0,8
|
||||
s0,1.9,0.2,3.2c0.2,1.3,0.8,2.2,2.2,2.4C4.6,14,8,14,8,14s3.4,0,5.6-0.4c1.4-0.3,2-1.1,2.2-2.4C16,9.9,16,8,16,8S16,6.1,15.8,4.8z
|
||||
M6,11V5l5,3L6,11z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 739 B |
Before Width: | Height: | Size: 420 B |
Before Width: | Height: | Size: 360 B |
Before Width: | Height: | Size: 157 B |
Before Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 441 B |
Before Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 419 B |
@ -1,7 +0,0 @@
|
||||
The *SVG* folder contains the icons you selected as separate SVG files.
|
||||
|
||||
The *demo.html* lists the icons that you selected. To learn how to insert your icons as inline SVGs (with the <use> element), refer to the source of this HTML file. If you prefer to reference an external SVG instead of embedding it in the HTML, you will need to use javascript to fetch the SVG in order to make sure your SVGs will work fine in IE. IcoMoon's Quick Usage mode can take care of that and host your SVGs too.
|
||||
|
||||
You can ignore the *svgdefs.svg* file. It contains the same SVG <symbol> definitions as the ones you can find in the demo.html file.
|
||||
|
||||
If you prefer using PNGs or CSS sprites, refer to the Preferences panel of the IcoMoon app before downloading your zip pack.
|
@ -1,6 +0,0 @@
|
||||
<?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" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 741 B |
@ -1,6 +0,0 @@
|
||||
<?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" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 650 B |
@ -1,6 +0,0 @@
|
||||
<?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 2h-16c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1h16c0.552 0 1-0.448 1-1v-12c0-0.552-0.448-1-1-1zM2 4h2v2h-2v-2zM2 8h2v2h-2v-2zM2 14v-2h2v2h-2zM6 14v-10h6v10h-6zM16 14h-2v-2h2v2zM16 10h-2v-2h2v2zM16 6h-2v-2h2v2z" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 568 B |
@ -1,6 +0,0 @@
|
||||
<?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="M16 1h-14c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1h5.5c-0.829 0-1.5 0.671-1.5 1.5v0.5h6v-0.5c0-0.829-0.671-1.5-1.5-1.5h5.5c0.552 0 1-0.448 1-1v-12c0-0.552-0.448-1-1-1zM15 12.5c0 0.276-0.224 0.5-0.5 0.5h-11c-0.276 0-0.5-0.224-0.5-0.5v-9c0-0.276 0.224-0.5 0.5-0.5h11c0.276 0 0.5 0.224 0.5 0.5v9z" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 649 B |
@ -1,6 +0,0 @@
|
||||
<?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" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 530 B |
@ -1,7 +0,0 @@
|
||||
<?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" fill="#444444"></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" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1,7 +0,0 @@
|
||||
<?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" fill="#444444"></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" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1,7 +0,0 @@
|
||||
<?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 9c0-4.418-3.582-8-8-8s-8 3.582-8 8c0 4.418 3.582 8 8 8s8-3.582 8-8zM3 9c0-3.309 2.691-6 6-6s6 2.691 6 6-2.691 6-6 6-6-2.691-6-6z" fill="#444444"></path>
|
||||
<path d="M9.998 12.010v-3.633l1.293 1.317c0.392 0.388 1.025 0.388 1.417 0s0.391-1.016 0-1.403l-2.967-3c-0.188-0.186-0.442-0.291-0.709-0.291-0.011 0-0.023 0-0.034 0.001s-0.023-0.001-0.034-0.001c-0.266 0-0.521 0.105-0.709 0.291l-2.967 3c-0.391 0.388-0.391 1.016 0 1.403s1.025 0.388 1.417 0l1.294-1.317v3.633c0 0.547 0.443 0.99 0.99 0.99h0.018c0.547 0 0.99-0.443 0.99-0.99z" fill="#444444"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 880 B |
@ -1,147 +0,0 @@
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
line-height: 1.5;
|
||||
color: #555;
|
||||
background: #fff;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
font-weight: normal;
|
||||
box-shadow: 0 1px #ddd, 0 2px #fff, 0 3px #ddd;
|
||||
}
|
||||
small {
|
||||
font-size: .66666667em;
|
||||
}
|
||||
a {
|
||||
color: #e74c3c;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover, a:focus {
|
||||
box-shadow: 0 1px #e74c3c;
|
||||
}
|
||||
.bshadow0, input {
|
||||
box-shadow: inset 0 -2px #e7e7e7;
|
||||
}
|
||||
input:hover {
|
||||
box-shadow: inset 0 -2px #ccc;
|
||||
}
|
||||
input, fieldset {
|
||||
font-size: 1em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
input {
|
||||
color: inherit;
|
||||
line-height: 1.5;
|
||||
height: 1.5em;
|
||||
padding: .25em 0;
|
||||
}
|
||||
input:focus {
|
||||
outline: none;
|
||||
box-shadow: inset 0 -2px #449fdb;
|
||||
}
|
||||
.glyph {
|
||||
font-size: 16px;
|
||||
width: 17em;
|
||||
margin-right: 1.5em;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
.glyph svg {
|
||||
color: #444444;
|
||||
}
|
||||
.liga {
|
||||
width: 80%;
|
||||
width: calc(100% - 2.5em);
|
||||
}
|
||||
.talign-right {
|
||||
text-align: right;
|
||||
}
|
||||
.talign-center {
|
||||
text-align: center;
|
||||
}
|
||||
.bgc1 {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
.fgc0 {
|
||||
color: #000;
|
||||
}
|
||||
.fgc1 {
|
||||
color: #999;
|
||||
}
|
||||
p {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.mvm {
|
||||
margin-top: .75em;
|
||||
margin-bottom: .75em;
|
||||
}
|
||||
.mtn {
|
||||
margin-top: 0;
|
||||
}
|
||||
.mtl, .mal {
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
.mbl, .mal {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
.mal, .mhl {
|
||||
margin-left: 1.5em;
|
||||
margin-right: 1.5em;
|
||||
}
|
||||
.mhmm {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
.mls {
|
||||
margin-left: .25em;
|
||||
}
|
||||
.ptl {
|
||||
padding-top: 1.5em;
|
||||
}
|
||||
.pbs, .pvs {
|
||||
padding-bottom: .25em;
|
||||
}
|
||||
.pvs, .pts {
|
||||
padding-top: .25em;
|
||||
}
|
||||
.unit {
|
||||
float: left;
|
||||
}
|
||||
.unitRight {
|
||||
float: right;
|
||||
}
|
||||
.size1of2 {
|
||||
width: 50%;
|
||||
}
|
||||
.size1of1 {
|
||||
width: 100%;
|
||||
}
|
||||
.clearfix:before, .clearfix:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both;
|
||||
}
|
||||
.hidden-true {
|
||||
display: none;
|
||||
}
|
||||
.textbox0 {
|
||||
width: 3em;
|
||||
background: #f1f1f1;
|
||||
padding: .25em .5em;
|
||||
line-height: 1.5;
|
||||
height: 1.5em;
|
||||
}
|
||||
.fs0 {
|
||||
font-size: 16px;
|
||||
}
|
||||
.fs1 {
|
||||
font-size: 18px;
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>IcoMoon - SVG Icons</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="stylesheet" href="demo-files/demo.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<svg display="none" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<symbol id="icon-bubble" viewBox="0 0 1024 1024">
|
||||
<title>bubble</title>
|
||||
<path class="path1" d="M512.889 170.667c156.334 0 283.556 127.596 283.556 284.444s-127.221 284.444-282.722 284.459l-3.388-0.208c-3.14-0.222-6.251-0.412-9.388-0.555l-19.111-0.791-208.473 62.485 35.778-141.227-29.388-42.51c-32.974-47.751-50.418-103.653-50.418-161.653 0-156.848 127.195-284.444 283.556-284.444zM512.889 56.889c-219.445 0-397.333 178.292-397.333 398.222 0 84.124 26.167 162.028 70.612 226.32l-72.389 285.68 382.416-114.626c5.584 0.236 11.056 0.848 16.695 0.848 219.445 0 397.333-178.292 397.333-398.222s-177.888-398.222-397.333-398.222v0z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-sound" viewBox="0 0 1024 1024">
|
||||
<title>sound</title>
|
||||
<path class="path1" d="M581.056 113.778c-6.332 0-12.779 1.819-19.001 5.764l-230.277 159.847c-4.722 3.292-10.332 5.056-16.11 5.056h-202.112c-31.305 0-56.667 25.472-56.667 56.889v341.333c0 31.417 25.362 56.889 56.667 56.889h202.112c5.778 0 11.388 1.764 16.11 5.056l230.277 159.847c6.222 3.945 12.695 5.764 19.001 5.764 22.277 0 42.5-22.736 42.5-54v-688.43c0-31.278-20.222-54.014-42.5-54.014zM510.222 730.139l-135.78-94.265c-9.472-6.569-20.722-10.1-32.222-10.1h-143.666c-15.666 0-28.334-12.736-28.334-28.444v-170.667c0-15.708 12.667-28.444 28.334-28.444h143.668c11.5 0 22.75-3.527 32.222-10.098l135.778-94.26v436.277z"></path>
|
||||
<path class="path2" d="M963.333 500.583c-4.889-99.417-86.112-170.139-142.612-207.57-26.75-17.737-62.222-6.93-75.364 23.195l-2.137 4.889c-10.667 24.5-2.583 53.403 19.111 67.945 40.167 26.903 90.222 70.958 92.389 117.486 1.833 38.473-31.445 83.5-94.612 129.111-22.667 16.375-30.112 47.708-16.222 72.555l2.389 4.292c15.111 27.001 49.278 35.486 73.945 17.762 98.999-71.15 147.111-148.233 143.111-229.664z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-monitor" viewBox="0 0 1024 1024">
|
||||
<title>monitor</title>
|
||||
<path class="path1" d="M910.222 56.889h-796.444c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h312.889c-47.14 0-85.333 38.194-85.333 85.333v28.444h341.333v-28.444c0-47.14-38.194-85.333-85.333-85.333h312.889c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM853.333 711.111c0 15.723-12.722 28.444-28.444 28.444h-625.778c-15.723 0-28.444-12.722-28.444-28.444v-512c0-15.723 12.722-28.444 28.444-28.444h625.778c15.723 0 28.444 12.722 28.444 28.444v512z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-up" viewBox="0 0 1024 1024">
|
||||
<title>up</title>
|
||||
<path class="path1" d="M967.111 512c0-251.362-203.749-455.111-455.111-455.111s-455.111 203.749-455.111 455.111c0 251.362 203.749 455.111 455.111 455.111s455.111-203.749 455.111-455.111zM170.667 512c0-188.222 153.111-341.333 341.333-341.333s341.333 153.111 341.333 341.333-153.111 341.333-341.333 341.333-341.333-153.111-341.333-341.333z"></path>
|
||||
<path class="path2" d="M568.784 683.221v-206.667l73.584 74.917c22.277 22.055 58.332 22.055 80.612 0 22.251-22.055 22.251-57.778 0-79.833l-168.779-170.667c-10.695-10.583-25.166-16.528-40.306-16.528-0.651 0-1.3 0.025-1.95 0.048-0.649-0.023-1.296-0.048-1.948-0.048-15.141 0-29.611 5.945-40.306 16.528l-168.779 170.667c-22.251 22.055-22.251 57.778 0 79.833 22.277 22.055 58.332 22.055 80.612 0l73.588-74.917v206.667c0 31.111 25.223 56.334 56.334 56.334h1.006c31.111 0 56.332-25.223 56.332-56.334z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-play" viewBox="0 0 1024 1024">
|
||||
<title>play</title>
|
||||
<path class="path1" d="M284.444 279.556l393.388 232.444-393.388 232.444v-464.889zM227.556 113.778c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.166-8.972 24.5-25.278 24.5-42.917s-9.333-33.945-24.5-42.917l-601.278-355.305z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-fast-forward" viewBox="0 0 1024 1024">
|
||||
<title>fast-forward</title>
|
||||
<path class="path1" d="M999.5 469.083l-601.278-355.305c-31.417 0-56.889 25.472-56.889 56.889v111.184l-284.444-168.073c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l284.444-168.084v111.195c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.195-8.972 24.5-25.278 24.5-42.917s-9.305-33.945-24.5-42.917zM341.333 609.972l-227.556 134.473v-464.889l227.556 134.473v195.943zM455.111 744.444v-464.889l393.388 232.444-393.388 232.444z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-refresh" viewBox="0 0 1024 1024">
|
||||
<title>refresh</title>
|
||||
<path class="path1" d="M455.874 796.763h-46.741c-134.912-22.064-238.203-139.554-238.203-280.692 0-47.296 12.142-91.534 32.651-130.773l34.875 48.352c25.397 35.179 80.169 25.371 91.813-16.452l66.11-237.758c9.198-33.013-15.646-65.719-49.909-65.664l-237.451 0.363c-42.183 0.055-66.555 47.852-41.877 82.087l64.19 88.951c-46.489 65.136-74.084 144.722-74.084 230.894 0 199.076 146 364.055 336.684 393.513 5.196 0.805 10.256 0.583 15.2-0.055v0.693h46.741c31.012 0 56.133-25.122 56.133-56.162v-1.14c0-31.012-25.122-56.158-56.133-56.158z"></path>
|
||||
<path class="path2" d="M956.871 827.803l-64.219-88.951c46.517-65.138 74.084-144.722 74.084-230.894 0-199.076-145.972-364.057-336.656-393.54-5.198-0.805-10.256-0.583-15.202 0.084v-0.724h-46.768c-30.985 0-56.105 25.148-56.105 56.16v1.14c0 31.040 25.12 56.188 56.105 56.188h46.768c134.914 22.064 238.174 139.554 238.174 280.692 0 47.296-12.142 91.534-32.622 130.773l-34.903-48.352c-25.371-35.18-80.171-25.371-91.785 16.423l-66.137 237.756c-9.17 33.042 15.671 65.721 49.936 65.666l237.451-0.334c42.185-0.057 66.555-47.881 41.879-82.087z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-film" viewBox="0 0 1024 1024">
|
||||
<title>film</title>
|
||||
<path class="path1" d="M967.111 113.778h-910.222c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h910.222c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM113.778 227.556h113.778v113.778h-113.778v-113.778zM113.778 455.111h113.778v113.778h-113.778v-113.778zM113.778 796.444v-113.778h113.778v113.778h-113.778zM341.333 796.444v-568.889h341.333v568.889h-341.333zM910.222 796.444h-113.778v-113.778h113.778v113.778zM910.222 568.889h-113.778v-113.778h113.778v113.778zM910.222 341.333h-113.778v-113.778h113.778v113.778z"></path>
|
||||
</symbol>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
<header class="bgc1 clearfix">
|
||||
<p class="mhl">SVG Icons - Generated by <a href="https://icomoon.io/app">IcoMoon</a></p>
|
||||
</header>
|
||||
<div class="clearfix mhl ptl">
|
||||
<h1 class="mvm mtn fgc1">Grid Size: 18</h1>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-bubble"><use xlink:href="#icon-bubble"></use></svg><span class="mls"> icon-bubble</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-sound"><use xlink:href="#icon-sound"></use></svg><span class="mls"> icon-sound</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-monitor"><use xlink:href="#icon-monitor"></use></svg><span class="mls"> icon-monitor</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-up"><use xlink:href="#icon-up"></use></svg><span class="mls"> icon-up</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-play"><use xlink:href="#icon-play"></use></svg><span class="mls"> icon-play</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-fast-forward"><use xlink:href="#icon-fast-forward"></use></svg><span class="mls"> icon-fast-forward</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-refresh"><use xlink:href="#icon-refresh"></use></svg><span class="mls"> icon-refresh</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="glyph fs1">
|
||||
<div class="clearfix pbs">
|
||||
<svg class="icon icon-film"><use xlink:href="#icon-film"></use></svg><span class="mls"> icon-film</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,6 +0,0 @@
|
||||
.icon {
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
fill: currentColor;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
<svg display="none" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<symbol id="icon-bubble" viewBox="0 0 1024 1024">
|
||||
<title>bubble</title>
|
||||
<path class="path1" d="M512.889 170.667c156.334 0 283.556 127.596 283.556 284.444s-127.221 284.444-282.722 284.459l-3.388-0.208c-3.14-0.222-6.251-0.412-9.388-0.555l-19.111-0.791-208.473 62.485 35.778-141.227-29.388-42.51c-32.974-47.751-50.418-103.653-50.418-161.653 0-156.848 127.195-284.444 283.556-284.444zM512.889 56.889c-219.445 0-397.333 178.292-397.333 398.222 0 84.124 26.167 162.028 70.612 226.32l-72.389 285.68 382.416-114.626c5.584 0.236 11.056 0.848 16.695 0.848 219.445 0 397.333-178.292 397.333-398.222s-177.888-398.222-397.333-398.222v0z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-sound" viewBox="0 0 1024 1024">
|
||||
<title>sound</title>
|
||||
<path class="path1" d="M581.056 113.778c-6.332 0-12.779 1.819-19.001 5.764l-230.277 159.847c-4.722 3.292-10.332 5.056-16.11 5.056h-202.112c-31.305 0-56.667 25.472-56.667 56.889v341.333c0 31.417 25.362 56.889 56.667 56.889h202.112c5.778 0 11.388 1.764 16.11 5.056l230.277 159.847c6.222 3.945 12.695 5.764 19.001 5.764 22.277 0 42.5-22.736 42.5-54v-688.43c0-31.278-20.222-54.014-42.5-54.014zM510.222 730.139l-135.78-94.265c-9.472-6.569-20.722-10.1-32.222-10.1h-143.666c-15.666 0-28.334-12.736-28.334-28.444v-170.667c0-15.708 12.667-28.444 28.334-28.444h143.668c11.5 0 22.75-3.527 32.222-10.098l135.778-94.26v436.277z"></path>
|
||||
<path class="path2" d="M963.333 500.583c-4.889-99.417-86.112-170.139-142.612-207.57-26.75-17.737-62.222-6.93-75.364 23.195l-2.137 4.889c-10.667 24.5-2.583 53.403 19.111 67.945 40.167 26.903 90.222 70.958 92.389 117.486 1.833 38.473-31.445 83.5-94.612 129.111-22.667 16.375-30.112 47.708-16.222 72.555l2.389 4.292c15.111 27.001 49.278 35.486 73.945 17.762 98.999-71.15 147.111-148.233 143.111-229.664z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-monitor" viewBox="0 0 1024 1024">
|
||||
<title>monitor</title>
|
||||
<path class="path1" d="M910.222 56.889h-796.444c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h312.889c-47.14 0-85.333 38.194-85.333 85.333v28.444h341.333v-28.444c0-47.14-38.194-85.333-85.333-85.333h312.889c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM853.333 711.111c0 15.723-12.722 28.444-28.444 28.444h-625.778c-15.723 0-28.444-12.722-28.444-28.444v-512c0-15.723 12.722-28.444 28.444-28.444h625.778c15.723 0 28.444 12.722 28.444 28.444v512z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-up" viewBox="0 0 1024 1024">
|
||||
<title>up</title>
|
||||
<path class="path1" d="M967.111 512c0-251.362-203.749-455.111-455.111-455.111s-455.111 203.749-455.111 455.111c0 251.362 203.749 455.111 455.111 455.111s455.111-203.749 455.111-455.111zM170.667 512c0-188.222 153.111-341.333 341.333-341.333s341.333 153.111 341.333 341.333-153.111 341.333-341.333 341.333-341.333-153.111-341.333-341.333z"></path>
|
||||
<path class="path2" d="M568.784 683.221v-206.667l73.584 74.917c22.277 22.055 58.332 22.055 80.612 0 22.251-22.055 22.251-57.778 0-79.833l-168.779-170.667c-10.695-10.583-25.166-16.528-40.306-16.528-0.651 0-1.3 0.025-1.95 0.048-0.649-0.023-1.296-0.048-1.948-0.048-15.141 0-29.611 5.945-40.306 16.528l-168.779 170.667c-22.251 22.055-22.251 57.778 0 79.833 22.277 22.055 58.332 22.055 80.612 0l73.588-74.917v206.667c0 31.111 25.223 56.334 56.334 56.334h1.006c31.111 0 56.332-25.223 56.332-56.334z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-play" viewBox="0 0 1024 1024">
|
||||
<title>play</title>
|
||||
<path class="path1" d="M284.444 279.556l393.388 232.444-393.388 232.444v-464.889zM227.556 113.778c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.166-8.972 24.5-25.278 24.5-42.917s-9.333-33.945-24.5-42.917l-601.278-355.305z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-fast-forward" viewBox="0 0 1024 1024">
|
||||
<title>fast-forward</title>
|
||||
<path class="path1" d="M999.5 469.083l-601.278-355.305c-31.417 0-56.889 25.472-56.889 56.889v111.184l-284.444-168.073c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l284.444-168.084v111.195c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.195-8.972 24.5-25.278 24.5-42.917s-9.305-33.945-24.5-42.917zM341.333 609.972l-227.556 134.473v-464.889l227.556 134.473v195.943zM455.111 744.444v-464.889l393.388 232.444-393.388 232.444z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-refresh" viewBox="0 0 1024 1024">
|
||||
<title>refresh</title>
|
||||
<path class="path1" d="M455.874 796.763h-46.741c-134.912-22.064-238.203-139.554-238.203-280.692 0-47.296 12.142-91.534 32.651-130.773l34.875 48.352c25.397 35.179 80.169 25.371 91.813-16.452l66.11-237.758c9.198-33.013-15.646-65.719-49.909-65.664l-237.451 0.363c-42.183 0.055-66.555 47.852-41.877 82.087l64.19 88.951c-46.489 65.136-74.084 144.722-74.084 230.894 0 199.076 146 364.055 336.684 393.513 5.196 0.805 10.256 0.583 15.2-0.055v0.693h46.741c31.012 0 56.133-25.122 56.133-56.162v-1.14c0-31.012-25.122-56.158-56.133-56.158z"></path>
|
||||
<path class="path2" d="M956.871 827.803l-64.219-88.951c46.517-65.138 74.084-144.722 74.084-230.894 0-199.076-145.972-364.057-336.656-393.54-5.198-0.805-10.256-0.583-15.202 0.084v-0.724h-46.768c-30.985 0-56.105 25.148-56.105 56.16v1.14c0 31.040 25.12 56.188 56.105 56.188h46.768c134.914 22.064 238.174 139.554 238.174 280.692 0 47.296-12.142 91.534-32.622 130.773l-34.903-48.352c-25.371-35.18-80.171-25.371-91.785 16.423l-66.137 237.756c-9.17 33.042 15.671 65.721 49.936 65.666l237.451-0.334c42.185-0.057 66.555-47.881 41.879-82.087z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-film" viewBox="0 0 1024 1024">
|
||||
<title>film</title>
|
||||
<path class="path1" d="M967.111 113.778h-910.222c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h910.222c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM113.778 227.556h113.778v113.778h-113.778v-113.778zM113.778 455.111h113.778v113.778h-113.778v-113.778zM113.778 796.444v-113.778h113.778v113.778h-113.778zM341.333 796.444v-568.889h341.333v568.889h-341.333zM910.222 796.444h-113.778v-113.778h113.778v113.778zM910.222 568.889h-113.778v-113.778h113.778v113.778zM910.222 341.333h-113.778v-113.778h113.778v113.778z"></path>
|
||||
</symbol>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 6.1 KiB |
1
dist/css/docs.css
vendored
@ -1 +0,0 @@
|
||||
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@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}*,::after,::before{box-sizing:border-box}html{font-size:62.5%}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;background:#fff;font-size:16px;font-size:1.6rem;line-height:1.5;text-align:center;color:#6D797F}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}h1{font-size:64px;font-size:6.4rem;color:#3498DB}p,small{margin:0 0 20px}small{display:block;font-size:14px;font-size:1.4rem}header{padding:60px 0;margin-bottom:20px}header p{font-size:18px;font-size:1.8rem}a{text-decoration:none;color:#3498db;border-bottom:1px solid currentColor;transition:all .3s ease}a:focus,a:hover{color:#000}a:focus{outline:#343f4a dotted thin;outline-offset:1px}.btn{display:inline-block;padding:10px 25px;background:#3498db;border:0;color:#fff;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:600;border-radius:3px}.btn:focus,.btn:hover{color:#fff;background:#258cd1}section{padding-bottom:80px}.example-audio .player{max-width:480px}.example-video .player{max-width:1200px}.example-audio .player,.example-video .player{margin:0 auto 20px}.example-audio .player-fullscreen,.example-audio .player:-webkit-full-screen,.example-video .player-fullscreen,.example-video .player:-webkit-full-screen{max-width:none}.example-audio .player-fullscreen,.example-audio .player:-moz-full-screen,.example-video .player-fullscreen,.example-video .player:-moz-full-screen{max-width:none}.example-audio .player-fullscreen,.example-audio .player:-ms-fullscreen,.example-video .player-fullscreen,.example-video .player:-ms-fullscreen{max-width:none}.example-audio .player-fullscreen,.example-audio .player:fullscreen,.example-video .player-fullscreen,.example-video .player:fullscreen{max-width:none}
|
1
dist/css/plyr.css
vendored
1
dist/js/docs.js
vendored
1
dist/js/plyr.js
vendored
2
dist/js/templates.js
vendored
@ -1,2 +0,0 @@
|
||||
var templates = {};
|
||||
templates['controls'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"player-controls\">");t.b("\n" + i);t.b(" <progress class=\"player-progress\" max=\"100\" value=\"0\">");t.b("\n" + i);t.b(" <span>0</span>% played");t.b("\n" + i);t.b(" </progress>");t.b("\n" + i);t.b(" <span class=\"player-controls-playback\">");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"restart\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-refresh\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Restart</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"rewind\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-rewind\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Rewind <span class=\"player-seek-time\">10</span> seconds</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" aria-label=\"{aria-label}\" data-player=\"play\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-play\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Play</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"pause\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-pause\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Pause</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"fast-forward\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-fast-forward\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Fast forward <span class=\"player-seek-time\">10</span> seconds</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <span class=\"player-time\">");t.b("\n" + i);t.b(" <span class=\"sr-only\">Time</span>");t.b("\n" + i);t.b(" <span class=\"player-duration\">00:00</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" <span class=\"player-controls-sound\">");t.b("\n" + i);t.b(" <input class=\"inverted sr-only\" id=\"mute{id}\" type=\"checkbox\" data-player=\"mute\">");t.b("\n" + i);t.b(" <label id=\"mute{id}\" for=\"mute{id}\">");t.b("\n" + i);t.b(" <svg class=\"icon-muted\"><use xlink:href=\"#icon-muted\"></use></svg>");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-sound\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Mute</span>");t.b("\n" + i);t.b(" </label>");t.b("\n");t.b("\n" + i);t.b(" <label for=\"volume{id}\" class=\"sr-only\">Volume:</label>");t.b("\n" + i);t.b(" <input id=\"volume{id}\" class=\"player-volume\" type=\"range\" min=\"0\" max=\"10\" value=\"5\" data-player=\"volume\">");t.b("\n");t.b("\n" + i);t.b(" <input class=\"sr-only\" id=\"captions{id}\" type=\"checkbox\" data-player=\"captions\">");t.b("\n" + i);t.b(" <label for=\"captions{id}\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-bubble\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Captions</span>");t.b("\n" + i);t.b(" </label>");t.b("\n");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"fullscreen\">");t.b("\n" + i);t.b(" <svg class=\"icon-exit-fullscreen\"><use xlink:href=\"#icon-collapse\"></use></svg>");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-expand\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Toggle fullscreen</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
1
dist/plyr.css
vendored
Normal file
2
dist/plyr.js
vendored
Normal file
1
dist/plyr.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="plyr-captions-off" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd" fill-opacity=".5"/></symbol><symbol id="plyr-captions-on" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd"/></symbol><symbol id="plyr-enter-fullscreen" viewBox="0 0 18 18"><path d="M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"/></symbol><symbol id="plyr-exit-fullscreen" viewBox="0 0 18 18"><path d="M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"/></symbol><symbol id="plyr-fast-forward" viewBox="0 0 18 18"><path d="M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"/></symbol><symbol id="plyr-muted" viewBox="0 0 18 18"><path d="M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol><symbol id="plyr-pause" viewBox="0 0 18 18"><path d="M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM12 1c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"/></symbol><symbol id="plyr-play" viewBox="0 0 18 18"><path d="M15.562 8.1L3.87.225C3.052-.337 2 .225 2 1.125v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"/></symbol><symbol id="plyr-restart" viewBox="0 0 18 18"><path d="M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"/></symbol><symbol id="plyr-rewind" viewBox="0 0 18 18"><path d="M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"/></symbol><symbol id="plyr-volume" viewBox="0 0 18 18"><path d="M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"/><path d="M11.282 5.282a.909.909 0 0 0 0 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 0 0 0 1.316c.145.145.636.262 1.018.156a.725.725 0 0 0 .298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 0 0-1.316 0zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol></svg>
|
After Width: | Height: | Size: 3.7 KiB |
1
dist/svg/sprite.svg
vendored
Before Width: | Height: | Size: 5.5 KiB |
426
gulpfile.js
@ -1,139 +1,337 @@
|
||||
// ==========================================================================
|
||||
// Gulp build script
|
||||
// ==========================================================================
|
||||
/*global require, __dirname*/
|
||||
/*global require, __dirname,Buffer*/
|
||||
/*jshint -W079 */
|
||||
|
||||
var fs = require("fs"),
|
||||
path = require("path"),
|
||||
gulp = require("gulp"),
|
||||
gutil = require("gulp-util"),
|
||||
concat = require("gulp-concat"),
|
||||
uglify = require("gulp-uglify"),
|
||||
less = require("gulp-less"),
|
||||
minifyCss = require("gulp-minify-css"),
|
||||
runSequence = require("run-sequence"),
|
||||
prefix = require("gulp-autoprefixer"),
|
||||
svgstore = require("gulp-svgstore"),
|
||||
svgmin = require("gulp-svgmin"),
|
||||
hogan = require("gulp-hogan-compile");
|
||||
var fs = require("fs"),
|
||||
path = require("path"),
|
||||
gulp = require("gulp"),
|
||||
gutil = require("gulp-util"),
|
||||
concat = require("gulp-concat"),
|
||||
uglify = require("gulp-uglify"),
|
||||
less = require("gulp-less"),
|
||||
sass = require("gulp-sass"),
|
||||
cleanCSS = require("gulp-clean-css"),
|
||||
run = require("run-sequence"),
|
||||
prefix = require("gulp-autoprefixer"),
|
||||
svgstore = require("gulp-svgstore"),
|
||||
svgmin = require("gulp-svgmin"),
|
||||
rename = require("gulp-rename"),
|
||||
s3 = require("gulp-s3"),
|
||||
replace = require("gulp-replace"),
|
||||
open = require("gulp-open"),
|
||||
size = require("gulp-size"),
|
||||
through = require("through2");
|
||||
|
||||
var projectPath = __dirname;
|
||||
var paths = {
|
||||
project: projectPath,
|
||||
|
||||
// Watch paths
|
||||
watchless: path.join(projectPath, "assets/less/**/*"),
|
||||
watchjs: path.join(projectPath, "assets/js/**/*"),
|
||||
watchicons: path.join(projectPath, "assets/icons/**/*"),
|
||||
watchtemplates: path.join(projectPath, "assets/templates/**/*"),
|
||||
|
||||
// SVG Icons
|
||||
svg: path.join(projectPath, "assets/icons/*.svg"),
|
||||
|
||||
// Output paths
|
||||
js: path.join(projectPath, "dist/js/"),
|
||||
css: path.join(projectPath, "dist/css/"),
|
||||
icons: path.join(projectPath, "dist/svg/")
|
||||
var root = __dirname,
|
||||
paths = {
|
||||
plyr: {
|
||||
// Source paths
|
||||
src: {
|
||||
less: path.join(root, "src/less/**/*"),
|
||||
scss: path.join(root, "src/scss/**/*"),
|
||||
js: path.join(root, "src/js/**/*"),
|
||||
sprite: path.join(root, "src/sprite/*.svg")
|
||||
},
|
||||
// Output paths
|
||||
output: path.join(root, "dist/")
|
||||
},
|
||||
demo: {
|
||||
// Source paths
|
||||
src: {
|
||||
less: path.join(root, "demo/src/less/**/*"),
|
||||
js: path.join(root, "demo/src/js/**/*"),
|
||||
sprite: path.join(root, "demo/src/sprite/**/*")
|
||||
},
|
||||
// Output paths
|
||||
output: path.join(root, "demo/dist/"),
|
||||
// Demo
|
||||
root: path.join(root, "demo/")
|
||||
},
|
||||
upload: [path.join(root, "dist/**"), path.join(root, "demo/dist/**")]
|
||||
},
|
||||
|
||||
// Task names
|
||||
taskNames = {
|
||||
jsAll: "js-all",
|
||||
lessBuild: "less-",
|
||||
jsBuild: "js-",
|
||||
iconBuild: "icon-build",
|
||||
templates: "templates"
|
||||
},
|
||||
// Task arrays
|
||||
lessBuildTasks = [],
|
||||
jsBuildTasks = [],
|
||||
tasks = {
|
||||
less: [],
|
||||
scss: [],
|
||||
js: [],
|
||||
sprite: []
|
||||
},
|
||||
|
||||
// Fetch bundles from JSON
|
||||
bundles = loadJSON(path.join(paths.project, "bundles.json"));
|
||||
bundles = loadJSON(path.join(root, "bundles.json")),
|
||||
package = loadJSON(path.join(root, "package.json"));
|
||||
|
||||
// Load json
|
||||
function loadJSON(path) {
|
||||
return JSON.parse(fs.readFileSync(path));
|
||||
try {
|
||||
return JSON.parse(fs.readFileSync(path));
|
||||
}
|
||||
catch(err) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// Build templates
|
||||
gulp.task(taskNames.templates, function () {
|
||||
return gulp
|
||||
.src(paths.watchtemplates)
|
||||
.pipe(hogan("templates.js", {
|
||||
wrapper: false,
|
||||
templateName: function (file) {
|
||||
return path.basename(file.relative.replace(/\\/g, "-"), path.extname(file.relative));
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest(paths.js));
|
||||
});
|
||||
|
||||
// Process JS
|
||||
for (var key in bundles.js) {
|
||||
(function(key) {
|
||||
var taskName = taskNames.jsBuild + key;
|
||||
jsBuildTasks.push(taskName);
|
||||
|
||||
gulp.task(taskName, function () {
|
||||
return gulp
|
||||
.src(bundles.js[key])
|
||||
.pipe(concat(key))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest(paths.js));
|
||||
});
|
||||
})(key);
|
||||
// Create a file from a string
|
||||
// http://stackoverflow.com/questions/23230569/how-do-you-create-a-file-from-a-string-in-gulp
|
||||
function createFile(filename, string) {
|
||||
var src = require('stream').Readable({
|
||||
objectMode: true
|
||||
});
|
||||
src._read = function () {
|
||||
this.push(new gutil.File({
|
||||
cwd: "",
|
||||
base: "",
|
||||
path: filename,
|
||||
contents: new Buffer(string),
|
||||
// stats also required for some functions
|
||||
// https://nodejs.org/api/fs.html#fs_class_fs_stats
|
||||
stat: {
|
||||
size: string.length
|
||||
}
|
||||
}));
|
||||
this.push(null);
|
||||
}
|
||||
return src
|
||||
}
|
||||
|
||||
// Process CSS
|
||||
for (var key in bundles.less) {
|
||||
(function (key) {
|
||||
var taskName = taskNames.lessBuild + key;
|
||||
lessBuildTasks.push(taskName);
|
||||
var build = {
|
||||
js: function (files, bundle) {
|
||||
for (var key in files) {
|
||||
(function(key) {
|
||||
var name = "js-" + key;
|
||||
tasks.js.push(name);
|
||||
|
||||
gulp.task(taskName, function () {
|
||||
return gulp
|
||||
.src(bundles.less[key])
|
||||
.pipe(less())
|
||||
.on("error", gutil.log)
|
||||
.pipe(concat(key))
|
||||
.pipe(prefix(["last 2 versions", "> 1%", "ie 9"], { cascade: true }))
|
||||
.pipe(minifyCss())
|
||||
.pipe(gulp.dest(paths.css));
|
||||
});
|
||||
})(key);
|
||||
}
|
||||
gulp.task(name, function () {
|
||||
return gulp
|
||||
.src(bundles[bundle].js[key])
|
||||
.pipe(concat(key))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest(paths[bundle].output));
|
||||
});
|
||||
})(key);
|
||||
}
|
||||
},
|
||||
less: function(files, bundle) {
|
||||
for (var key in files) {
|
||||
(function (key) {
|
||||
var name = "less-" + key;
|
||||
tasks.less.push(name);
|
||||
|
||||
// Process Icons
|
||||
gulp.task(taskNames.iconBuild, function () {
|
||||
return gulp
|
||||
.src(paths.svg)
|
||||
.pipe(svgmin({
|
||||
plugins: [{
|
||||
removeDesc: true
|
||||
}]
|
||||
}))
|
||||
.pipe(svgstore({
|
||||
prefix: "icon-",
|
||||
fileName: "sprite.svg"
|
||||
}))
|
||||
.pipe(gulp.dest(paths.icons));
|
||||
gulp.task(name, function () {
|
||||
return gulp
|
||||
.src(bundles[bundle].less[key])
|
||||
.pipe(less())
|
||||
.on("error", gutil.log)
|
||||
.pipe(concat(key))
|
||||
.pipe(prefix(["last 2 versions"], { cascade: true }))
|
||||
.pipe(cleanCSS())
|
||||
.pipe(gulp.dest(paths[bundle].output));
|
||||
});
|
||||
})(key);
|
||||
}
|
||||
},
|
||||
scss: function(files, bundle) {
|
||||
for (var key in files) {
|
||||
(function (key) {
|
||||
var name = "scss-" + key;
|
||||
tasks.scss.push(name);
|
||||
|
||||
gulp.task(name, function () {
|
||||
return gulp
|
||||
.src(bundles[bundle].scss[key])
|
||||
.pipe(sass())
|
||||
.on("error", gutil.log)
|
||||
.pipe(concat(key))
|
||||
.pipe(prefix(["last 2 versions"], { cascade: true }))
|
||||
.pipe(cleanCSS())
|
||||
.pipe(gulp.dest(paths[bundle].output));
|
||||
});
|
||||
})(key);
|
||||
}
|
||||
},
|
||||
sprite: function(bundle) {
|
||||
var name = "sprite-" + bundle;
|
||||
tasks.sprite.push(name);
|
||||
|
||||
// Process Icons
|
||||
gulp.task(name, function () {
|
||||
return gulp
|
||||
.src(paths[bundle].src.sprite)
|
||||
.pipe(svgmin({
|
||||
plugins: [{
|
||||
removeDesc: true
|
||||
}]
|
||||
}))
|
||||
.pipe(svgstore())
|
||||
.pipe(rename({ basename: bundle }))
|
||||
.pipe(gulp.dest(paths[bundle].output));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Plyr core files
|
||||
build.js(bundles.plyr.js, "plyr");
|
||||
build.less(bundles.plyr.less, "plyr");
|
||||
build.scss(bundles.plyr.scss, "plyr");
|
||||
build.sprite("plyr");
|
||||
|
||||
// Demo files
|
||||
build.less(bundles.demo.less, "demo");
|
||||
build.js(bundles.demo.js, "demo");
|
||||
build.sprite("demo");
|
||||
|
||||
// Build all JS
|
||||
gulp.task("js", function(){
|
||||
run(tasks.js);
|
||||
});
|
||||
|
||||
// Default gulp task
|
||||
gulp.task("default", function(){
|
||||
runSequence(taskNames.jsAll, lessBuildTasks.concat(taskNames.iconBuild, "watch"));
|
||||
});
|
||||
|
||||
// Build all JS (inc. templates)
|
||||
gulp.task(taskNames.jsAll, function(){
|
||||
runSequence(taskNames.templates, jsBuildTasks);
|
||||
// Build SCSS (for testing, default is LESS)
|
||||
gulp.task("scss", function(){
|
||||
run(tasks.scss);
|
||||
});
|
||||
|
||||
// Watch for file changes
|
||||
gulp.task("watch", function () {
|
||||
//gulp.watch(paths.watchtemplates, [taskNames.jsAll]);
|
||||
//gulp.watch(paths.watchjs, [taskNames.jsAll]);
|
||||
gulp.watch(paths.watchless, lessBuildTasks);
|
||||
gulp.watch(paths.watchicons, [taskNames.iconBuild]);
|
||||
});
|
||||
// Plyr core
|
||||
gulp.watch(paths.plyr.src.js, tasks.js);
|
||||
gulp.watch(paths.plyr.src.less, tasks.less);
|
||||
gulp.watch(paths.plyr.src.sprite, tasks.sprite);
|
||||
|
||||
// Demo
|
||||
gulp.watch(paths.demo.src.js, tasks.js);
|
||||
gulp.watch(paths.demo.src.less, tasks.less);
|
||||
gulp.watch(paths.demo.src.sprite, tasks.sprite);
|
||||
});
|
||||
|
||||
// Default gulp task
|
||||
gulp.task("default", function(){
|
||||
run(tasks.js, tasks.less, tasks.sprite, "watch");
|
||||
});
|
||||
|
||||
// Publish a version to CDN and demo
|
||||
// --------------------------------------------
|
||||
|
||||
// Some options
|
||||
var aws = loadJSON(path.join(root, "aws.json")),
|
||||
version = package.version,
|
||||
maxAge = 31536000, // seconds 1 year
|
||||
options = {
|
||||
cdn: {
|
||||
headers: {
|
||||
"Cache-Control": "max-age=" + maxAge,
|
||||
"Vary": "Accept-Encoding"
|
||||
}
|
||||
},
|
||||
demo: {
|
||||
headers: {
|
||||
"Cache-Control": "no-cache, no-store, must-revalidate, max-age=0",
|
||||
"Vary": "Accept-Encoding"
|
||||
}
|
||||
},
|
||||
symlinks: function(version, filename) {
|
||||
return {
|
||||
headers: {
|
||||
// http://stackoverflow.com/questions/2272835/amazon-s3-object-redirect
|
||||
"x-amz-website-redirect-location": "/" + version + "/" + filename,
|
||||
"Cache-Control": "no-cache, no-store, must-revalidate, max-age=0"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// If aws is setup
|
||||
if("cdn" in aws) {
|
||||
var regex = "(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?",
|
||||
cdnpath = new RegExp(aws.cdn.bucket + "\/" + regex, "gi"),
|
||||
semver = new RegExp("v" + regex, "gi"),
|
||||
localPath = new RegExp("(\.\.\/)?dist", "gi"),
|
||||
versionPath = "https://" + aws.cdn.bucket + "/" + version;
|
||||
}
|
||||
|
||||
// Publish version to CDN bucket
|
||||
gulp.task("cdn", function () {
|
||||
console.log("Uploading " + version + " to " + aws.cdn.bucket + "...");
|
||||
|
||||
// Upload to CDN
|
||||
return gulp.src(paths.upload)
|
||||
.pipe(size({
|
||||
showFiles: true,
|
||||
gzip: true
|
||||
}))
|
||||
.pipe(rename(function (path) {
|
||||
path.dirname = path.dirname.replace(".", version);
|
||||
}))
|
||||
.pipe(replace(localPath, versionPath))
|
||||
.pipe(s3(aws.cdn, options.cdn));
|
||||
});
|
||||
|
||||
// Publish to demo bucket
|
||||
gulp.task("demo", function () {
|
||||
console.log("Uploading " + version + " demo to " + aws.demo.bucket + "...");
|
||||
|
||||
// Replace versioned files in readme.md
|
||||
gulp.src([root + "/readme.md"])
|
||||
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
||||
.pipe(gulp.dest(root));
|
||||
|
||||
// Replace versioned files in plyr.js
|
||||
gulp.src(path.join(root, "src/js/plyr.js"))
|
||||
.pipe(replace(semver, "v" + version))
|
||||
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
||||
.pipe(gulp.dest(path.join(root, "src/js/")));
|
||||
|
||||
// Replace local file paths with remote paths in demo HTML
|
||||
// e.g. "../dist/plyr.js" to "https://cdn.plyr.io/x.x.x/plyr.js"
|
||||
gulp.src([paths.demo.root + "*.html"])
|
||||
.pipe(replace(localPath, versionPath))
|
||||
.pipe(s3(aws.demo, options.demo));
|
||||
|
||||
// Upload error.html to cdn (as well as demo site)
|
||||
return gulp.src([paths.demo.root + "error.html"])
|
||||
.pipe(replace(localPath, versionPath))
|
||||
.pipe(s3(aws.cdn, options.demo));
|
||||
});
|
||||
|
||||
// Open the demo site to check it's sweet
|
||||
gulp.task("symlinks", function () {
|
||||
console.log("Updating symlinks...");
|
||||
|
||||
return gulp.src(paths.upload)
|
||||
.pipe(through.obj(function (chunk, enc, callback) {
|
||||
if (chunk.stat.isFile()) {
|
||||
// Get the filename
|
||||
var filename = chunk.path.split("/").reverse()[0];
|
||||
|
||||
// Create the 0 byte redirect files to upload
|
||||
createFile(filename, "")
|
||||
.pipe(rename(function (path) {
|
||||
path.dirname = path.dirname.replace(".", "latest");
|
||||
}))
|
||||
// Upload to S3 with correct headers
|
||||
.pipe(s3(aws.cdn, options.symlinks(version, filename)));
|
||||
}
|
||||
|
||||
callback(null, chunk);
|
||||
}));
|
||||
});
|
||||
|
||||
// Open the demo site to check it's sweet
|
||||
gulp.task("open", function () {
|
||||
console.log("Opening " + aws.demo.bucket + "...");
|
||||
|
||||
// A file must be specified or gulp will skip the task
|
||||
// Doesn't matter which file since we set the URL above
|
||||
// Weird, I know...
|
||||
return gulp.src([paths.demo.root + "index.html"])
|
||||
.pipe(open("", {
|
||||
url: "http://" + aws.demo.bucket
|
||||
}));
|
||||
});
|
||||
|
||||
// Do everything
|
||||
gulp.task("publish", function () {
|
||||
run(tasks.js, tasks.less, tasks.sprite, "cdn", "demo", "symlinks");
|
||||
});
|
||||
|
89
index.html
@ -1,89 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Plyr - A simple HTML5 media player</title>
|
||||
<meta name="description" content="A simple HTML5 media player with custom controls and WebVTT captions.">
|
||||
<meta name="author" content="Sam Potts">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="dist/css/plyr.css">
|
||||
<link rel="stylesheet" href="dist/css/docs.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Plyr</h1>
|
||||
<p>A simple HTML5 media player with custom controls and WebVTT captions.</p>
|
||||
<a href="https://github.com/selz/plyr" target="_blank" class="btn">Download on Github</a>
|
||||
</header>
|
||||
|
||||
<section class="example-video">
|
||||
<div class="player">
|
||||
<video poster="//cdn.sampotts.me/plyr/poster.jpg" controls crossorigin>
|
||||
<!-- Video files -->
|
||||
<source src="//cdn.sampotts.me/plyr/movie.mp4" type="video/mp4">
|
||||
<source src="//cdn.sampotts.me/plyr/movie.webm" type="video/webm">
|
||||
|
||||
<!-- Text track file -->
|
||||
<track kind="captions" label="English captions" src="//cdn.sampotts.me/plyr/movie_captions.vtt" srclang="en" default>
|
||||
|
||||
<!-- Fallback for browsers that don't support the <video> element -->
|
||||
<div>
|
||||
<a href="//cdn.sampotts.me/plyr/movie.mp4">
|
||||
<img src="//cdn.sampotts.me/plyr/poster.jpg" alt="Download">
|
||||
</a>
|
||||
</div>
|
||||
</video>
|
||||
</div>
|
||||
<small>Big Buck Bunny. More info can be found at <a href="https://peach.blender.org" target="_blank">peach.blender.org</a>.</small>
|
||||
</section>
|
||||
|
||||
<section class="example-audio">
|
||||
<div class="player">
|
||||
<audio controls>
|
||||
<!-- Audio files -->
|
||||
<source src="//cdn.sampotts.me/plyr/logistics-96-sample.mp3" type="audio/mp3">
|
||||
|
||||
<!-- Fallback for browsers that don't support the <audio> element -->
|
||||
<div>
|
||||
<a href="//cdn.sampotts.me/plyr/logistics-96-sample.mp3">Download</a>
|
||||
</div>
|
||||
</audio>
|
||||
</div>
|
||||
<small>"96" by Logistics, which can be purchased from <a href="https://www.hospitalrecords.com/shop/artist/logistics" target="_blank">Hospital Records</a>.</small>
|
||||
</section>
|
||||
|
||||
<!-- Load SVG defs -->
|
||||
<script>
|
||||
(function(d,p){
|
||||
var a=new XMLHttpRequest(),
|
||||
b=d.body;
|
||||
a.open("GET",p,!0);
|
||||
a.send();
|
||||
a.onload=function(){
|
||||
var c=d.createElement("div");
|
||||
c.style.display="none";
|
||||
c.innerHTML=a.responseText;
|
||||
b.insertBefore(c,b.childNodes[0])
|
||||
}
|
||||
})(document,"dist/svg/sprite.svg");
|
||||
</script>
|
||||
|
||||
<!-- Core player -->
|
||||
<script src="dist/js/plyr.js"></script>
|
||||
|
||||
<!-- Docs setup -->
|
||||
<script src="dist/js/docs.js"></script>
|
||||
|
||||
<!-- GA -->
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-40881672-11', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
40
license.md
@ -1,27 +1,21 @@
|
||||
Copyright (c) 2014, Selz.com
|
||||
All rights reserved.
|
||||
The MIT License (MIT)
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
Copyright (c) 2015 Selz.com
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
* Neither the name of the eBay nor the names of its
|
||||
subsidiaries or affiliates may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
58
package.json
@ -1,37 +1,51 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"version": "1.0.0",
|
||||
"description": "A simple HTML5 media player using custom controls",
|
||||
"version": "2.0.0",
|
||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||
"homepage": "http://plyr.io",
|
||||
"main": "gulpfile.js",
|
||||
"main": "src/js/plyr.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"gulp": "~3.8.6",
|
||||
"gulp-autoprefixer": "^0.0.8",
|
||||
"gulp-concat": "~2.3.3",
|
||||
"gulp-hogan-compile": "^0.4.1",
|
||||
"gulp-less": "~1.3.1",
|
||||
"gulp-minify-css": "~0.3.6",
|
||||
"gulp-svgmin": "^1.0.0",
|
||||
"gulp-svgstore": "^4.0.1",
|
||||
"gulp-uglify": "~0.3.1",
|
||||
"gulp-util": "~2.2.20",
|
||||
"run-sequence": "^0.3.6"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "npm install -g gulp"
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-autoprefixer": "^3.1.0",
|
||||
"gulp-clean-css": "^2.0.6",
|
||||
"gulp-concat": "^2.3.3",
|
||||
"gulp-less": "^3.0.5",
|
||||
"gulp-open": "^2.0.0",
|
||||
"gulp-rename": "^1.2.0",
|
||||
"gulp-replace": "^0.5.3",
|
||||
"gulp-s3": "^0.3.0",
|
||||
"gulp-sass": "^2.3.1",
|
||||
"gulp-size": "^2.1.0",
|
||||
"gulp-svgmin": "^1.2.2",
|
||||
"gulp-svgstore": "^5.0.5",
|
||||
"gulp-uglify": "^1.5.3",
|
||||
"gulp-util": "^3.0.7",
|
||||
"run-sequence": "^1.1.5",
|
||||
"through2": "^2.0.1"
|
||||
},
|
||||
"keywords": [
|
||||
"HTML5 Video",
|
||||
"HTML5 Audio",
|
||||
"Media Player"
|
||||
"Media Player",
|
||||
"DASH",
|
||||
"Shaka",
|
||||
"WordPress",
|
||||
"HLS"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/selz/plyr.git"
|
||||
},
|
||||
"authors": [
|
||||
"Sam Potts <me@sampotts.me>"
|
||||
],
|
||||
"license": "BSD"
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/selz/plyr/issues"
|
||||
},
|
||||
"directories": {
|
||||
"doc": "readme.md"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Sam Potts <sam@selz.com>"
|
||||
}
|
||||
|
3727
src/js/plyr.js
Normal file
29
src/less/mixins.less
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// Plyr mixins
|
||||
// https://github.com/selz/plyr
|
||||
// ==========================================================================
|
||||
|
||||
// <input type="range"> styling
|
||||
.plyr-range-track() {
|
||||
height: @plyr-range-track-height;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: (@plyr-range-track-height / 2);
|
||||
user-select: none;
|
||||
}
|
||||
.plyr-range-thumb() {
|
||||
position: relative;
|
||||
height: @plyr-range-thumb-height;
|
||||
width: @plyr-range-thumb-width;
|
||||
background: @plyr-range-thumb-bg;
|
||||
border: @plyr-range-thumb-border;
|
||||
border-radius: 100%;
|
||||
transition: background .2s ease, border .2s ease, transform .2s ease;
|
||||
box-shadow: @plyr-range-thumb-shadow;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.plyr-range-thumb-active() {
|
||||
background: @plyr-range-thumb-active-bg;
|
||||
border-color: @plyr-range-thumb-active-border-color;
|
||||
transform: scale(@plyr-range-thumb-active-scale);
|
||||
}
|
752
src/less/plyr.less
Normal file
@ -0,0 +1,752 @@
|
||||
// ==========================================================================
|
||||
// Plyr styles
|
||||
// https://github.com/selz/plyr
|
||||
// ==========================================================================
|
||||
|
||||
@import "variables";
|
||||
@import "mixins";
|
||||
|
||||
// Animation
|
||||
// ---------------------------------------
|
||||
@keyframes plyr-progress {
|
||||
to { background-position: @plyr-progress-loading-size 0; }
|
||||
}
|
||||
|
||||
// Styles
|
||||
// -------------------------------
|
||||
// Base
|
||||
.plyr {
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
min-width: 200px;
|
||||
font-family: @plyr-font-family;
|
||||
direction: ltr;
|
||||
|
||||
& when (@plyr-border-box = true) {
|
||||
// border-box everything
|
||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||
&,
|
||||
*,
|
||||
*::after,
|
||||
*::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
& when (@plyr-touch-action = true) {
|
||||
// Fix 300ms delay
|
||||
a, button, input, label {
|
||||
touch-action: manipulation;
|
||||
}
|
||||
}
|
||||
|
||||
// Focus
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
// Media elements
|
||||
video,
|
||||
audio {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
// Range inputs
|
||||
// Specificity is for bootstrap compatibility
|
||||
input[type='range'] {
|
||||
display: block;
|
||||
height: (@plyr-range-thumb-height * @plyr-range-thumb-active-scale);
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
background: transparent;
|
||||
|
||||
// WebKit
|
||||
&::-webkit-slider-runnable-track {
|
||||
.plyr-range-track();
|
||||
}
|
||||
&::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
margin-top: -((@plyr-range-thumb-height - @plyr-range-track-height) / 2);
|
||||
.plyr-range-thumb();
|
||||
}
|
||||
|
||||
// Mozilla
|
||||
&::-moz-range-track {
|
||||
.plyr-range-track();
|
||||
}
|
||||
&::-moz-range-thumb {
|
||||
.plyr-range-thumb();
|
||||
}
|
||||
|
||||
// Microsoft
|
||||
&::-ms-track {
|
||||
height: @plyr-range-track-height;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: transparent;
|
||||
}
|
||||
&::-ms-fill-upper {
|
||||
.plyr-range-track();
|
||||
}
|
||||
&::-ms-fill-lower {
|
||||
.plyr-range-track();
|
||||
background: @plyr-range-selected-bg;
|
||||
}
|
||||
&::-ms-thumb {
|
||||
.plyr-range-thumb();
|
||||
// For some reason, Edge uses the -webkit margin above
|
||||
margin-top: 0;
|
||||
}
|
||||
&::-ms-tooltip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Focus styles
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
&::-moz-focus-outer {
|
||||
border: 0;
|
||||
}
|
||||
&.tab-focus:focus {
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
// Pressed styles
|
||||
&:active {
|
||||
&::-webkit-slider-thumb {
|
||||
.plyr-range-thumb-active();
|
||||
}
|
||||
&::-moz-range-thumb {
|
||||
.plyr-range-thumb-active();
|
||||
}
|
||||
&::-ms-thumb {
|
||||
.plyr-range-thumb-active();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Video range inputs
|
||||
.plyr--video input[type='range'].tab-focus:focus {
|
||||
outline: 1px dotted fade(@plyr-video-control-color, 50%);
|
||||
}
|
||||
|
||||
// Audio range inputs
|
||||
.plyr--audio input[type='range'].tab-focus:focus {
|
||||
outline: 1px dotted fade(@plyr-audio-control-color, 50%);
|
||||
}
|
||||
|
||||
// Screen reader only elements
|
||||
.plyr__sr-only {
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
overflow: hidden;
|
||||
|
||||
// !important is not always needed
|
||||
& when (@plyr-sr-only-important = true) {
|
||||
position: absolute !important;
|
||||
padding: 0 !important;
|
||||
border: 0 !important;
|
||||
height: 1px !important;
|
||||
width: 1px !important;
|
||||
}
|
||||
& when (@plyr-sr-only-important = false) {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
// Video
|
||||
.plyr__video-wrapper {
|
||||
position: relative;
|
||||
background: #000;
|
||||
border-radius: inherit;
|
||||
|
||||
// Cleaner radius, also forces iframe radius
|
||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
||||
}
|
||||
|
||||
// Container for embeds
|
||||
.plyr__video-embed {
|
||||
padding-bottom: 56.25%; /* 16:9 */
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
|
||||
iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
// Vimeo hack
|
||||
> div {
|
||||
position: relative;
|
||||
padding-bottom: 200%;
|
||||
transform: translateY(-35.95%);
|
||||
}
|
||||
}
|
||||
// To allow mouse events to be captured if full support
|
||||
.plyr .plyr__video-embed iframe {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Captions
|
||||
// --------------------------------------------------------------
|
||||
// Hide default captions
|
||||
.plyr video::-webkit-media-text-track-container {
|
||||
display: none;
|
||||
}
|
||||
.plyr__captions {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
padding: (@plyr-control-spacing * 2);
|
||||
transform: translateY(-(@plyr-control-spacing * 4));
|
||||
transition: transform .3s ease;
|
||||
color: @plyr-captions-color;
|
||||
font-size: @plyr-font-size-captions-base;
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
|
||||
span {
|
||||
border-radius: 2px;
|
||||
padding: floor(@plyr-control-spacing / 3) @plyr-control-spacing;
|
||||
background: @plyr-captions-bg;
|
||||
box-decoration-break: clone;
|
||||
line-height: 150%;
|
||||
}
|
||||
span:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: @plyr-bp-screen-md) {
|
||||
font-size: @plyr-font-size-captions-medium;
|
||||
}
|
||||
}
|
||||
.plyr--captions-active .plyr__captions {
|
||||
display: block;
|
||||
}
|
||||
.plyr--fullscreen-active .plyr__captions {
|
||||
font-size: @plyr-font-size-captions-large;
|
||||
}
|
||||
.plyr--hide-controls .plyr__captions {
|
||||
transform: translateY(-(@plyr-control-spacing * 1.5));
|
||||
}
|
||||
|
||||
// Controls
|
||||
// --------------------------------------------------------------
|
||||
// Hide native controls
|
||||
.plyr ::-webkit-media-controls {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Playback controls
|
||||
.plyr__controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
|
||||
// Spacing
|
||||
> button,
|
||||
.plyr__progress,
|
||||
.plyr__time {
|
||||
margin-left: (@plyr-control-spacing / 2);
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
.plyr__volume {
|
||||
margin-left: (@plyr-control-spacing / 2);
|
||||
}
|
||||
[data-plyr="pause"] {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
button {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
overflow: visible; // IE11
|
||||
vertical-align: middle;
|
||||
padding: @plyr-control-padding;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
transition: background .3s ease, color .3s ease, opacity .3s ease;
|
||||
color: inherit;
|
||||
|
||||
svg {
|
||||
width: @plyr-control-icon-size;
|
||||
height: @plyr-control-icon-size;
|
||||
display: block;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
// Default focus
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide toggle icons by default
|
||||
.icon--exit-fullscreen,
|
||||
.icon--muted,
|
||||
.icon--captions-on {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: @plyr-bp-screen-sm) {
|
||||
> button,
|
||||
.plyr__progress,
|
||||
.plyr__time {
|
||||
margin-left: @plyr-control-spacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hide controls
|
||||
.plyr--hide-controls .plyr__controls {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Video controls
|
||||
.plyr--video .plyr__controls {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: (@plyr-control-spacing * 5) @plyr-control-spacing @plyr-control-spacing;
|
||||
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%));
|
||||
border-bottom-left-radius: inherit;
|
||||
border-bottom-right-radius: inherit;
|
||||
color: @plyr-video-control-color;
|
||||
transition: opacity .3s ease;
|
||||
|
||||
button {
|
||||
// Hover and tab focus
|
||||
&.tab-focus:focus,
|
||||
&:hover {
|
||||
background: @plyr-video-control-bg-hover;
|
||||
color: @plyr-video-control-color-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Audio controls
|
||||
.plyr--audio .plyr__controls {
|
||||
padding: @plyr-control-spacing;
|
||||
border-radius: inherit;
|
||||
background: @plyr-audio-controls-bg;
|
||||
border: @plyr-audio-controls-border;
|
||||
color: @plyr-audio-control-color;
|
||||
|
||||
button {
|
||||
// Hover and tab focus
|
||||
&.tab-focus:focus,
|
||||
&:hover {
|
||||
background: @plyr-audio-control-bg-hover;
|
||||
color: @plyr-audio-control-color-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Large play button (video only)
|
||||
.plyr__play-large {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: @plyr-control-spacing;
|
||||
background: @plyr-video-control-bg-hover;
|
||||
border: 4px solid currentColor;
|
||||
border-radius: 100%;
|
||||
box-shadow: 0 1px 1px fade(#000, 15%);
|
||||
color: @plyr-video-control-color;
|
||||
transition: all .3s ease;
|
||||
|
||||
svg {
|
||||
position: relative;
|
||||
left: 2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: block;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: 1px dotted fade(@plyr-video-control-color, 50%);
|
||||
}
|
||||
}
|
||||
.plyr .plyr__play-large {
|
||||
display: inline-block;
|
||||
}
|
||||
.plyr--audio .plyr__play-large {
|
||||
display: none;
|
||||
}
|
||||
.plyr--playing .plyr__play-large {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
// States
|
||||
.plyr__controls [data-plyr='pause'],
|
||||
.plyr--playing .plyr__controls [data-plyr='play'] {
|
||||
display: none;
|
||||
}
|
||||
.plyr--playing .plyr__controls [data-plyr='pause'] {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// Change icons on state change
|
||||
.plyr--fullscreen-active .icon--exit-fullscreen,
|
||||
.plyr--muted .plyr__controls .icon--muted,
|
||||
.plyr--captions-active .plyr__controls .icon--captions-on {
|
||||
display: block;
|
||||
|
||||
& + svg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
// Some options are hidden by default
|
||||
.plyr [data-plyr='captions'],
|
||||
.plyr [data-plyr='fullscreen'] {
|
||||
display: none;
|
||||
}
|
||||
.plyr--captions-enabled [data-plyr='captions'],
|
||||
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// Tooltips
|
||||
// --------------------------------------------------------------
|
||||
.plyr__tooltip {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
bottom: 100%;
|
||||
margin-bottom: (@plyr-tooltip-padding * 2);
|
||||
padding: @plyr-tooltip-padding (@plyr-tooltip-padding * 1.5);
|
||||
pointer-events: none;
|
||||
|
||||
opacity: 0;
|
||||
background: @plyr-tooltip-bg;
|
||||
border-radius: @plyr-tooltip-radius;
|
||||
|
||||
color: @plyr-tooltip-color;
|
||||
font-size: @plyr-font-size-small;
|
||||
line-height: 1.3;
|
||||
|
||||
transform: translate(-50%, 10px) scale(.8);
|
||||
transform-origin: 50% 100%;
|
||||
transition: transform .2s .1s ease, opacity .2s .1s ease;
|
||||
|
||||
&::before {
|
||||
// Arrows
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
// The background triangle
|
||||
bottom: -@plyr-tooltip-arrow-size;
|
||||
border-right: @plyr-tooltip-arrow-size solid transparent;
|
||||
border-top: @plyr-tooltip-arrow-size solid @plyr-tooltip-bg;
|
||||
border-left: @plyr-tooltip-arrow-size solid transparent;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
.plyr button:hover .plyr__tooltip,
|
||||
.plyr button.tab-focus:focus .plyr__tooltip,
|
||||
.plyr__tooltip--visible {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, 0) scale(1);
|
||||
}
|
||||
.plyr button:hover .plyr__tooltip {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
// First tooltip
|
||||
.plyr__controls button:first-child .plyr__tooltip {
|
||||
left: 0;
|
||||
transform: translate(0, 10px) scale(.8);
|
||||
transform-origin: 0 100%;
|
||||
|
||||
&::before {
|
||||
left: (@plyr-control-icon-size / 2) + @plyr-control-padding;
|
||||
}
|
||||
}
|
||||
|
||||
// Last tooltip
|
||||
.plyr__controls button:last-child .plyr__tooltip {
|
||||
right: 0;
|
||||
transform: translate(0, 10px) scale(.8);
|
||||
transform-origin: 100% 100%;
|
||||
|
||||
&::before {
|
||||
left: auto;
|
||||
right: (@plyr-control-icon-size / 2) + @plyr-control-padding;
|
||||
transform: translateX(50%);
|
||||
}
|
||||
}
|
||||
|
||||
.plyr__controls button:first-child,
|
||||
.plyr__controls button:last-child {
|
||||
&:hover .plyr__tooltip,
|
||||
&.tab-focus:focus .plyr__tooltip,
|
||||
.plyr__tooltip--visible {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Playback progress
|
||||
// --------------------------------------------------------------
|
||||
// <progress> element
|
||||
.plyr__progress {
|
||||
position: relative;
|
||||
display: none;
|
||||
flex: 1;
|
||||
|
||||
input[type="range"] {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
&::-webkit-slider-runnable-track {
|
||||
background: transparent;
|
||||
}
|
||||
&::-moz-range-track {
|
||||
background: transparent;
|
||||
}
|
||||
&::-ms-fill-upper {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
// Seek tooltip to show time
|
||||
.plyr__tooltip {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
.plyr .plyr__progress {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.plyr__progress--buffer,
|
||||
.plyr__progress--played,
|
||||
.plyr__volume--display {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
width: 100%;
|
||||
height: @plyr-range-track-height;
|
||||
margin: -(@plyr-range-track-height / 2) 0 0;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
appearance: none;
|
||||
border: none;
|
||||
border-radius: 100px;
|
||||
|
||||
&::-webkit-progress-bar {
|
||||
background: transparent;
|
||||
}
|
||||
&::-webkit-progress-value {
|
||||
background: currentColor;
|
||||
border-radius: 100px;
|
||||
min-width: @plyr-range-track-height;
|
||||
}
|
||||
&::-moz-progress-bar {
|
||||
background: currentColor;
|
||||
border-radius: 100px;
|
||||
min-width: @plyr-range-track-height;
|
||||
}
|
||||
&::-ms-fill {
|
||||
border-radius: 100px;
|
||||
}
|
||||
}
|
||||
.plyr__progress--played,
|
||||
.plyr__volume--display {
|
||||
z-index: 1;
|
||||
color: @plyr-range-selected-bg;
|
||||
background: transparent;
|
||||
transition: none;
|
||||
|
||||
&::-webkit-progress-value {
|
||||
min-width: @plyr-range-track-height;
|
||||
max-width: 99%;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
transition: none;
|
||||
}
|
||||
&::-moz-progress-bar {
|
||||
min-width: @plyr-range-track-height;
|
||||
max-width: 99%;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
transition: none;
|
||||
}
|
||||
&::-ms-fill {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.plyr__progress--buffer {
|
||||
&::-webkit-progress-value {
|
||||
transition: width .2s ease;
|
||||
}
|
||||
&::-moz-progress-bar {
|
||||
transition: width .2s ease;
|
||||
}
|
||||
&::-ms-fill {
|
||||
transition: width .2s ease;
|
||||
}
|
||||
}
|
||||
.plyr--video .plyr__progress--buffer,
|
||||
.plyr--video .plyr__volume--display {
|
||||
background: @plyr-video-range-track-bg;
|
||||
}
|
||||
.plyr--video .plyr__progress--buffer {
|
||||
color: @plyr-video-progress-buffered-bg;
|
||||
}
|
||||
.plyr--audio .plyr__progress--buffer,
|
||||
.plyr--audio .plyr__volume--display {
|
||||
background: @plyr-audio-range-track-bg;
|
||||
}
|
||||
.plyr--audio .plyr__progress--buffer {
|
||||
color: @plyr-audio-progress-buffered-bg;
|
||||
}
|
||||
|
||||
// Loading state
|
||||
.plyr--loading .plyr__progress--buffer {
|
||||
animation: plyr-progress 1s linear infinite;
|
||||
background-size: @plyr-progress-loading-size @plyr-progress-loading-size;
|
||||
background-repeat: repeat-x;
|
||||
background-image: linear-gradient(
|
||||
-45deg,
|
||||
@plyr-progress-loading-bg 25%,
|
||||
transparent 25%,
|
||||
transparent 50%,
|
||||
@plyr-progress-loading-bg 50%,
|
||||
@plyr-progress-loading-bg 75%,
|
||||
transparent 75%,
|
||||
transparent);
|
||||
color: transparent;
|
||||
}
|
||||
.plyr--video.plyr--loading .plyr__progress--buffer {
|
||||
background-color: @plyr-video-progress-buffered-bg;
|
||||
}
|
||||
.plyr--audio.plyr--loading .plyr__progress--buffer {
|
||||
background-color: @plyr-audio-progress-buffered-bg;
|
||||
}
|
||||
|
||||
// Time
|
||||
// --------------------------------------------------------------
|
||||
.plyr__time {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-size: @plyr-font-size-small;
|
||||
}
|
||||
// Media duration hidden on small screens
|
||||
.plyr__time + .plyr__time {
|
||||
display: none;
|
||||
|
||||
@media (min-width: @plyr-bp-screen-md) {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// Add a slash in before
|
||||
&::before {
|
||||
content: '\2044';
|
||||
margin-right: @plyr-control-spacing;
|
||||
}
|
||||
}
|
||||
|
||||
// Volume
|
||||
// --------------------------------------------------------------
|
||||
.plyr__volume {
|
||||
display: none;
|
||||
}
|
||||
.plyr .plyr__volume {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
|
||||
input[type="range"] {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
@media (min-width: @plyr-bp-screen-sm) {
|
||||
display: block;
|
||||
max-width: 60px;
|
||||
}
|
||||
@media (min-width: @plyr-bp-screen-md) {
|
||||
max-width: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide sound controls on iOS
|
||||
// It's not supported to change volume using JavaScript:
|
||||
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
||||
.plyr--is-ios .plyr__volume,
|
||||
.plyr--is-ios [data-plyr='mute'] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
// Fullscreen
|
||||
// --------------------------------------------------------------
|
||||
.plyr--fullscreen-active {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10000000;
|
||||
background: #000;
|
||||
border-radius: 0 !important;
|
||||
|
||||
video {
|
||||
height: 100%;
|
||||
}
|
||||
.plyr__video-wrapper {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.plyr__controls {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
// Vimeo requires some different styling
|
||||
&.plyr--vimeo .plyr__video-wrapper {
|
||||
height: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
71
src/less/variables.less
Normal file
@ -0,0 +1,71 @@
|
||||
// ==========================================================================
|
||||
// Plyr variables
|
||||
// https://github.com/selz/plyr
|
||||
// ==========================================================================
|
||||
|
||||
// Settings
|
||||
@plyr-border-box: true;
|
||||
@plyr-touch-action: true;
|
||||
@plyr-sr-only-important: true;
|
||||
|
||||
// Colors
|
||||
@plyr-color-main: #3498db;
|
||||
|
||||
// Font
|
||||
@plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif;
|
||||
@plyr-font-size-small: 14px;
|
||||
@plyr-font-size-base: 16px;
|
||||
|
||||
// Captions
|
||||
@plyr-captions-bg: fade(#000, 70%);
|
||||
@plyr-captions-color: #fff;
|
||||
@plyr-font-size-captions-base: @plyr-font-size-base;
|
||||
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
|
||||
@plyr-font-size-captions-large: (@plyr-font-size-base * 2);
|
||||
|
||||
// Controls
|
||||
@plyr-control-icon-size: 18px;
|
||||
@plyr-control-spacing: 10px;
|
||||
@plyr-control-padding: (@plyr-control-spacing * .7);
|
||||
@plyr-video-controls-bg: #000;
|
||||
@plyr-video-control-color: #fff;
|
||||
@plyr-video-control-color-hover: #fff;
|
||||
@plyr-video-control-bg-hover: @plyr-color-main;
|
||||
@plyr-audio-controls-bg: #fff;
|
||||
@plyr-audio-controls-border: 1px solid #dbe3e8;
|
||||
@plyr-audio-control-color: #565D64;
|
||||
@plyr-audio-control-color-hover: #fff;
|
||||
@plyr-audio-control-bg-hover: @plyr-color-main;
|
||||
|
||||
// Tooltips
|
||||
@plyr-tooltip-bg: fade(#000, 70%);
|
||||
@plyr-tooltip-color: #fff;
|
||||
@plyr-tooltip-padding: (@plyr-control-spacing / 2);
|
||||
@plyr-tooltip-arrow-size: 4px;
|
||||
@plyr-tooltip-radius: 3px;
|
||||
|
||||
// Progress
|
||||
@plyr-progress-loading-size: 25px;
|
||||
@plyr-progress-loading-bg: fade(#000, 15%);
|
||||
@plyr-video-progress-bg: fade(#fff, 25%);
|
||||
@plyr-video-progress-buffered-bg: @plyr-video-progress-bg;
|
||||
@plyr-audio-progress-bg: fade(#C6D6DB, 66%);
|
||||
@plyr-audio-progress-buffered-bg: @plyr-audio-progress-bg;
|
||||
|
||||
// Range sliders
|
||||
@plyr-range-track-height: 8px;
|
||||
@plyr-range-thumb-height: floor(@plyr-range-track-height * 2);
|
||||
@plyr-range-thumb-width: floor(@plyr-range-track-height * 2);
|
||||
@plyr-range-thumb-bg: #fff;
|
||||
@plyr-range-thumb-border: 2px solid transparent;
|
||||
@plyr-range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%), 0 0 0 1px fade(#000, 15%);
|
||||
@plyr-range-thumb-active-border-color: #fff;
|
||||
@plyr-range-thumb-active-bg: @plyr-video-control-bg-hover;
|
||||
@plyr-range-thumb-active-scale: 1.25;
|
||||
@plyr-video-range-track-bg: @plyr-video-progress-buffered-bg;
|
||||
@plyr-audio-range-track-bg: @plyr-audio-progress-buffered-bg;
|
||||
@plyr-range-selected-bg: @plyr-color-main;
|
||||
|
||||
// Breakpoints
|
||||
@plyr-bp-screen-sm: 480px;
|
||||
@plyr-bp-screen-md: 768px;
|
29
src/scss/mixins.scss
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// Plyr mixins
|
||||
// https://github.com/selz/plyr
|
||||
// ==========================================================================
|
||||
|
||||
// <input type="range"> styling
|
||||
@mixin plyr-range-track() {
|
||||
height: $plyr-range-track-height;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: ($plyr-range-track-height / 2);
|
||||
user-select: none;
|
||||
}
|
||||
@mixin plyr-range-thumb() {
|
||||
position: relative;
|
||||
height: $plyr-range-thumb-height;
|
||||
width: $plyr-range-thumb-width;
|
||||
background: $plyr-range-thumb-bg;
|
||||
border: $plyr-range-thumb-border;
|
||||
border-radius: 100%;
|
||||
transition: background .2s ease, border .2s ease, transform .2s ease;
|
||||
box-shadow: $plyr-range-thumb-shadow;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@mixin plyr-range-thumb-active() {
|
||||
background: $plyr-range-thumb-active-bg;
|
||||
border-color: $plyr-range-thumb-active-border-color;
|
||||
transform: scale($plyr-range-thumb-active-scale);
|
||||
}
|
751
src/scss/plyr.scss
Normal file
@ -0,0 +1,751 @@
|
||||
// ==========================================================================
|
||||
// Plyr styles
|
||||
// https://github.com/selz/plyr
|
||||
// ==========================================================================
|
||||
|
||||
@import "variables";
|
||||
@import "mixins";
|
||||
|
||||
// Animation
|
||||
// ---------------------------------------
|
||||
@keyframes plyr-progress {
|
||||
to { background-position: $plyr-progress-loading-size 0; }
|
||||
}
|
||||
|
||||
// Styles
|
||||
// -------------------------------
|
||||
// Base
|
||||
.plyr {
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
min-width: 200px;
|
||||
font-family: $plyr-font-family;
|
||||
direction: ltr;
|
||||
|
||||
@if $plyr-border-box == true {
|
||||
// border-box everything
|
||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||
&,
|
||||
*,
|
||||
*::after,
|
||||
*::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
@if $plyr-touch-action == true {
|
||||
// Fix 300ms delay
|
||||
a, button, input, label {
|
||||
touch-action: manipulation;
|
||||
}
|
||||
}
|
||||
|
||||
// Focus
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
// Media elements
|
||||
video,
|
||||
audio {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
// Range inputs
|
||||
// Specificity is for bootstrap compatibility
|
||||
input[type='range'] {
|
||||
display: block;
|
||||
height: ($plyr-range-thumb-height * $plyr-range-thumb-active-scale);
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
background: transparent;
|
||||
|
||||
// WebKit
|
||||
&::-webkit-slider-runnable-track {
|
||||
@include plyr-range-track();
|
||||
}
|
||||
&::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
margin-top: -(($plyr-range-thumb-height - $plyr-range-track-height) / 2);
|
||||
@include plyr-range-thumb();
|
||||
}
|
||||
|
||||
// Mozilla
|
||||
&::-moz-range-track {
|
||||
@include plyr-range-track();
|
||||
}
|
||||
&::-moz-range-thumb {
|
||||
@include plyr-range-thumb();
|
||||
}
|
||||
|
||||
// Microsoft
|
||||
&::-ms-track {
|
||||
height: $plyr-range-track-height;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: transparent;
|
||||
}
|
||||
&::-ms-fill-upper {
|
||||
@include plyr-range-track();
|
||||
}
|
||||
&::-ms-fill-lower {
|
||||
@include plyr-range-track();
|
||||
background: $plyr-range-selected-bg;
|
||||
}
|
||||
&::-ms-thumb {
|
||||
@include plyr-range-thumb();
|
||||
// For some reason, Edge uses the -webkit margin above
|
||||
margin-top: 0;
|
||||
}
|
||||
&::-ms-tooltip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Focus styles
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
&::-moz-focus-outer {
|
||||
border: 0;
|
||||
}
|
||||
&.tab-focus:focus {
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
// Pressed styles
|
||||
&:active {
|
||||
&::-webkit-slider-thumb {
|
||||
@include plyr-range-thumb-active();
|
||||
}
|
||||
&::-moz-range-thumb {
|
||||
@include plyr-range-thumb-active();
|
||||
}
|
||||
&::-ms-thumb {
|
||||
@include plyr-range-thumb-active();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Video range inputs
|
||||
.plyr--video input[type='range'].tab-focus:focus {
|
||||
outline: 1px dotted transparentize($plyr-video-control-color, .5);
|
||||
}
|
||||
|
||||
// Audio range inputs
|
||||
.plyr--audio input[type='range'].tab-focus:focus {
|
||||
outline: 1px dotted transparentize($plyr-audio-control-color, .5);
|
||||
}
|
||||
|
||||
// Screen reader only elements
|
||||
.plyr__sr-only {
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
overflow: hidden;
|
||||
|
||||
// !important is not always needed
|
||||
@if $plyr-sr-only-important == true {
|
||||
position: absolute !important;
|
||||
padding: 0 !important;
|
||||
border: 0 !important;
|
||||
height: 1px !important;
|
||||
width: 1px !important;
|
||||
} @else {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
// Video
|
||||
.plyr__video-wrapper {
|
||||
position: relative;
|
||||
background: #000;
|
||||
border-radius: inherit;
|
||||
|
||||
// Cleaner radius, also forces iframe radius
|
||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
||||
}
|
||||
|
||||
// Container for embeds
|
||||
.plyr__video-embed {
|
||||
padding-bottom: 56.25%; /* 16:9 */
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
border-radius: inherit;
|
||||
|
||||
iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
// Vimeo hack
|
||||
> div {
|
||||
position: relative;
|
||||
padding-bottom: 200%;
|
||||
transform: translateY(-35.95%);
|
||||
}
|
||||
}
|
||||
// To allow mouse events to be captured if full support
|
||||
.plyr .plyr__video-embed iframe {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Captions
|
||||
// --------------------------------------------------------------
|
||||
// Hide default captions
|
||||
.plyr video::-webkit-media-text-track-container {
|
||||
display: none;
|
||||
}
|
||||
.plyr__captions {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
padding: ($plyr-control-spacing * 2);
|
||||
transform: translateY(-($plyr-control-spacing * 6));
|
||||
transition: transform .3s ease;
|
||||
color: $plyr-captions-color;
|
||||
font-size: $plyr-font-size-captions-base;
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
|
||||
span {
|
||||
border-radius: 2px;
|
||||
padding: floor($plyr-control-spacing / 3) $plyr-control-spacing;
|
||||
background: $plyr-captions-bg;
|
||||
box-decoration-break: clone;
|
||||
line-height: 150%;
|
||||
}
|
||||
span:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: $plyr-bp-screen-md) {
|
||||
font-size: $plyr-font-size-captions-medium;
|
||||
}
|
||||
}
|
||||
.plyr--captions-active .plyr__captions {
|
||||
display: block;
|
||||
}
|
||||
.plyr--fullscreen-active .plyr__captions {
|
||||
font-size: $plyr-font-size-captions-large;
|
||||
}
|
||||
.plyr--hide-controls .plyr__captions {
|
||||
transform: translateY(-($plyr-control-spacing * 2));
|
||||
}
|
||||
|
||||
// Controls
|
||||
// --------------------------------------------------------------
|
||||
// Hide native controls
|
||||
.plyr ::-webkit-media-controls {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Playback controls
|
||||
.plyr__controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
|
||||
// Spacing
|
||||
> button,
|
||||
.plyr__progress,
|
||||
.plyr__time {
|
||||
margin-left: ($plyr-control-spacing / 2);
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
.plyr__volume {
|
||||
margin-left: ($plyr-control-spacing / 2);
|
||||
}
|
||||
[data-plyr="pause"] {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
button {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
overflow: visible; // IE11
|
||||
vertical-align: middle;
|
||||
padding: ($plyr-control-spacing * .7);
|
||||
border: 0;
|
||||
background: transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
transition: background .3s ease, color .3s ease, opacity .3s ease;
|
||||
color: inherit;
|
||||
|
||||
svg {
|
||||
width: $plyr-control-icon-size;
|
||||
height: $plyr-control-icon-size;
|
||||
display: block;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
// Default focus
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide toggle icons by default
|
||||
.icon--exit-fullscreen,
|
||||
.icon--muted,
|
||||
.icon--captions-on {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: $plyr-bp-screen-sm) {
|
||||
> button,
|
||||
.plyr__progress,
|
||||
.plyr__time {
|
||||
margin-left: $plyr-control-spacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hide controls
|
||||
.plyr--hide-controls .plyr__controls {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Video controls
|
||||
.plyr--video .plyr__controls {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: ($plyr-control-spacing * 5) $plyr-control-spacing $plyr-control-spacing;
|
||||
background: linear-gradient(transparentize($plyr-video-controls-bg, 1), transparentize($plyr-video-controls-bg, .5));
|
||||
border-bottom-left-radius: inherit;
|
||||
border-bottom-right-radius: inherit;
|
||||
color: $plyr-video-control-color;
|
||||
transition: opacity .3s ease;
|
||||
|
||||
button {
|
||||
// Hover and tab focus
|
||||
&.tab-focus:focus,
|
||||
&:hover {
|
||||
background: $plyr-video-control-bg-hover;
|
||||
color: $plyr-video-control-color-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Audio controls
|
||||
.plyr--audio .plyr__controls {
|
||||
padding: $plyr-control-spacing;
|
||||
border-radius: inherit;
|
||||
background: $plyr-audio-controls-bg;
|
||||
border: $plyr-audio-controls-border;
|
||||
color: $plyr-audio-control-color;
|
||||
|
||||
button {
|
||||
// Hover and tab focus
|
||||
&.tab-focus:focus,
|
||||
&:hover {
|
||||
background: $plyr-audio-control-bg-hover;
|
||||
color: $plyr-audio-control-color-hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Large play button (video only)
|
||||
.plyr__play-large {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: $plyr-control-spacing;
|
||||
background: $plyr-video-control-bg-hover;
|
||||
border: 4px solid currentColor;
|
||||
border-radius: 100%;
|
||||
box-shadow: 0 1px 1px transparentize(#000, .85);
|
||||
color: $plyr-video-control-color;
|
||||
transition: all .3s ease;
|
||||
|
||||
svg {
|
||||
position: relative;
|
||||
left: 2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: block;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: 1px dotted transparentize($plyr-video-control-color, .5);
|
||||
}
|
||||
}
|
||||
.plyr .plyr__play-large {
|
||||
display: inline-block;
|
||||
}
|
||||
.plyr--audio .plyr__play-large {
|
||||
display: none;
|
||||
}
|
||||
.plyr--playing .plyr__play-large {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
// States
|
||||
.plyr__controls [data-plyr='pause'],
|
||||
.plyr--playing .plyr__controls [data-plyr='play'] {
|
||||
display: none;
|
||||
}
|
||||
.plyr--playing .plyr__controls [data-plyr='pause'] {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// Change icons on state change
|
||||
.plyr--fullscreen-active .icon--exit-fullscreen,
|
||||
.plyr--muted .plyr__controls .icon--muted,
|
||||
.plyr--captions-active .plyr__controls .icon--captions-on {
|
||||
display: block;
|
||||
|
||||
& + svg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
// Some options are hidden by default
|
||||
.plyr [data-plyr='captions'],
|
||||
.plyr [data-plyr='fullscreen'] {
|
||||
display: none;
|
||||
}
|
||||
.plyr--captions-enabled [data-plyr='captions'],
|
||||
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// Tooltips
|
||||
// --------------------------------------------------------------
|
||||
.plyr__tooltip {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
bottom: 100%;
|
||||
margin-bottom: ($plyr-tooltip-padding * 2);
|
||||
padding: $plyr-tooltip-padding ($plyr-tooltip-padding * 1.5);
|
||||
pointer-events: none;
|
||||
|
||||
opacity: 0;
|
||||
background: $plyr-tooltip-bg;
|
||||
border-radius: $plyr-tooltip-radius;
|
||||
|
||||
color: $plyr-tooltip-color;
|
||||
font-size: $plyr-font-size-small;
|
||||
line-height: 1.3;
|
||||
|
||||
transform: translate(-50%, 10px) scale(.8);
|
||||
transform-origin: 50% 100%;
|
||||
transition: transform .2s .1s ease, opacity .2s .1s ease;
|
||||
|
||||
&::before {
|
||||
// Arrows
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
// The background triangle
|
||||
bottom: -$plyr-tooltip-arrow-size;
|
||||
border-right: $plyr-tooltip-arrow-size solid transparent;
|
||||
border-top: $plyr-tooltip-arrow-size solid $plyr-tooltip-bg;
|
||||
border-left: $plyr-tooltip-arrow-size solid transparent;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
.plyr button:hover .plyr__tooltip,
|
||||
.plyr button.tab-focus:focus .plyr__tooltip,
|
||||
.plyr__tooltip--visible {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, 0) scale(1);
|
||||
}
|
||||
.plyr button:hover .plyr__tooltip {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
// First tooltip
|
||||
.plyr__controls button:first-child .plyr__tooltip {
|
||||
left: 0;
|
||||
transform: translate(0, 10px) scale(.8);
|
||||
transform-origin: 0 100%;
|
||||
|
||||
&::before {
|
||||
left: ($plyr-control-icon-size / 2) + $plyr-control-padding;
|
||||
}
|
||||
}
|
||||
|
||||
// Last tooltip
|
||||
.plyr__controls button:last-child .plyr__tooltip {
|
||||
right: 0;
|
||||
transform: translate(0, 10px) scale(.8);
|
||||
transform-origin: 100% 100%;
|
||||
|
||||
&::before {
|
||||
left: auto;
|
||||
right: ($plyr-control-icon-size / 2) + $plyr-control-padding;
|
||||
transform: translateX(50%);
|
||||
}
|
||||
}
|
||||
|
||||
.plyr__controls button:first-child,
|
||||
.plyr__controls button:last-child {
|
||||
&:hover .plyr__tooltip,
|
||||
&.tab-focus:focus .plyr__tooltip,
|
||||
.plyr__tooltip--visible {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Playback progress
|
||||
// --------------------------------------------------------------
|
||||
// <progress> element
|
||||
.plyr__progress {
|
||||
display: none;
|
||||
position: relative;
|
||||
flex: 1;
|
||||
|
||||
input[type="range"] {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
&::-webkit-slider-runnable-track {
|
||||
background: transparent;
|
||||
}
|
||||
&::-moz-range-track {
|
||||
background: transparent;
|
||||
}
|
||||
&::-ms-fill-upper {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
// Seek tooltip to show time
|
||||
.plyr__tooltip {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
.plyr .plyr__progress {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.plyr__progress--buffer,
|
||||
.plyr__progress--played,
|
||||
.plyr__volume--display {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
width: 100%;
|
||||
height: $plyr-range-track-height;
|
||||
margin: -($plyr-range-track-height / 2) 0 0;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
appearance: none;
|
||||
border: none;
|
||||
border-radius: 100px;
|
||||
|
||||
&::-webkit-progress-bar {
|
||||
background: transparent;
|
||||
}
|
||||
&::-webkit-progress-value {
|
||||
background: currentColor;
|
||||
border-radius: 100px;
|
||||
min-width: $plyr-range-track-height;
|
||||
}
|
||||
&::-moz-progress-bar {
|
||||
background: currentColor;
|
||||
border-radius: 100px;
|
||||
min-width: $plyr-range-track-height;
|
||||
}
|
||||
&::-ms-fill {
|
||||
border-radius: 100px;
|
||||
}
|
||||
}
|
||||
.plyr__progress--played,
|
||||
.plyr__volume--display {
|
||||
z-index: 1;
|
||||
color: $plyr-range-selected-bg;
|
||||
background: transparent;
|
||||
transition: none;
|
||||
|
||||
&::-webkit-progress-value {
|
||||
min-width: $plyr-range-track-height;
|
||||
max-width: 99%;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
transition: none;
|
||||
}
|
||||
&::-moz-progress-bar {
|
||||
min-width: $plyr-range-track-height;
|
||||
max-width: 99%;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
transition: none;
|
||||
}
|
||||
&::-ms-fill {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.plyr__progress--buffer {
|
||||
&::-webkit-progress-value {
|
||||
transition: width .2s ease;
|
||||
}
|
||||
&::-moz-progress-bar {
|
||||
transition: width .2s ease;
|
||||
}
|
||||
&::-ms-fill {
|
||||
transition: width .2s ease;
|
||||
}
|
||||
}
|
||||
.plyr--video .plyr__progress--buffer,
|
||||
.plyr--video .plyr__volume--display {
|
||||
background: $plyr-video-range-track-bg;
|
||||
}
|
||||
.plyr--video .plyr__progress--buffer {
|
||||
color: $plyr-video-progress-buffered-bg;
|
||||
}
|
||||
.plyr--audio .plyr__progress--buffer,
|
||||
.plyr--audio .plyr__volume--display {
|
||||
background: $plyr-audio-range-track-bg;
|
||||
}
|
||||
.plyr--audio .plyr__progress--buffer {
|
||||
color: $plyr-audio-progress-buffered-bg;
|
||||
}
|
||||
|
||||
// Loading state
|
||||
.plyr--loading .plyr__progress--buffer {
|
||||
animation: plyr-progress 1s linear infinite;
|
||||
background-size: $plyr-progress-loading-size $plyr-progress-loading-size;
|
||||
background-repeat: repeat-x;
|
||||
background-image: linear-gradient(
|
||||
-45deg,
|
||||
$plyr-progress-loading-bg 25%,
|
||||
transparent 25%,
|
||||
transparent 50%,
|
||||
$plyr-progress-loading-bg 50%,
|
||||
$plyr-progress-loading-bg 75%,
|
||||
transparent 75%,
|
||||
transparent);
|
||||
color: transparent;
|
||||
}
|
||||
.plyr--video.plyr--loading .plyr__progress--buffer {
|
||||
background-color: $plyr-video-progress-buffered-bg;
|
||||
}
|
||||
.plyr--audio.plyr--loading .plyr__progress--buffer {
|
||||
background-color: $plyr-audio-progress-buffered-bg;
|
||||
}
|
||||
|
||||
// Time
|
||||
// --------------------------------------------------------------
|
||||
.plyr__time {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-size: $plyr-font-size-small;
|
||||
}
|
||||
// Media duration hidden on small screens
|
||||
.plyr__time + .plyr__time {
|
||||
display: none;
|
||||
|
||||
@media (min-width: $plyr-bp-screen-md) {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// Add a slash in before
|
||||
&::before {
|
||||
content: '\2044';
|
||||
margin-right: $plyr-control-spacing;
|
||||
}
|
||||
}
|
||||
|
||||
// Volume
|
||||
// --------------------------------------------------------------
|
||||
.plyr__volume {
|
||||
display: none;
|
||||
}
|
||||
.plyr .plyr__volume {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
|
||||
input[type="range"] {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
@media (min-width: $plyr-bp-screen-sm) {
|
||||
display: block;
|
||||
max-width: 60px;
|
||||
}
|
||||
@media (min-width: $plyr-bp-screen-md) {
|
||||
max-width: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide sound controls on iOS
|
||||
// It's not supported to change volume using JavaScript:
|
||||
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
||||
.plyr--is-ios .plyr__volume,
|
||||
.plyr--is-ios [data-plyr='mute'] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
// Fullscreen
|
||||
// --------------------------------------------------------------
|
||||
.plyr--fullscreen-active {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10000000;
|
||||
background: #000;
|
||||
border-radius: 0 !important;
|
||||
|
||||
video {
|
||||
height: 100%;
|
||||
}
|
||||
.plyr__video-wrapper {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.plyr__controls {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
// Vimeo requires some different styling
|
||||
&.plyr--vimeo .plyr__video-wrapper {
|
||||
height: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
72
src/scss/variables.scss
Normal file
@ -0,0 +1,72 @@
|
||||
// ==========================================================================
|
||||
// Plyr variables
|
||||
// https://github.com/selz/plyr
|
||||
// https://robots.thoughtbot.com/sass-default
|
||||
// ==========================================================================
|
||||
|
||||
// Settings
|
||||
$plyr-border-box: true !default;
|
||||
$plyr-touch-action: true !default;
|
||||
$plyr-sr-only-important: true !default;
|
||||
|
||||
// Colors
|
||||
$plyr-color-main: #3498db !default;
|
||||
|
||||
// Font sizes
|
||||
$plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif !default;
|
||||
$plyr-font-size-small: 14px !default;
|
||||
$plyr-font-size-base: 16px !default;
|
||||
|
||||
// Captions
|
||||
$plyr-captions-bg: transparentize(#000, .3) !default;
|
||||
$plyr-captions-color: #fff !default;
|
||||
$plyr-font-size-captions-base: $plyr-font-size-base !default;
|
||||
$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
|
||||
$plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default;
|
||||
|
||||
// Controls
|
||||
$plyr-control-icon-size: 18px !default;
|
||||
$plyr-control-spacing: 10px !default;
|
||||
$plyr-control-padding: ($plyr-control-spacing * .7) !default;
|
||||
$plyr-video-controls-bg: #000 !default;
|
||||
$plyr-video-control-color: #fff !default;
|
||||
$plyr-video-control-color-hover: #fff !default;
|
||||
$plyr-video-control-bg-hover: $plyr-color-main !default;
|
||||
$plyr-audio-controls-bg: #fff !default;
|
||||
$plyr-audio-controls-border: 1px solid #dbe3e8 !default;
|
||||
$plyr-audio-control-color: #565D64 !default;
|
||||
$plyr-audio-control-color-hover: #fff !default;
|
||||
$plyr-audio-control-bg-hover: $plyr-color-main;
|
||||
|
||||
// Tooltips
|
||||
$plyr-tooltip-bg: transparentize(#000, .3) !default;
|
||||
$plyr-tooltip-color: #fff !default;
|
||||
$plyr-tooltip-padding: ($plyr-control-spacing / 2) !default;
|
||||
$plyr-tooltip-arrow-size: 4px !default;
|
||||
$plyr-tooltip-radius: 3px !default;
|
||||
|
||||
// Progress
|
||||
$plyr-progress-loading-size: 25px !default;
|
||||
$plyr-progress-loading-bg: transparentize(#000, .85) !default;
|
||||
$plyr-video-progress-bg: transparentize(#fff, .75) !default;
|
||||
$plyr-video-progress-buffered-bg: $plyr-video-progress-bg !default;
|
||||
$plyr-audio-progress-bg: transparentize(#C6D6DB, .33) !default;
|
||||
$plyr-audio-progress-buffered-bg: $plyr-audio-progress-bg !default;
|
||||
|
||||
// Range sliders
|
||||
$plyr-range-track-height: 8px !default;
|
||||
$plyr-range-thumb-height: floor($plyr-range-track-height * 2) !default;
|
||||
$plyr-range-thumb-width: floor($plyr-range-track-height * 2) !default;
|
||||
$plyr-range-thumb-bg: #fff !default;
|
||||
$plyr-range-thumb-border: 2px solid transparent !default;
|
||||
$plyr-range-thumb-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85), 0 0 0 1px transparentize(#000, .85) !default;
|
||||
$plyr-range-thumb-active-border-color: #fff !default;
|
||||
$plyr-range-thumb-active-bg: $plyr-video-control-bg-hover !default;
|
||||
$plyr-range-thumb-active-scale: 1.25 !default;
|
||||
$plyr-video-range-track-bg: $plyr-video-progress-buffered-bg !default;
|
||||
$plyr-audio-range-track-bg: $plyr-audio-progress-buffered-bg !default;
|
||||
$plyr-range-selected-bg: $plyr-color-main !default;
|
||||
|
||||
// Breakpoints
|
||||
$plyr-bp-screen-sm: 480px !default;
|
||||
$plyr-bp-screen-md: 768px !default;
|