Compare commits
2084 Commits
Author | SHA1 | Date | |
---|---|---|---|
0c9759455c | |||
ae59c117b5 | |||
8da1a78342 | |||
747c5f5f31 | |||
39c6049850 | |||
0202e8efb0 | |||
e17d0220c0 | |||
aa4eaec742 | |||
851c39d44e | |||
f012a7df36 | |||
b8c40ead0a | |||
874bb8d3e8 | |||
2b3e483b36 | |||
69ef4ec827 | |||
d6cc19f2d8 | |||
d67eea5942 | |||
c4a566dbff | |||
185bb4c7cc | |||
d9161212ff | |||
ed0b901d11 | |||
62436d8e8e | |||
5731245f4f | |||
41e2454bd2 | |||
9248e322fc | |||
fa634a1bbb | |||
f7d2938f42 | |||
7c88b58a1a | |||
20bf5a8833 | |||
de0402bebf | |||
db1b89b1c1 | |||
ea3675fcdc | |||
e8beabd6a8 | |||
433acd6f41 | |||
69ced1313a | |||
511a7db7c2 | |||
6a62e3d085 | |||
aba00d0ab6 | |||
c115dfc6a6 | |||
6030b300f6 | |||
fff26351c9 | |||
e0fb524382 | |||
ebda039395 | |||
ed456197f5 | |||
66187c348a | |||
cacaef7def | |||
42b8f7bdab | |||
c90f044dac | |||
5f2cb90bc6 | |||
537ad2fe7d | |||
e7621bec0f | |||
e3acba5859 | |||
d7086074e8 | |||
04e6c43da7 | |||
73bfb5211b | |||
4a78b656da | |||
776fd099f3 | |||
bdcd98f4a7 | |||
01417f958a | |||
412d5df06e | |||
3e35461e04 | |||
1edec28d86 | |||
99a7e9e1d7 | |||
24eef153cb | |||
3f09cf566b | |||
29318591c0 | |||
d434c9af16 | |||
9ce1dd6808 | |||
28347a0d7e | |||
5f9d090c13 | |||
1d4869beee | |||
565b68a5e2 | |||
285282f366 | |||
02456d6ba3 | |||
1d920a2e58 | |||
ba67920025 | |||
b7953ff0fc | |||
6b8e0f25d6 | |||
895299a4b3 | |||
2d7638a230 | |||
ab028ea475 | |||
9157ac09ed | |||
da7524438b | |||
c64c8ac6c0 | |||
d700bb9f02 | |||
2b6208565f | |||
6bc447b916 | |||
4632614ced | |||
01c5428fc4 | |||
591c045c20 | |||
1d7ea197f3 | |||
1d0d6a3a92 | |||
6a92e60a67 | |||
40395a1ff5 | |||
9ea3a6923d | |||
675a853e2e | |||
950786b117 | |||
626e1dba64 | |||
cbd1596af4 | |||
6ea510c36e | |||
0acf228dcd | |||
91b19baf44 | |||
990d636019 | |||
b9c792b377 | |||
1b835cb657 | |||
d9f9dc770b | |||
dca2ff8cfd | |||
cf8e9341f2 | |||
5d1d247491 | |||
fbf4d27cd4 | |||
e0b70d53cd | |||
9f7725cec1 | |||
720cddff21 | |||
1c33098c42 | |||
b256c102e8 | |||
a3716fc491 | |||
14e276a11d | |||
fc85a63af4 | |||
f016a367b5 | |||
d41a90f0dd | |||
b4f24f90da | |||
9d751f4265 | |||
ff2c224254 | |||
1135b1acac | |||
30ffb30a97 | |||
e4a18a5c99 | |||
d1a10386c0 | |||
4d6ac4ade1 | |||
c2bfe489ea | |||
882952bba6 | |||
784f36921b | |||
b7dbdc133e | |||
02d06c464c | |||
cec2474295 | |||
6caa2f3fed | |||
3a01837561 | |||
ba4bdb335a | |||
ba236c4753 | |||
a204f7c1dd | |||
bacf9122de | |||
2fdc1eac94 | |||
5fd4391cd9 | |||
6991358428 | |||
b050fde276 | |||
32444c9851 | |||
b93dcc43ad | |||
6ff6ff1673 | |||
e1ff86820c | |||
7d22c361d1 | |||
951cccb6b0 | |||
438e425838 | |||
ddb5ad071e | |||
38060d986c | |||
8c74396459 | |||
a09d63e8f8 | |||
d74af9a73d | |||
60310693d3 | |||
5d08821c9b | |||
3316e40e7b | |||
dfe5985326 | |||
b27ad17c59 | |||
14b8b24e14 | |||
711fc5835f | |||
028be22dec | |||
3b5dc09285 | |||
8596e05df3 | |||
1aee8f53a7 | |||
a187d07807 | |||
3096dd9513 | |||
150b07f3ef | |||
ad7778e78d | |||
c8e776bbea | |||
c66dc8bf95 | |||
ea87b9c788 | |||
aa3378fd73 | |||
2cebf9b8a3 | |||
572aeacf5b | |||
b5592b0fb5 | |||
9adf35a444 | |||
39ff31e3e3 | |||
7e82ec6d70 | |||
f4d6a243cd | |||
31b5027b1e | |||
7750314058 | |||
16c134fc1e | |||
f00e81a976 | |||
32a4039f7c | |||
ba09bc32d3 | |||
d7195d5276 | |||
6a6fb8d41a | |||
c853adc760 | |||
ca041f2e0d | |||
87078d7a44 | |||
c300df5742 | |||
2ba56fda15 | |||
b444aa3a98 | |||
e8d883edba | |||
36b53d2cf0 | |||
2d4686a5f3 | |||
31861bd475 | |||
c3e163741f | |||
1c715bc889 | |||
35ef42246b | |||
cd3962ca32 | |||
da16c55427 | |||
bd8bacb6d5 | |||
0d393a5c92 | |||
136bb525a5 | |||
e85737d855 | |||
8882317080 | |||
5c02205a4f | |||
45f7e20233 | |||
b116e62f37 | |||
fa6282d0e2 | |||
80bdf04fde | |||
5d2c288721 | |||
3caa37fdf2 | |||
807efcbc46 | |||
03d1e3d3e8 | |||
664e2b4893 | |||
4cf36bf203 | |||
92f3728d80 | |||
29d3ae0b67 | |||
df91f7faac | |||
9a69ae2599 | |||
02321c35bc | |||
7c6316d824 | |||
776b0c4036 | |||
fa653a8859 | |||
b6b7db7327 | |||
d4b4303b8e | |||
102fb1a32f | |||
c77ba3ecf0 | |||
760f5f9469 | |||
0135e9c7f4 | |||
2426c256cc | |||
93eed08d14 | |||
5a164780d8 | |||
30989e4dbc | |||
967206c695 | |||
272d39c1d1 | |||
828abc8308 | |||
6455a6acc0 | |||
51cb03dc32 | |||
4d25a33cb0 | |||
e646207ed6 | |||
18b3f23c69 | |||
98dbb2e43f | |||
11e48b0181 | |||
3a07669e30 | |||
3e70f32555 | |||
b3d390076b | |||
80fbeeb415 | |||
8261ebd502 | |||
f75820fbd3 | |||
8b0d84a9a4 | |||
d582e43413 | |||
75082bc73f | |||
f7e9ee56d2 | |||
22af7f16ea | |||
9076d054b9 | |||
4eaa1a72b5 | |||
6f77e21e51 | |||
7910fea011 | |||
4c1ae8f3ce | |||
0733133510 | |||
8e0cde2949 | |||
423b7b276f | |||
cbd4a7cef4 | |||
391afe2814 | |||
68e3944bb8 | |||
2ee6ae16b2 | |||
8ce7425f73 | |||
1f63806c3f | |||
6cb822d56f | |||
9dee5acec6 | |||
ef85cb6195 | |||
dc8612fcd0 | |||
86c3cf648f | |||
37be1336fb | |||
3d7f80737b | |||
58a9321764 | |||
b600f387f0 | |||
2a97adbec6 | |||
853753a3da | |||
405bf9ce37 | |||
d5ea881729 | |||
391b9acd98 | |||
dda2d072aa | |||
3c1ba2397b | |||
adb3f35920 | |||
a58b8bf4bb | |||
99a26d65cf | |||
4915cf0120 | |||
66c5780616 | |||
e48b1d11ce | |||
ba91f23c50 | |||
ad4f303aa0 | |||
3b521f73bd | |||
27126b20bc | |||
68137aa789 | |||
2458eaa11b | |||
a97008aeeb | |||
a9b24f5e1f | |||
a9c4e77d1b | |||
dbe618c644 | |||
40f06e0b4c | |||
6aa21c1fae | |||
8015a961cb | |||
d2fa69bca6 | |||
d63182ecd5 | |||
145f2ae24f | |||
9c7e429b48 | |||
6f1366bd19 | |||
502d5977d7 | |||
353e19e746 | |||
12ab1ed144 | |||
11214caf77 | |||
c23b4576df | |||
a55bf00d0f | |||
49ed2cac4e | |||
44ef0bbc87 | |||
8f5b59c18c | |||
d06881783d | |||
da943b384c | |||
ad63af5096 | |||
09598f07bf | |||
ef7b30c1b8 | |||
5516db22c3 | |||
155add66bd | |||
39558cbabc | |||
4935c92b63 | |||
66f1f28646 | |||
48758bd5f0 | |||
2f26c80c88 | |||
be3ffc1f96 | |||
3509995756 | |||
88dc981f4b | |||
a65acbe43f | |||
6a1d6f13a2 | |||
71928443f3 | |||
10f366fe32 | |||
fcd82088a5 | |||
c9b6d9685c | |||
3069d77b74 | |||
b7367d8275 | |||
99ae4eb3c5 | |||
c7bf0c5c03 | |||
fd353225c2 | |||
ace682abbd | |||
b212b25a9e | |||
3c127afeb9 | |||
84eef1d747 | |||
8a0086397f | |||
75327f2242 | |||
81b41be750 | |||
6020f95e50 | |||
bc8a25d0da | |||
29e62a1e4f | |||
b12ec094c5 | |||
fea5e76b76 | |||
0cf5d25a7f | |||
977a8393f8 | |||
302fd93e86 | |||
70470ae8d2 | |||
425b39a762 | |||
206e3b57d1 | |||
a34bc3ef29 | |||
6350b7b9e4 | |||
04d06f2242 | |||
924049aa14 | |||
442427ebd5 | |||
7954c92c0b | |||
5afb14283a | |||
bfc541b880 | |||
426280f90c | |||
2e2c5ad72a | |||
ecb091af6b | |||
ecb882b719 | |||
cddd9c30db | |||
f6a4625495 | |||
550bd543e3 | |||
a6ff0274a9 | |||
841746210a | |||
156abda66a | |||
1619510dcf | |||
ff8dedd4ec | |||
637823c8ce | |||
01219be817 | |||
59e3afba03 | |||
db05322ba2 | |||
74e5c78b3f | |||
ea350f9d1d | |||
eda192639d | |||
0f16a018ff | |||
7ca74f48bc | |||
5837c2d5f0 | |||
e50b35d195 | |||
433b729c45 | |||
bb7f7d5e2a | |||
8c44425665 | |||
93e3f8946a | |||
95431639a0 | |||
3e3186cfeb | |||
2d13ad3d39 | |||
d7d0f5fca0 | |||
74ba6a96fc | |||
e1cb2f24f5 | |||
59e3ef7248 | |||
0b1c480729 | |||
90dc985657 | |||
b5456e1de7 | |||
976eebc2a2 | |||
f00c279366 | |||
b651d6f027 | |||
b63b62f6dc | |||
0f08c7c13a | |||
97f8093a8d | |||
9075ea189a | |||
c33f0995f9 | |||
e17da7dfd4 | |||
299f712cc9 | |||
f755a3c401 | |||
472bb479d4 | |||
61a24eab76 | |||
8b9521d5a5 | |||
818e1efd43 | |||
58f5380694 | |||
9d51291125 | |||
fefcca7805 | |||
5204f33d45 | |||
0041ea3050 | |||
f8a28b632c | |||
9c817cff68 | |||
521e8abf88 | |||
9fe03c7474 | |||
c3f10e7df3 | |||
1b8c51f45e | |||
1bb4c207f1 | |||
b6da2702a2 | |||
fb704b945d | |||
71d6f59d56 | |||
89136bc2e6 | |||
b6d94e000f | |||
bfcb7133cb | |||
7883792ccc | |||
def3668030 | |||
a77d2d56f6 | |||
7ee041403f | |||
53a400027f | |||
a2498acf7c | |||
28a1098c0f | |||
6ffaef35cf | |||
ff105ee203 | |||
56c0d7bd4d | |||
d00d31961e | |||
b2d3ef5f38 | |||
b2ac730572 | |||
3424d08d3a | |||
5dd9462bed | |||
402eb2b761 | |||
63d74eee68 | |||
166a27d094 | |||
4f06e2eb71 | |||
0b240ae7d1 | |||
6b0e5cd6f1 | |||
2463434d27 | |||
c09b9ac01c | |||
15a1cdde89 | |||
3a1da5ad36 | |||
67cb324aed | |||
8736fa8a52 | |||
cb4dab4250 | |||
c56916a8e0 | |||
93963d3915 | |||
e7c6f965b4 | |||
4f263ebb1a | |||
c15bdabf0c | |||
80a077c50a | |||
42d72c5303 | |||
74e3990604 | |||
e6e391ad6a | |||
12e5099c92 | |||
72afffbc8d | |||
627df20b6d | |||
640bc99661 | |||
bb43ef15fe | |||
7907652bc9 | |||
dce665b792 | |||
32bf684b17 | |||
e978bc8690 | |||
91503d3698 | |||
1721f6e9e2 | |||
c7b5aa9197 | |||
800c8e0a17 | |||
d771da9abf | |||
b36b92b247 | |||
aa51719a55 | |||
a28685536a | |||
400fd77d0a | |||
a2bf974058 | |||
7c442c9357 | |||
e17e0a81dd | |||
2488299d7b | |||
dfc09b8e04 | |||
6438baaddc | |||
8fc6c2ba52 | |||
95092edc93 | |||
c4b3e0672e | |||
e8e2b8ba39 | |||
2e40b91ec1 | |||
97d9228bed | |||
0f14865d56 | |||
c94ab2a39f | |||
ab89e055de | |||
ac6e3dba5a | |||
d9d2c4a219 | |||
1890a9378d | |||
ac88e6e190 | |||
15cbae8a19 | |||
aaf096d96d | |||
93f5acbffd | |||
9c717275d2 | |||
50a7c2fad6 | |||
95be6e721b | |||
dc2e012cc9 | |||
12c6282d14 | |||
0249772f01 | |||
5d699d5f47 | |||
34d79a5443 | |||
1e761e237a | |||
36ad132c82 | |||
c9055f391b | |||
99c95363b4 | |||
c90526bf07 | |||
97a6e72e10 | |||
f100caba81 | |||
80aa6ffe43 | |||
0694e58650 | |||
e644eeb5b6 | |||
5ddd9e02de | |||
a064f0b4fd | |||
b9dbcc30fa | |||
7ab34c7d2e | |||
17caa3c57b | |||
2e6361898b | |||
a1b2c0419f | |||
9b81e776fb | |||
7a4a7dece8 | |||
f0d3e8c3b9 | |||
ad68d9484f | |||
c3fd822857 | |||
e147f3a754 | |||
b694e7d3ab | |||
b2fff4c33f | |||
9c1060d9b0 | |||
a91652287b | |||
2cf44c236d | |||
243db9eda3 | |||
b675ba1f35 | |||
e9367ee85e | |||
d9b7928ce6 | |||
cdacae6697 | |||
2bd08cdc28 | |||
5fefabe3bd | |||
e281078441 | |||
9bb75f6f52 | |||
3b7a24456d | |||
c885d59270 | |||
9f30d54963 | |||
b247093495 | |||
9ca7b861a9 | |||
2eccf0dd05 | |||
566b957e65 | |||
a8456f4ca7 | |||
0f3098040d | |||
996075decc | |||
21539be3f2 | |||
c22f5c4b39 | |||
f4b47a9275 | |||
266b70d9d0 | |||
6e68ad6d15 | |||
848e798809 | |||
35f7ee9c59 | |||
c202551e6d | |||
5b7a025d26 | |||
26bcf83960 | |||
e4acff4f8d | |||
568ddf2390 | |||
ce91945544 | |||
11fed8d1b5 | |||
4c3bf25b8a | |||
215fc3677a | |||
4d3b6b882e | |||
83eda174af | |||
1c29cb890e | |||
438ebe5013 | |||
4335a2a0d1 | |||
825fd292ae | |||
80990c98c8 | |||
44d3a17870 | |||
54110f8358 | |||
522135adaf | |||
153b8dc6bb | |||
d1bc70ea06 | |||
df61e5cdd2 | |||
bf9a557868 | |||
537ffce4e0 | |||
b38a481b20 | |||
7e1d461882 | |||
c634d3696e | |||
0189e90fce | |||
dbd2136bac | |||
eb628c8e4f | |||
38cb20706f | |||
c730866efe | |||
d0e3c7c6d0 | |||
d9daf2c618 | |||
b1da599b5d | |||
b798368ba6 | |||
fa4868a26d | |||
6bf6c3f0f4 | |||
32e8cce527 | |||
c125c1a2c0 | |||
d311722cd0 | |||
1d51b28701 | |||
dc54eba8f8 | |||
a84fc396e8 | |||
8b57104f83 | |||
ff066f0c2a | |||
a64a84f2fe | |||
1f0a74f3d5 | |||
44739a17d0 | |||
464acd1a36 | |||
fe536252aa | |||
52be5ae889 | |||
24319e5c31 | |||
c44351507f | |||
052e426810 | |||
c577eb01ce | |||
263e88f6b3 | |||
4ab8a54a11 | |||
ad72ebd4bb | |||
e40c63b9e7 | |||
f927d26ce7 | |||
fe24c73c11 | |||
2475b2a82b | |||
4ccc629488 | |||
6782737009 | |||
4d3e188401 | |||
cd9cbfbd1e | |||
7dd7c13065 | |||
6be125db87 | |||
1c79ce70c9 | |||
db2997ef21 | |||
10c88f6e49 | |||
6d9d315ca7 | |||
973527cb84 | |||
0ff47fe3ea | |||
5fdc0aae66 | |||
d97257a5a9 | |||
279f051905 | |||
88ffd0f138 | |||
11618353ea | |||
e948bfd585 | |||
bdd513635f | |||
2bbebd811b | |||
3fb85664d2 | |||
b9ea9fba9a | |||
a0303969c2 | |||
fa78df3749 | |||
df5b7a008d | |||
80813b0406 | |||
e8d2f23b81 | |||
0e181133c1 | |||
8f27611911 | |||
b7b2e3c0aa | |||
2c8a337f26 | |||
c24e52d97d | |||
574f40949c | |||
cf3848fbd5 | |||
a19ad69038 | |||
d6f20e2756 | |||
e2fc20ca76 | |||
37c3f7109d | |||
99d5211a33 | |||
b97f143195 | |||
e8da4326b6 | |||
67f908aa8d | |||
65eb5c1b8b | |||
7d484c6e09 | |||
8252e13eb9 | |||
1a9b860e68 | |||
cede7d0f35 | |||
fe26d383f1 | |||
df4bc268dc | |||
e49da6c13f | |||
67b7262764 | |||
88528ef979 | |||
b6175b1ca9 | |||
aa20ebaa9c | |||
779e45c11b | |||
5d5a6eabaa | |||
03c9b53232 | |||
ebaded66b4 | |||
c232eb2478 | |||
7559cc6897 | |||
69d0d6d7ee | |||
3e9336b15d | |||
5c78ecc15d | |||
06db3f702d | |||
a2a82a96a6 | |||
a86bbae851 | |||
fac134dd95 | |||
515ae32160 | |||
df8f040795 | |||
64a23992f0 | |||
f5baff6e6b | |||
8bdd90a2a8 | |||
5536e97482 | |||
de47071256 | |||
87072cb690 | |||
d9565e9250 | |||
f80b568e67 | |||
7fed689f9a | |||
3f48df8f10 | |||
cc55092ca6 | |||
3331d9d01d | |||
62d80e6b76 | |||
7dc4d9cd22 | |||
8fb8ae1260 | |||
90304369f4 | |||
922456c46c | |||
eaeccd66ae | |||
7a43649c13 | |||
525bbf313e | |||
cfaebe9bf2 | |||
b57b7b2153 | |||
48bf368316 | |||
8f94ce86a0 | |||
10a9cf08f1 | |||
286d0d1794 | |||
95f6fa2731 | |||
1aeef81288 | |||
211ad6c8f5 | |||
468b20d227 | |||
f6bc42c2bc | |||
2c01b8ba76 | |||
4e1df8677f | |||
6953a12e2a | |||
1d0db89194 | |||
297f297d18 | |||
059205c378 | |||
f94e53ffb1 | |||
a4f1fdec5d | |||
75374eb154 | |||
3ad118c026 | |||
0bc6b1f1b3 | |||
4ea458e1a3 | |||
aacb172017 | |||
dbf768b1bd | |||
b96fcfc8ac | |||
18b4d26bee | |||
7f4b74e2d4 | |||
a8f8486cf4 | |||
a343e58e53 | |||
0892d69ba2 | |||
ba511b51c7 | |||
e090581913 | |||
aaa56caa9c | |||
c8db1e55dd | |||
58079393e6 | |||
0b44f2d897 | |||
2371619486 | |||
13a54b5dbe | |||
fa0861ff2e | |||
748aa5179f | |||
56a485bac6 | |||
9488de30e5 | |||
e3dfd16096 | |||
c230ccce86 | |||
db22a8e9c4 | |||
3a3358e2b4 | |||
248005e8e0 | |||
dae272ef66 | |||
2679c5898e | |||
efb7401e6d | |||
60a0f0c979 | |||
5d168d0e14 | |||
f964e34d8c | |||
021ba0b8e9 | |||
96d371546c | |||
e1780a4df0 | |||
e5e169a1e2 | |||
5eda498516 | |||
599b33e55f | |||
3a8332bdb3 | |||
44b5d9f6b9 | |||
24deff0e2d | |||
0933b48c2a | |||
71578e07ec | |||
671325dd17 | |||
53a3d06103 | |||
ad1989e45e | |||
f9ac98bc6d | |||
544ab0086b | |||
13bf80d372 | |||
e2fb922d73 | |||
a6cc85c437 | |||
d061be5d2b | |||
dc2feedd79 | |||
f8e4ba36e5 | |||
f3d5389587 | |||
d9ffb10b93 | |||
e63ad7c74b | |||
1186377b25 | |||
8616895e57 | |||
2cf5a22c85 | |||
763eb2df80 | |||
8bbf66a0fb | |||
676b46e4a7 | |||
82a119c67f | |||
6fd4389887 | |||
1e1a548459 | |||
8db9b53a8f | |||
ba33fd8277 | |||
8071feda18 | |||
a49b73cd01 | |||
8226493a9e | |||
38a8a0e8a1 | |||
ead6601394 | |||
e61ebd8d05 | |||
6eeca8b5d1 | |||
bf51ce4414 | |||
5ad614e251 | |||
93c890603d | |||
29fb4dfc2b | |||
7de9fd1d65 | |||
566c059832 | |||
0c9572f0a1 | |||
c99607c85a | |||
e2010bcd1a | |||
3bf1c59bd6 | |||
e9f1b55f51 | |||
4f5152f526 | |||
de9b53045a | |||
e59fe1aacf | |||
df458c5e7a | |||
e206554146 | |||
e422806c44 | |||
b6ddf144f4 | |||
86406ee59a | |||
81c5477f1d | |||
ac64350a5f | |||
333619f1e3 | |||
17dcb63c26 | |||
e04b90c9c0 | |||
1f1d74ba50 | |||
f62e1da01a | |||
2fe949629f | |||
20f2ddc11d | |||
004528a65c | |||
39c7bd40c2 | |||
43879e08f4 | |||
bb546fe43f | |||
5ed7aa6620 | |||
47750b6aad | |||
de7832eb8b | |||
52ea5bd0ab | |||
457d112df7 | |||
22cdec9d38 | |||
d72e502107 | |||
94055f0772 | |||
ede9323524 | |||
c45f428f61 | |||
b61ba02f3d | |||
9e1218547b | |||
715b88c09b | |||
ea4d91d2a0 | |||
7b9ef7d757 | |||
d64ed4ba5a | |||
22d524ac9d | |||
8584f6a1db | |||
08df96a149 | |||
cc3c0b5448 | |||
ffd864ed39 | |||
3c9c1b4cdc | |||
599883e684 | |||
f1b4db4f36 | |||
d4abb4b143 | |||
828ce66942 | |||
ccc2608cf6 | |||
de45de0e0b | |||
99c10aa1fc | |||
2a186e425b | |||
64bb206d85 | |||
2d6732d580 | |||
8f359adf9c | |||
1f09493ba2 | |||
115f352ade | |||
2af60c5c0d | |||
aab2817ddc | |||
f1c4752036 | |||
88735e3146 | |||
c373ed72d7 | |||
213cfe8c84 | |||
87ea5e14b4 | |||
2aa967aba9 | |||
d522e40594 | |||
3cd2b9a6c3 | |||
19e412a73a | |||
cf5f77c709 | |||
4811e3333f | |||
8257857075 | |||
e3e4e60fdb | |||
6ce9a94932 | |||
fa5d0ad316 | |||
6bff6b317d | |||
99ac8d4c52 | |||
019e1f80ca | |||
2fe98f3721 | |||
5c08363400 | |||
927326f715 | |||
53933dff7e | |||
f15c1344b0 | |||
fb48b330cc | |||
5dddf8b0ec | |||
0ecf7e3854 | |||
aae1092bac | |||
7158e507ad | |||
70f3390ffe | |||
392dfd024c | |||
87170ab460 | |||
ee4c044d27 | |||
0b09b8ee6f | |||
db95b3234f | |||
6d2dad5810 | |||
81ee3f759c | |||
ed606c28ab | |||
f15e07f7f5 | |||
cd14c3086d | |||
41184b82ee | |||
6a6f3914c0 | |||
840e31a693 | |||
1bc452c349 | |||
3fad6ed42c | |||
38f954ef17 | |||
abd1182303 | |||
efe70ab48e | |||
62c263bda3 | |||
4c1337b4c5 | |||
38f10d4cc6 | |||
1ad76800b0 | |||
cc97d7be6a | |||
f951cb372c | |||
37a3ab202a | |||
b148adc0af | |||
16828e975a | |||
7d26f41d64 | |||
f37f465ce4 | |||
b199215525 | |||
94699f3255 | |||
d3e98eb27e | |||
41012a9843 | |||
c83487a293 | |||
1fab4919c0 | |||
9dc0f28800 | |||
b57784d1a5 | |||
a80b31bf98 | |||
7c6d4666e9 | |||
76bb299c68 | |||
0c03accd41 | |||
b12eeb0eb7 | |||
8e634862ff | |||
1e1874d86b | |||
16624b90d3 | |||
ed14b656a8 | |||
1d0cf16254 | |||
84424f7f67 | |||
c95d9923f7 | |||
05b85da3f4 | |||
a4caba120c | |||
969a877a34 | |||
fb22a90d33 | |||
108bd3dfa0 | |||
5a445ae647 | |||
56668f58b6 | |||
eec96e5879 | |||
c6c9d877e4 | |||
61f4b998e1 | |||
25a319d884 | |||
4bf678fe6c | |||
359acd6bb9 | |||
2fce385691 | |||
a82c61c539 | |||
a8fa125a96 | |||
6435ced707 | |||
94dc0d176c | |||
23c21252e8 | |||
41c7dff0e8 | |||
e3bae562fc | |||
1c1668bfc3 | |||
e0c09c51f2 | |||
8de06fb862 | |||
64412868d8 | |||
450958c290 | |||
963fe11ad6 | |||
ce199e4b6b | |||
9d798893b5 | |||
64399e0717 | |||
f58e23b325 | |||
812e07b734 | |||
c9298fde76 | |||
0109454a34 | |||
813f703211 | |||
7aad747c25 | |||
d70a787af1 | |||
69bb0917ad | |||
90c5735904 | |||
6f256d09b2 | |||
e9684c2021 | |||
bf91a0e73f | |||
14b6309aef | |||
6391ced99f | |||
fac8a185ba | |||
c69aa8a42b | |||
f34bf22125 | |||
f0be913dc3 | |||
cd51788b98 | |||
3e0a911418 | |||
edd67b0da3 | |||
d733454d7f | |||
41f9a87e0e | |||
f4858f0c62 | |||
121093ae71 | |||
aa8fc313a9 | |||
723298a07b | |||
f8c89e3e95 | |||
333435a9c2 | |||
3ab2295fe7 | |||
c41bb657ac | |||
55bbf64f2b | |||
3bba65f2c2 | |||
1bab0d07b5 | |||
602353f4d9 | |||
51814249af | |||
37c5fbfe16 | |||
d7356726a1 | |||
4db6bf7a2e | |||
28826f6402 | |||
c845558d96 | |||
16c3a7d9e5 | |||
90d5b48845 | |||
d1acc4abb3 | |||
797b70998f | |||
4a01027da0 | |||
7ca2169790 | |||
054f522aa9 | |||
f2fc3f5ea5 | |||
765c01e83d | |||
33a11fb53a | |||
d1d41ca49a | |||
c06e0ee5e9 | |||
83f80ccc40 | |||
069065ea3a | |||
1672e78041 | |||
34401de3d0 | |||
afc969bac3 | |||
e1ff516219 | |||
f687b81b70 | |||
bbb11e611e | |||
90919411e9 | |||
1491b017a0 | |||
1655150092 | |||
ceb6c9a100 | |||
00bbce08fb | |||
91a4b86860 | |||
5aece6fa06 | |||
a70b94afe2 | |||
9ebc2719d3 | |||
b46aae1833 | |||
30e6a40865 | |||
403df36af6 | |||
8efa46aeab | |||
5ca769807e | |||
72a71a605b | |||
24d833a5d1 | |||
44b30380f7 | |||
261cd086c7 | |||
9e19b526b9 | |||
6c617a0ef1 | |||
a812650fea | |||
fec7a77d6f | |||
971e261067 | |||
27407ba021 | |||
ef8e58ede4 | |||
f13260c10a | |||
e1183d6049 | |||
f1b275aedc | |||
b647af256c | |||
d2e9ed3467 | |||
5b39986835 | |||
a97b08e8ea | |||
56d1be9447 | |||
a241cb5215 | |||
042b1a8294 | |||
6d79b8cd4c | |||
88d766aeae | |||
119b471b84 | |||
7f079e0ec3 | |||
46fe3eecff | |||
3061a701d5 | |||
e45109e1d7 | |||
e138e6d51e | |||
aef1363b04 | |||
766dd03d81 | |||
ab393651ec | |||
ffd265d0ae | |||
72155472dd | |||
9b7170834e | |||
3e57a87bf7 | |||
a15d1c9f1c | |||
a095a64f90 | |||
2374d6b1c4 | |||
5ed3ff9084 | |||
385be55510 | |||
3082d0d128 | |||
f7e242f054 | |||
2874505004 | |||
ed9e0c13d7 | |||
10be94fa99 | |||
ee79c46145 | |||
384010a2c0 | |||
1e47019122 | |||
536c65e82c | |||
cdf14932ec | |||
3b20dbd9fd | |||
e4d975af00 | |||
2782a00e7c | |||
91d192dd7c | |||
b1e3abc795 | |||
3395e8df90 | |||
cce143a7da | |||
d593005b32 | |||
7be9d5d4d3 | |||
d7141d5ed7 | |||
0d0ece94d3 | |||
1c06f6d06d | |||
dda8e30b92 | |||
c4e2e24643 | |||
e020a105a3 | |||
2b7fe9a4f9 | |||
951df64b7f | |||
0976afe282 | |||
7b1e4abda7 | |||
0cf75eed3f | |||
d96957d086 | |||
1a032ea498 | |||
5d079da1b8 | |||
9c1bc6ab08 | |||
3d2ba8c009 | |||
e872ce3f77 | |||
b77756da04 | |||
9b23e13ce8 | |||
5eafe9baff | |||
c251c94131 | |||
17041efc71 | |||
05b8e8a6e0 | |||
f998b996fa | |||
958b47c435 | |||
a27248d3b6 | |||
1b1f7be7ff | |||
59d4a27240 | |||
75e9f3c2e3 | |||
7132eccf50 | |||
e953c6398c | |||
bb7eea27e5 | |||
595c5e95bc | |||
43e6dcd41d | |||
b06c8ae43f | |||
c7ea13c0c7 | |||
0f8c6e147b | |||
e566365288 | |||
a06e0f5890 | |||
3bccc0da01 | |||
a0173d991e | |||
600f0eb8a3 | |||
5db73b1327 | |||
5cb1628cd8 | |||
c74b75e8e1 | |||
0538476d6f | |||
5ebe18d081 | |||
207adde36d | |||
1b13ddaa54 | |||
9981c349be | |||
b3365a7373 | |||
9a0c1c830d | |||
ef27ba16f4 | |||
e206edc1f6 | |||
c734bc4957 | |||
572b8a7aca | |||
eebae4a227 | |||
e0562752ea | |||
6a2ca534d2 | |||
7adc2bc6c8 | |||
ba8d7831a7 | |||
69ffcbad27 | |||
819f7d1080 | |||
409b588458 | |||
e90a603d57 | |||
6f061621ad | |||
0300610108 | |||
2fba5f152c | |||
317b08c703 | |||
e6db374a72 | |||
bfb550b8d0 | |||
174234c166 | |||
24b4220de5 | |||
f1895a4cce | |||
c2a6306d46 | |||
7ac732f45b | |||
c90f1bdf08 | |||
6a9be8d16b | |||
58c2c52c95 | |||
73a39769d4 | |||
7221e26eca | |||
98adb8e784 | |||
a59dcb2f53 | |||
d21b58e1c9 | |||
d6e84cbabb | |||
fcccf1d479 | |||
211db12a3d | |||
ab7f277a1b | |||
ce1d5a60d6 | |||
f67315e20c | |||
2150c44036 | |||
70c9fbdde3 | |||
f3ea31c515 | |||
1ee88cba16 | |||
af3ae75229 | |||
d76ef3ff91 | |||
2691c7c9d6 | |||
26b1d8ce8f | |||
6fae148fc1 | |||
bb51647fe2 | |||
71efbe7a92 | |||
afd695cb39 | |||
c4eb4c97ac | |||
d5a1a7ca1c | |||
8f7a8940f3 | |||
5e68f8c8dd | |||
b4e22e2e7b | |||
d4234da9aa | |||
1f53b27d4e | |||
cc128e6088 | |||
3c8acb4e9e | |||
ebf53d14b1 | |||
b298587c0b | |||
26e9aaceb8 | |||
384f3d6eda | |||
3aa5747c90 | |||
5671235fd9 | |||
1dd5c9efd9 | |||
5fad152cbf | |||
f33ca846f2 | |||
986c802acd | |||
98dd818bf6 | |||
021f6c8460 | |||
392f837398 | |||
6831c30534 | |||
ed6048034b | |||
8af312fe3c | |||
d87ada4f58 | |||
31c8166562 | |||
0cb2f95888 | |||
896ea7c689 | |||
1d1eb02bd7 | |||
3583165b30 | |||
d822f0c6bf | |||
9e52296dc6 | |||
12a7a4142c | |||
8348f79742 | |||
ec73d34bd3 | |||
1cef48d4f8 | |||
c24c05226d | |||
4b0005c28e | |||
8064405dbc | |||
22e8892993 | |||
cfc86bcb7c | |||
5f96ec6ac2 | |||
bbdf225d7b | |||
025fc1090b | |||
d9ec1d1b8e | |||
2e5d06ad85 | |||
bacd049eb0 | |||
6fd7b26bb2 | |||
1df79cf7f8 | |||
e6badacf0d | |||
a0d9d5eca8 | |||
8786377a75 | |||
f0322e8d94 | |||
3f2ac3fca0 | |||
9872207e87 | |||
58d942e737 | |||
dd190155c4 | |||
ebb3b83b27 | |||
79a43120ae | |||
2b36ab7ef5 | |||
eb38e0394d | |||
b79ffacd9c | |||
e14e2cfaff | |||
04119b27e6 | |||
92cb9e22e2 | |||
888c6773d0 | |||
cfd653f02a | |||
6b9106ddb1 | |||
838bd49a1d | |||
800e0dedfb | |||
965fc0b2f5 | |||
98ac98b4c2 | |||
178b0d8020 | |||
3bd1c1ff56 | |||
7d4bf91a35 | |||
ac3d1d1242 | |||
742018a716 | |||
a2ef691b4b | |||
9e0c406a4a | |||
f3df7aba15 | |||
6bc3592381 | |||
6864149989 | |||
aab53fa91f | |||
423f67b4f4 | |||
82f81f4f73 | |||
c8990bd379 | |||
e6cc4ba1f5 | |||
de54929bb7 | |||
fd77831303 | |||
cda574e627 | |||
fda1977119 | |||
f7bf0961cf | |||
61325bbad1 | |||
921cefd212 | |||
de6f0f1b77 | |||
7382553a78 | |||
4b82e89845 | |||
d3b31e595a | |||
f33bc5a5c6 | |||
f518ec108b | |||
edfc6cd475 | |||
92cd67effb | |||
da1e987444 | |||
2d4a166218 | |||
feae00224e | |||
000afdd300 | |||
0dc9681ae8 | |||
dc391c98c6 | |||
4b62a5c74d | |||
3f744ef63a | |||
5a244b7fed | |||
4dca4bf93c | |||
6984d6fb16 | |||
d7a1c44281 | |||
c64b8f6940 | |||
9c4b53d761 | |||
022b436c3f | |||
6058bb0245 | |||
3ade86537d | |||
d80be3b903 | |||
1a26681d87 | |||
9171297764 | |||
ebd1a52e5d | |||
743c84188e | |||
4879bea4a0 | |||
66917fd39b | |||
fd97607e55 | |||
f878581c8f | |||
f9602acf61 | |||
86a5724bdb | |||
63c963d726 | |||
88bfa35b99 | |||
bb66be98da | |||
c948e95ade | |||
1a5f4b1b9e | |||
3f41a0cf54 | |||
966ca1acc3 | |||
e2c7491ccd | |||
0ec0addbda | |||
fae4ca12e0 | |||
84505da84b | |||
2497e25b3c | |||
9c4b7e7094 | |||
3a9beaed59 | |||
1578525ee3 | |||
62c1b368cf | |||
f8ecea8fb7 | |||
0068710740 | |||
d206b8ab34 | |||
51c011b733 | |||
5fe477340b | |||
45df319823 | |||
6bebbe4153 | |||
374de800a4 | |||
60084a17f8 | |||
4d417d0396 | |||
e2d8bd2b73 | |||
1c693df00b | |||
8aaa932050 | |||
3cd6c2acf6 | |||
3930ebb339 | |||
b102714067 | |||
13d3037a53 | |||
1e7a60ee5c | |||
8d80f6b05d | |||
3c99357f06 | |||
597b3fe0db | |||
a757acad15 | |||
7913cf837f | |||
e98d356ede | |||
c9c20345c0 | |||
aca06be7ac | |||
550cc6a19b | |||
e44e93c117 | |||
a06a8150ef | |||
e787934ee6 | |||
be4b5ef4db | |||
55c5b8b07e | |||
a924d40620 | |||
0074e77a7c | |||
f3141690ee | |||
7ac5b0e18b | |||
d920de2a25 | |||
5abf7e9535 | |||
650ee2c18f | |||
069c8093ae | |||
1cc2930dc0 | |||
95734cf7cc | |||
3d50936b47 | |||
7234e2f5a3 | |||
dd9d5c8898 | |||
e06b689f5c | |||
71db66d802 | |||
959b5a20e3 | |||
9de5c0cf39 | |||
1a3868a6c6 | |||
378aa159b8 | |||
6876a9163d | |||
34d28a69ad | |||
0715d3ae67 | |||
542095f5eb | |||
57517a9dcc | |||
751708ff23 | |||
fcf944788a | |||
36a84c5c2d | |||
4392abfc49 | |||
3238b6a36a | |||
18a5edef0e | |||
1b3a6b340d | |||
b3759e966d | |||
34172b9aee | |||
02cb093f7b | |||
d6977473b1 | |||
15cffad89e | |||
a21ffe983c | |||
0d96601d1a | |||
9fb79f29fd | |||
032d73408f | |||
7959297a98 | |||
6dd010ea34 | |||
f89ddb2f1b | |||
2e5cc272e3 | |||
ebd13c63e8 | |||
ec091266aa | |||
ad105877ed | |||
c84f666b55 | |||
72412d26a5 | |||
bf02c69daa | |||
2bba1f30e2 | |||
01f50f03f1 | |||
f50f0eb63d | |||
2196665495 | |||
0148c76c30 | |||
3fe0c7c84b | |||
18b2cbb2e9 | |||
f6a7555a1d | |||
f7144dc0cb | |||
a9957211f4 | |||
7b60e473fa | |||
b114a6f42e | |||
dfc516baf6 | |||
b0d3bcd15a | |||
03c3960e93 | |||
d0ceefe827 | |||
e756664750 | |||
21f444ed61 | |||
40b4f8e840 | |||
bc61dac4c5 | |||
3605989226 | |||
a49d77afab | |||
7daa08c32f | |||
aaab9ad082 | |||
86c9004183 | |||
857dfe838c | |||
6828bc00f8 | |||
e1a19faf26 | |||
e95c81cc5b | |||
f3bda17fa0 | |||
c0eee58732 | |||
bcf88cd024 | |||
966c3d875d | |||
fe9383bed5 | |||
2c31770030 | |||
8d3e160166 | |||
408cfe5b97 | |||
279fee3595 | |||
28dddfcff2 | |||
9e2580ec6a | |||
aba5a9dc0e | |||
d27a0b3855 | |||
a575aa25ac | |||
9999828505 | |||
b04301c211 | |||
97157efcfa | |||
3756476809 | |||
b3d798eeee | |||
b499622eb8 | |||
04b8d0bac8 | |||
8ea4cbd942 | |||
7889ae1126 | |||
897d49ad87 | |||
1960d35d8b | |||
0b7d0dedf6 | |||
948e2cc66c | |||
396b816a1f | |||
0a58cbfd59 | |||
bbe4b7e565 | |||
2ecca2cbe3 | |||
f5d80fa888 | |||
f2bbe4eb12 | |||
60e51b7077 | |||
01d1ac9ab9 | |||
9b2396f5ff | |||
da15980b8a | |||
452678867f | |||
ff2d27f8e5 | |||
546cdaad92 | |||
5d38497f07 | |||
808a3af3cf | |||
889712761a | |||
46fab972a0 | |||
535c046b62 | |||
55dfab8394 | |||
18bf4d84b9 | |||
ef1d73df15 | |||
684107da5c | |||
2a97a9a9c5 | |||
ca12343b16 | |||
a974fbf31c | |||
6eaf33ec6c | |||
33fef7faee | |||
b083bf4297 | |||
4957e4d80c | |||
605f8a8249 | |||
7490a7e7f3 | |||
f32527feb4 | |||
ebc7ed538a | |||
a60868bfe8 | |||
4a2866d05f | |||
1a05f352c7 | |||
ba27de0669 | |||
e21e7054ce | |||
bc323e905c | |||
afa1fe9d5f | |||
2444efc834 | |||
7b6257ff20 | |||
13973125fb | |||
ddf9104349 | |||
47b53fffb4 | |||
9ba3753f80 | |||
a353194fe1 | |||
c205c47509 | |||
9c867edfbc | |||
9919d80782 | |||
a971850d26 | |||
8464ffe6ad | |||
6537225c61 | |||
dcbf59bd89 | |||
21d478d396 | |||
054c243416 | |||
d57e453541 | |||
3f45ef4908 | |||
1fd742464d | |||
382397407f | |||
82809235b9 | |||
7d5c507f16 | |||
bc139f16a7 | |||
f6f3284dc5 | |||
f4d2f1856f | |||
871e19ed92 | |||
9c599884a8 | |||
cbef45841c | |||
96d9f302c2 | |||
afcdf17a72 | |||
1bcdbe4c00 | |||
45c0ded88c | |||
ea30ad9494 | |||
7608615702 | |||
cc5f37392f | |||
413fcbcb8c | |||
c49d0a99e4 | |||
5a0cb9289c | |||
72998c4c41 | |||
da48be495b | |||
c843ed3460 | |||
4232aa9ea4 | |||
f6612fa78c | |||
bce1d983cb | |||
047fc43f8f | |||
96ae866baa | |||
0cbfc9252c | |||
d02e57bdb3 | |||
a1d5bccac2 | |||
a9bb8afca4 | |||
28cd92b708 | |||
a44c7ecc3a | |||
663c1fb627 | |||
a7969b8e9e | |||
4ca3f030cc | |||
5214c5d55d | |||
3e6ed7b69b | |||
7d2a8d343a | |||
03aacf483f | |||
02bc8c8445 | |||
7965b82cca | |||
bae04a492a | |||
73a1391f2f | |||
660ff0434d | |||
94208dce76 | |||
efe54fbba4 | |||
10561d6c83 | |||
72404e77e5 | |||
0ef87f93a6 | |||
c7310c21fb | |||
ed9e27b64f | |||
801ed63be5 | |||
2aa9b267ab | |||
90338d9600 | |||
5cecf16d4f | |||
a3ed309342 | |||
08b4c09b89 | |||
a509a5e1bc | |||
bec10e7836 | |||
f9a184800b | |||
f428c3ff8b | |||
97eb40a8e3 | |||
8211631950 | |||
a17cbb0e8b | |||
21a30f1b6f | |||
613c45ede9 | |||
8743c6a08d | |||
8098be6f93 | |||
eba0831538 | |||
1c73c9fbfe | |||
1ad103c29f | |||
ca37b4c9ac | |||
d3bbf09d12 | |||
f608317eec | |||
c8b9c9bcaa | |||
d638cdcdd3 | |||
46f82a4af3 | |||
978606edb4 | |||
42a2642d40 | |||
37840c3844 | |||
28335ef3d8 | |||
78ec5b3322 | |||
ac7e1ab299 | |||
ea60fd0f45 | |||
c291e8c5d9 | |||
f0ac542a7f | |||
a412085785 | |||
435b5c74bf | |||
15fd7041ab | |||
1ced6b4d67 | |||
6694c1e6cf | |||
19ca906e50 | |||
12e94775d6 | |||
df7f52d885 | |||
d5b5faafbb | |||
a318e8588b | |||
51fb252cd8 | |||
86b2f61b56 | |||
232a9fe868 | |||
e8bfe73b1d | |||
ab0d762675 | |||
a6a314e011 | |||
514bdff92e | |||
745e56a3a3 | |||
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 |
10
.editorconfig
Normal file
10
.editorconfig
Normal file
@ -0,0 +1,10 @@
|
||||
# See editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
18
.eslintrc
Normal file
18
.eslintrc
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"extends": ["@sampotts/eslint-config/es6"],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"globals": {
|
||||
"Plyr": false,
|
||||
"jQuery": false
|
||||
},
|
||||
"rules": {
|
||||
"import/no-cycle": "warn"
|
||||
},
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
5
.github/FUNDING.yml
vendored
Normal file
5
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: sampotts
|
||||
patreon: plyr
|
||||
open_collective: plyr
|
55
.github/ISSUE_TEMPLATE/bug.md
vendored
Normal file
55
.github/ISSUE_TEMPLATE/bug.md
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report an issue or unexpected behaviour with Plyr
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
Before creating the issue, please make sure that...
|
||||
|
||||
* You aren't getting any errors in your own code, causing the problem.
|
||||
* You are using the latest version of Plyr.
|
||||
* There isn't already an open issue for your problem.
|
||||
* You are following the documentation correctly (https://github.com/sampotts/plyr/)
|
||||
* Your problem doesn't happen if you remove Plyr and use native HTML5 media (when applicable).
|
||||
|
||||
For problems with autoplay, see our FAQ (https://github.com/sampotts/plyr/wiki/FAQ)
|
||||
|
||||
If you have multiple unrelated problems, create separate issues rather than combining them into one.
|
||||
|
||||
Note that leaving sections blank or being vague will make it difficult for us to troubleshoot and we may close the issue.
|
||||
-->
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
### Environment
|
||||
|
||||
- Browser:
|
||||
- Version:
|
||||
- Operating System:
|
||||
- Version:
|
||||
|
||||
### Console errors (if any)
|
||||
|
||||
### Link to where the bug is happening
|
||||
|
||||
<!--
|
||||
This link can be either to our demo at https://plyr.io/ if the problem can be observed there, or to a code playground with a **minimal** test case that demonstrates the problem.
|
||||
|
||||
You can use one of our prepared templates to get started creating the test case:
|
||||
|
||||
* HTML5 video: https://codepen.io/pen?template=bKeqpr
|
||||
* HTML5 audio: https://codepen.io/pen?template=rKLywR
|
||||
* YouTube: https://codepen.io/pen?template=GGqbbJ
|
||||
* Vimeo: https://codepen.io/pen?template=bKeXNq
|
||||
* Dash.js integration: https://codepen.io/pen?template=zaBgBy
|
||||
* Hls.js integration: https://codepen.io/pen?template=oyLKQb
|
||||
* Shaka Player integration: https://codepen.io/pen?template=ZRpzZO
|
||||
|
||||
It's important that you keep the issue description and replication demo **minimal**. If your replication includes frameworks, libraries or customizations, this makes it much harder to understand the problem and find the bug. For more help on how to create the demo, see https://github.com/sampotts/plyr/wiki/Writing-helpful-issue-descriptions
|
||||
|
||||
-->
|
10
.github/ISSUE_TEMPLATE/feature.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/feature.md
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
name: New feature
|
||||
about: Request new functionality
|
||||
---
|
||||
|
||||
<!--
|
||||
Please describe the behaviour that you want to add, and why. Be as clear as possible to avoid confusion.
|
||||
|
||||
If you want to request multiple features that aren't directly related, then create one issue per feature.
|
||||
-->
|
10
.github/ISSUE_TEMPLATE/improvement.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/improvement.md
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Improvement
|
||||
about: Request a change that isn't a bug or new feature
|
||||
---
|
||||
|
||||
<!--
|
||||
Please describe the behaviour that you want to change, and why. Be as clear as possible to avoid confusion.
|
||||
|
||||
If you want to request multiple changes that aren't directly related, then create one issue per change.
|
||||
-->
|
3
.github/issue_template.md
vendored
Normal file
3
.github/issue_template.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
PLEASE USE OUR SPECIFIC ISSUE TEMPLATES for bug reports, features and improvement suggestions.
|
||||
|
||||
Our issue tracker is not for support questions. If you need help, follow our support instructions: https://github.com/sampotts/plyr/blob/master/CONTRIBUTING.md#support
|
3
.github/pull_request_template.md
vendored
Normal file
3
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
### Link to related issue (if applicable)
|
||||
|
||||
### Summary of proposed changes
|
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,7 +1,9 @@
|
||||
node_modules
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
.DS_Store
|
||||
aws.json
|
||||
docs/index.dev.html
|
||||
*.mp4
|
||||
credentials.json
|
||||
*.mp4
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
*.webm
|
||||
.idea/
|
||||
dist/
|
||||
|
6
.gitpod.yml
Normal file
6
.gitpod.yml
Normal file
@ -0,0 +1,6 @@
|
||||
tasks:
|
||||
- before: npm install && npm i gulp -g
|
||||
command: gulp
|
||||
ports:
|
||||
- port: 3000
|
||||
onOpen: open-preview
|
56
.jshintrc
56
.jshintrc
@ -1,56 +0,0 @@
|
||||
{
|
||||
// Settings
|
||||
"passfail" : false, // Stop on first error.
|
||||
"maxerr" : 100, // Maximum error before stopping.
|
||||
|
||||
// Predefined globals whom JSHint will ignore.
|
||||
"browser" : true, // Standard browser globals e.g. `window`, `document`.
|
||||
"node" : false,
|
||||
"rhino" : false,
|
||||
"couch" : false,
|
||||
"wsh" : true, // Windows Scripting Host.
|
||||
"jquery" : true,
|
||||
"predef" : [ "jQuery", "$" ],
|
||||
|
||||
// Development.
|
||||
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
||||
|
||||
// ECMAScript 5.
|
||||
"strict" : false, // Require `use strict` pragma in every file.
|
||||
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
|
||||
|
||||
// The Good Parts.
|
||||
"asi" : true, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
||||
"laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
||||
"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. `===`.
|
||||
"eqnull" : false, // Tolerate use of `== null`.
|
||||
"evil" : false, // Tolerate use of `eval`.
|
||||
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
|
||||
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||
"latedef" : false, // Prohipit variable use before definition.
|
||||
"loopfunc" : true, // Allow functions to be defined within loops.
|
||||
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
|
||||
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
|
||||
"scripturl" : true, // Tolerate script-targeted URLs.
|
||||
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
||||
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
||||
"undef" : true, // Require all non-global variables be declared before they are used.
|
||||
|
||||
// Personal styling preferences.
|
||||
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||
"noempty" : true, // Prohibit use of empty blocks.
|
||||
"nonew" : true, // Prohibit use of constructors for side-effects.
|
||||
"nomen" : true, // Prohibit use of initial or trailing underbars in names.
|
||||
"onevar" : false, // Allow only one `var` statement per function.
|
||||
"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
|
||||
}
|
1
.node-version
Normal file
1
.node-version
Normal file
@ -0,0 +1 @@
|
||||
19.7.0
|
12
.npmignore
Normal file
12
.npmignore
Normal file
@ -0,0 +1,12 @@
|
||||
demo
|
||||
.github
|
||||
.vscode
|
||||
*.code-workspace
|
||||
build.json
|
||||
credentials.json
|
||||
deploy.json
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
*.webm
|
||||
*.mp4
|
||||
!dist/blank.mp4
|
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 120
|
||||
}
|
5
.stickler.yml
Normal file
5
.stickler.yml
Normal file
@ -0,0 +1,5 @@
|
||||
linters:
|
||||
eslint:
|
||||
files:
|
||||
ignore:
|
||||
- 'node_modules/*'
|
23
.stylelintrc.json
Normal file
23
.stylelintrc.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"plugins": ["stylelint-selector-bem-pattern"],
|
||||
"extends": ["stylelint-config-sass-guidelines", "stylelint-config-prettier"],
|
||||
"customSyntax": "postcss-scss",
|
||||
"rules": {
|
||||
"selector-class-pattern": null,
|
||||
"selector-no-qualifying-type": [
|
||||
true,
|
||||
{
|
||||
"ignore": ["attribute", "class"]
|
||||
}
|
||||
],
|
||||
"max-nesting-depth": 4,
|
||||
"plugin/selector-bem-pattern": {
|
||||
"preset": "bem",
|
||||
"componentName": "(([a-z0-9]+(?!-$)-?)+)",
|
||||
"componentSelectors": {
|
||||
"initial": "\\.{componentName}(((__|--)(([a-z0-9\\[\\]'=]+(?!-$)-?)+))+)?$"
|
||||
},
|
||||
"ignoreSelectors": [".*\\.has-.*", ".*\\.is-.*"]
|
||||
}
|
||||
}
|
||||
}
|
12
.vscode/extensions.json
vendored
Normal file
12
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"wayou.vscode-todo-highlight",
|
||||
"wix.vscode-import-cost",
|
||||
"stylelint.vscode-stylelint",
|
||||
"pflannery.vscode-versionlens"
|
||||
]
|
||||
}
|
15
.vscode/launch.json
vendored
Normal file
15
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch Chrome against localhost",
|
||||
"url": "http://localhost/dev/plyr/demo",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
1
.vscode/settings.json
vendored
Normal file
1
.vscode/settings.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{}
|
1330
CHANGELOG.md
Normal file
1330
CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
54
CONTRIBUTING.md
Normal file
54
CONTRIBUTING.md
Normal file
@ -0,0 +1,54 @@
|
||||
# Contributing
|
||||
|
||||
We welcome bug reports, feature requests and pull requests. If you want to help us out, please follow these guidelines, in order to avoid redundant work.
|
||||
|
||||
## Support
|
||||
|
||||
Before asking questions, read our [documentation](https://github.com/sampotts/plyr) and [FAQ](https://github.com/sampotts/plyr/wiki/FAQ).
|
||||
|
||||
If these doesn't answer your question
|
||||
|
||||
- Use [Stack Overflow](https://stackoverflow.com/) for questions that doesn't directly involve Plyr. This includes for example how to use Javascript, CSS or HTML5 media in general, and how to use other frameworks, libraries and technology.
|
||||
- Use [our Slack](https://bit.ly/plyr-chat) if you need help using Plyr or have questions about Plyr.
|
||||
|
||||
## Commenting
|
||||
|
||||
When commenting, keep a civil tone and stay on topic. Don't ask for [support](#support), or post "+1" or "I agree" type of comments. Use the emojis instead.
|
||||
|
||||
Asking for the status on issues is discouraged. Unless someone has explicitly said in an issue that it's work in progress, most likely that means no one is working on it. We have a lot to do, and it may not be a top priority for us.
|
||||
|
||||
We _may_ moderate discussions. We do this to avoid threads being "hijacked", to avoid confusion in case the content is misleading or outdated, and to avoid bothering people with github notifications.
|
||||
|
||||
## Creating issues
|
||||
|
||||
Please follow the instructions in our issue templates. Don't use github issues to ask for [support](#support).
|
||||
|
||||
## Contributing features and documentation
|
||||
|
||||
- If you want to add a feature or make critical changes, you may want to ensure that this is something we also want (so you don't waste your time). Ask us about this in the corresponding issue if there is one, or on [our Slack](https://bit.ly/plyr-chat) otherwise.
|
||||
|
||||
- Fork Plyr, and create a new branch in your fork, based on the **develop** branch
|
||||
|
||||
- To test locally, you can use the demo site. First make sure you have installed the dependencies with `npm install` or `yarn`. Run `gulp` to build and it will run a local web server for development and watch for any changes.
|
||||
|
||||
### Online one-click setup for contributing
|
||||
|
||||
You can use Gitpod (a free online VS Code-like IDE) for contributing. With a single click it will launch a workspace and automatically:
|
||||
|
||||
- clone the plyr repo.
|
||||
- install the dependencies with `yarn install` in root directory and "demo" directory.
|
||||
- run `gulp` in root directory to start the dev server.
|
||||
|
||||
So that you can start straight away.
|
||||
|
||||
[](https://gitpod.io/from-referrer/)
|
||||
|
||||
- Develop and test your modifications.
|
||||
|
||||
- Preferably commit your changes as independent logical chunks, with meaningful messages. Make sure you do not commit unnecessary files or changes, such as the build output, or logging and breakpoints you added for testing.
|
||||
|
||||
- If your modifications changes the documented behavior or add new features, document these changes in [README.md](README.md).
|
||||
|
||||
- When finished, push the changes to your GitHub repository and send a pull request. Describe what your PR does.
|
||||
|
||||
- If the Travis build fails, or if you get a code review with change requests, you can fix these by pushing new or rebased commits to the branch.
|
154
CONTROLS.md
Normal file
154
CONTROLS.md
Normal file
@ -0,0 +1,154 @@
|
||||
# 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. You can pass the following to the `controls` option:
|
||||
|
||||
- `Array` of options (this builds the default controls based on your choices)
|
||||
- `Element` with the controls
|
||||
- `String` containing the desired HTML
|
||||
- `false` (or empty string or array) to disable all controls
|
||||
- `Function` that will be executed and should return one of the above
|
||||
|
||||
## Using default controls
|
||||
|
||||
If you want to use the standard controls as they are, you don't need to pass any options. If you want to turn on off controls, here's the full list:
|
||||
|
||||
```javascript
|
||||
controls: [
|
||||
'play-large', // The large play button in the center
|
||||
'restart', // Restart playback
|
||||
'rewind', // Rewind by the seek time (default 10 seconds)
|
||||
'play', // Play/pause playback
|
||||
'fast-forward', // Fast forward by the seek time (default 10 seconds)
|
||||
'progress', // The progress bar and scrubber for playback and buffering
|
||||
'current-time', // The current time of playback
|
||||
'duration', // The full duration of the media
|
||||
'mute', // Toggle mute
|
||||
'volume', // Volume control
|
||||
'captions', // Toggle captions
|
||||
'settings', // Settings menu
|
||||
'pip', // Picture-in-picture (currently Safari only)
|
||||
'airplay', // Airplay (currently Safari only)
|
||||
'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
|
||||
'fullscreen', // Toggle fullscreen
|
||||
];
|
||||
```
|
||||
|
||||
### Internationalization using default controls
|
||||
|
||||
You can provide an `i18n` object as one of your options when initializing the plugin which we be used when rendering the controls.
|
||||
|
||||
#### Example
|
||||
|
||||
```javascript
|
||||
i18n: {
|
||||
restart: 'Restart',
|
||||
rewind: 'Rewind {seektime} secs',
|
||||
play: 'Play',
|
||||
pause: 'Pause',
|
||||
fastForward: 'Forward {seektime} secs',
|
||||
seek: 'Seek',
|
||||
played: 'Played',
|
||||
buffered: 'Buffered',
|
||||
currentTime: 'Current time',
|
||||
duration: 'Duration',
|
||||
volume: 'Volume',
|
||||
mute: 'Mute',
|
||||
unmute: 'Unmute',
|
||||
enableCaptions: 'Enable captions',
|
||||
disableCaptions: 'Disable captions',
|
||||
enterFullscreen: 'Enter fullscreen',
|
||||
exitFullscreen: 'Exit fullscreen',
|
||||
frameTitle: 'Player for {title}',
|
||||
captions: 'Captions',
|
||||
settings: 'Settings',
|
||||
speed: 'Speed',
|
||||
normal: 'Normal',
|
||||
quality: 'Quality',
|
||||
loop: 'Loop',
|
||||
start: 'Start',
|
||||
end: 'End',
|
||||
all: 'All',
|
||||
reset: 'Reset',
|
||||
disabled: 'Disabled',
|
||||
advertisement: 'Ad',
|
||||
}
|
||||
```
|
||||
|
||||
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 as a `String` or your `Function` return for the controls using the `controls` option.
|
||||
|
||||
The classes and data attributes used in your template should match the `selectors` option if you change any.
|
||||
|
||||
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
|
||||
- `{title}` - the title of your media, if specified
|
||||
|
||||
### Limitations
|
||||
|
||||
- Currently the settings menus are not supported with custom controls HTML
|
||||
- AirPlay and PiP buttons can be added but you will have to manage feature detection
|
||||
|
||||
### Example
|
||||
|
||||
Here's an example of custom controls markup (this is just all default controls shown).
|
||||
|
||||
```javascript
|
||||
const controls = `
|
||||
<div class="plyr__controls">
|
||||
<button type="button" class="plyr__control" data-plyr="restart">
|
||||
<svg role="presentation"><use xlink:href="#plyr-restart"></use></svg>
|
||||
<span class="plyr__tooltip" role="tooltip">Restart</span>
|
||||
</button>
|
||||
<button type="button" class="plyr__control" data-plyr="rewind">
|
||||
<svg role="presentation"><use xlink:href="#plyr-rewind"></use></svg>
|
||||
<span class="plyr__tooltip" role="tooltip">Rewind {seektime} secs</span>
|
||||
</button>
|
||||
<button type="button" class="plyr__control" aria-label="Play, {title}" data-plyr="play">
|
||||
<svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-pause"></use></svg>
|
||||
<svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-play"></use></svg>
|
||||
<span class="label--pressed plyr__tooltip" role="tooltip">Pause</span>
|
||||
<span class="label--not-pressed plyr__tooltip" role="tooltip">Play</span>
|
||||
</button>
|
||||
<button type="button" class="plyr__control" data-plyr="fast-forward">
|
||||
<svg role="presentation"><use xlink:href="#plyr-fast-forward"></use></svg>
|
||||
<span class="plyr__tooltip" role="tooltip">Forward {seektime} secs</span>
|
||||
</button>
|
||||
<div class="plyr__progress">
|
||||
<input data-plyr="seek" type="range" min="0" max="100" step="0.01" value="0" aria-label="Seek">
|
||||
<progress class="plyr__progress__buffer" min="0" max="100" value="0">% buffered</progress>
|
||||
<span role="tooltip" class="plyr__tooltip">00:00</span>
|
||||
</div>
|
||||
<div class="plyr__time plyr__time--current" aria-label="Current time">00:00</div>
|
||||
<div class="plyr__time plyr__time--duration" aria-label="Duration">00:00</div>
|
||||
<button type="button" class="plyr__control" aria-label="Mute" data-plyr="mute">
|
||||
<svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-muted"></use></svg>
|
||||
<svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-volume"></use></svg>
|
||||
<span class="label--pressed plyr__tooltip" role="tooltip">Unmute</span>
|
||||
<span class="label--not-pressed plyr__tooltip" role="tooltip">Mute</span>
|
||||
</button>
|
||||
<div class="plyr__volume">
|
||||
<input data-plyr="volume" type="range" min="0" max="1" step="0.05" value="1" autocomplete="off" aria-label="Volume">
|
||||
</div>
|
||||
<button type="button" class="plyr__control" data-plyr="captions">
|
||||
<svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-captions-on"></use></svg>
|
||||
<svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-captions-off"></use></svg>
|
||||
<span class="label--pressed plyr__tooltip" role="tooltip">Disable captions</span>
|
||||
<span class="label--not-pressed plyr__tooltip" role="tooltip">Enable captions</span>
|
||||
</button>
|
||||
<button type="button" class="plyr__control" data-plyr="fullscreen">
|
||||
<svg class="icon--pressed" role="presentation"><use xlink:href="#plyr-exit-fullscreen"></use></svg>
|
||||
<svg class="icon--not-pressed" role="presentation"><use xlink:href="#plyr-enter-fullscreen"></use></svg>
|
||||
<span class="label--pressed plyr__tooltip" role="tooltip">Exit fullscreen</span>
|
||||
<span class="label--not-pressed plyr__tooltip" role="tooltip">Enter fullscreen</span>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Setup the player
|
||||
const player = new Plyr('#player', { controls });
|
||||
```
|
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Selz.com
|
||||
Copyright (c) 2017 Sam Potts
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
900
README.md
Normal file
900
README.md
Normal file
@ -0,0 +1,900 @@
|
||||
| 🎉 | [Plyr is merging into Vidstack](https://github.com/sampotts/plyr/issues/2408) | 🎉 |
|
||||
| :-: | :---------------------------------------------------------------------------: | :-- |
|
||||
|
||||
Plyr is a simple, lightweight, accessible and customizable HTML5, YouTube and Vimeo media player that supports [_modern_](#browser-support) browsers.
|
||||
|
||||
[Checkout the demo](https://plyr.io) - [Donate](#donate) - [Slack](https://bit.ly/plyr--chat)
|
||||
|
||||
[](https://badge.fury.io/js/plyr) [](https://gitpod.io/#https://github.com/sampotts/plyr) [](https://opencollective.com/plyr)
|
||||
|
||||
[](https://plyr.io)
|
||||
|
||||
# Features
|
||||
|
||||
- 📼 **HTML Video & Audio, YouTube & Vimeo** - support for the major formats
|
||||
- 💪 **Accessible** - full support for VTT captions and screen readers
|
||||
- 🔧 **[Customizable](#html)** - make the player look how you want with the markup you want
|
||||
- 😎 **Clean HTML** - uses the _right_ elements. `<input type="range">` for volume and `<progress>` for progress and well, `<button>`s for buttons. There's no
|
||||
`<span>` or `<a href="#">` button hacks
|
||||
- 📱 **Responsive** - works with any screen size
|
||||
- 💵 **[Monetization](#ads)** - make money from your videos
|
||||
- 📹 **[Streaming](#demos)** - support for hls.js, Shaka and dash.js streaming playback
|
||||
- 🎛 **[API](#api)** - toggle playback, volume, seeking, and more through a standardized API
|
||||
- 🎤 **[Events](#events)** - no messing around with Vimeo and YouTube APIs, all events are standardized across formats
|
||||
- 🔎 **[Fullscreen](#fullscreen)** - supports native fullscreen with fallback to "full window" modes
|
||||
- ⌨️ **[Shortcuts](#shortcuts)** - supports keyboard shortcuts
|
||||
- 🖥 **Picture-in-Picture** - supports picture-in-picture mode
|
||||
- 📱 **Playsinline** - supports the `playsinline` attribute
|
||||
- 🏎 **Speed controls** - adjust speed on the fly
|
||||
- 📖 **Multiple captions** - support for multiple caption tracks
|
||||
- 🌎 **i18n support** - support for internationalization of controls
|
||||
- 👌 **[Preview thumbnails](#preview-thumbnails)** - support for displaying preview thumbnails
|
||||
- 🤟 **No frameworks** - written in "vanilla" ES6 JavaScript, no jQuery required
|
||||
- 💁♀️ **Sass** - to include in your build processes
|
||||
|
||||
## Demos
|
||||
|
||||
You can try Plyr in Codepen using our minimal templates: [HTML5 video](https://codepen.io/pen?template=bKeqpr), [HTML5 audio](https://codepen.io/pen?template=rKLywR), [YouTube](https://codepen.io/pen?template=GGqbbJ), [Vimeo](https://codepen.io/pen?template=bKeXNq). For Streaming we also have example integrations with: [Dash.js](https://codepen.io/pen?template=GRoogML), [Hls.js](https://codepen.io/pen?template=oyLKQb) and [Shaka Player](https://codepen.io/pen?template=ZRpzZO)
|
||||
|
||||
# Quick setup
|
||||
|
||||
## HTML
|
||||
|
||||
Plyr extends upon the standard [HTML5 media element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) markup so that's all you need for those types.
|
||||
|
||||
### HTML5 Video
|
||||
|
||||
```html
|
||||
<video id="player" playsinline controls data-poster="/path/to/poster.jpg">
|
||||
<source src="/path/to/video.mp4" type="video/mp4" />
|
||||
<source src="/path/to/video.webm" type="video/webm" />
|
||||
|
||||
<!-- Captions are optional -->
|
||||
<track kind="captions" label="English captions" src="/path/to/captions.vtt" srclang="en" default />
|
||||
</video>
|
||||
```
|
||||
|
||||
**Note**: The poster image should be specified using `data-poster`. This is to prevent it [being downloaded twice](https://github.com/sampotts/plyr/issues/1531). If you're sure the image will be cached, you can still use the `poster` attribute for true progressive enhancement.
|
||||
|
||||
### HTML5 Audio
|
||||
|
||||
```html
|
||||
<audio id="player" controls>
|
||||
<source src="/path/to/audio.mp3" type="audio/mp3" />
|
||||
<source src="/path/to/audio.ogg" type="audio/ogg" />
|
||||
</audio>
|
||||
```
|
||||
|
||||
For YouTube and Vimeo players, Plyr uses progressive enhancement to enhance the default `<iframe>` embeds. Below are some examples. The `plyr__video-embed` classname will make the embed responsive. You can add the `autoplay`, `loop`, `hl` (YouTube only) and `playsinline` (YouTube only) query parameters to the URL and they will be set as config options automatically. For YouTube, the `origin` should be updated to reflect the domain you're hosting the embed on, or you can opt to omit it.
|
||||
|
||||
### YouTube
|
||||
|
||||
We recommend [progressive enhancement](https://www.smashingmagazine.com/2009/04/progressive-enhancement-what-it-is-and-how-to-use-it/) with the embedded players. You can elect to use an `<iframe>` as the source element (which Plyr will progressively enhance) or a bog standard `<div>` with two essential data attributes - `data-plyr-provider` and `data-plyr-embed-id`.
|
||||
|
||||
```html
|
||||
<div class="plyr__video-embed" id="player">
|
||||
<iframe
|
||||
src="https://www.youtube.com/embed/bTqVqk7FSmY?origin=https://plyr.io&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1"
|
||||
allowfullscreen
|
||||
allowtransparency
|
||||
allow="autoplay"
|
||||
></iframe>
|
||||
</div>
|
||||
```
|
||||
|
||||
_Note_: The `plyr__video-embed` classname will make the player a responsive 16:9 (most common) iframe embed. When plyr itself kicks in, your custom `ratio` config option will be used.
|
||||
|
||||
Or the `<div>` non progressively enhanced method:
|
||||
|
||||
```html
|
||||
<div id="player" data-plyr-provider="youtube" data-plyr-embed-id="bTqVqk7FSmY"></div>
|
||||
```
|
||||
|
||||
_Note_: The `data-plyr-embed-id` can either be the video ID or URL for the media.
|
||||
|
||||
### Vimeo
|
||||
|
||||
Much the same as YouTube above.
|
||||
|
||||
```html
|
||||
<div class="plyr__video-embed" id="player">
|
||||
<iframe
|
||||
src="https://player.vimeo.com/video/76979871?loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media"
|
||||
allowfullscreen
|
||||
allowtransparency
|
||||
allow="autoplay"
|
||||
></iframe>
|
||||
</div>
|
||||
```
|
||||
|
||||
Or the `<div>` non progressively enhanced method:
|
||||
|
||||
```html
|
||||
<div id="player" data-plyr-provider="vimeo" data-plyr-embed-id="76979871"></div>
|
||||
```
|
||||
|
||||
## JavaScript
|
||||
|
||||
You can use Plyr as an ES6 module as follows:
|
||||
|
||||
```js
|
||||
import Plyr from 'plyr';
|
||||
|
||||
const player = new Plyr('#player');
|
||||
```
|
||||
|
||||
Alternatively you can include the `plyr.js` script before the closing `</body>` tag and then in your JS create a new instance of Plyr as below.
|
||||
|
||||
```html
|
||||
<script src="path/to/plyr.js"></script>
|
||||
<script>
|
||||
const player = new Plyr('#player');
|
||||
</script>
|
||||
```
|
||||
|
||||
See [initialising](#initializing) for more information on advanced setups.
|
||||
|
||||
You can use our CDN (provided by [Cloudflare](https://www.cloudflare.com/)) for the JavaScript. There's 2 versions; one with and one without [polyfills](#polyfills). My recommendation would be to manage polyfills separately as part of your application but to make life easier you can use the polyfilled build.
|
||||
|
||||
```html
|
||||
<script src="https://cdn.plyr.io/3.7.8/plyr.js"></script>
|
||||
```
|
||||
|
||||
...or...
|
||||
|
||||
```html
|
||||
<script src="https://cdn.plyr.io/3.7.8/plyr.polyfilled.js"></script>
|
||||
```
|
||||
|
||||
## CSS
|
||||
|
||||
Include the `plyr.css` stylesheet into your `<head>`.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="path/to/plyr.css" />
|
||||
```
|
||||
|
||||
If you want to use our CDN (provided by [Cloudflare](https://www.cloudflare.com/)) for the default CSS, you can use the following:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.plyr.io/3.7.8/plyr.css" />
|
||||
```
|
||||
|
||||
## SVG Sprite
|
||||
|
||||
The SVG sprite is loaded automatically from our CDN (provided by [Cloudflare](https://www.cloudflare.com/)). To change this, see the [options](#options) below. For
|
||||
reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.7.8/plyr.svg`.
|
||||
|
||||
### Self hosting
|
||||
|
||||
If you don't want to create a build system to include Plyr as an npm module, you can use the pre-built files. You have a few options:
|
||||
|
||||
- Download the files from the CDN links above, they're already minified.
|
||||
- Download the files from [unpkg](https://unpkg.com/browse/plyr/dist/) or similar services.
|
||||
- Build the project yourself using `npm i && npm run build`, which installs the dependencies and spits out a build to `dist`.
|
||||
|
||||
# Ads
|
||||
|
||||
Plyr has partnered up with [vi.ai](https://vi.ai/publisher-video-monetization/?aid=plyrio) to offer monetization options for your videos. Getting setup is easy:
|
||||
|
||||
- [Sign up for a vi.ai account](https://vi.ai/publisher-video-monetization/?aid=plyrio)
|
||||
- Grab your publisher ID from the code snippet
|
||||
- Enable ads in the [config options](#options) and enter your publisher ID
|
||||
|
||||
Any questions regarding the ads can be sent straight to vi.ai and any issues with rendering raised through GitHub issues.
|
||||
|
||||
If you do not wish to use Vi, you can set your own `ads.tagUrl` [option](#options).
|
||||
|
||||
# Advanced
|
||||
|
||||
## Customizing the CSS
|
||||
|
||||
If you want to change any design tokens used for the rendering of the player, you can do so using [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties).
|
||||
|
||||
Here's a list of the properties and what they are used for:
|
||||
|
||||
| Name | Description | Default / Fallback |
|
||||
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||
| `--plyr-color-main` | The primary UI color. |  `#00b3ff` |
|
||||
| `--plyr-video-background` | The background color of video and poster wrappers for using alpha channel videos and poster images. | `rgba(0, 0, 0, 1)` |
|
||||
| `--plyr-focus-visible-color` | The color used for the focus styles when an element is `:focus-visible` (keyboard focused). | `--plyr-color-main` |
|
||||
| `--plyr-badge-background` | The background color for badges in the menu. |  `#4a5464` |
|
||||
| `--plyr-badge-text-color` | The text color for badges. |  `#ffffff` |
|
||||
| `--plyr-badge-border-radius` | The border radius used for badges. | `2px` |
|
||||
| `--plyr-captions-background` | The color for the background of captions. | `rgba(0, 0, 0, 0.8)` |
|
||||
| `--plyr-captions-text-color` | The color used for the captions text. |  `#ffffff` |
|
||||
| `--plyr-control-icon-size` | The size of the icons used in the controls. | `18px` |
|
||||
| `--plyr-control-spacing` | The space between controls (sometimes used in a multiple - e.g. `10px / 2 = 5px`). | `10px` |
|
||||
| `--plyr-control-padding` | The padding inside controls. | `--plyr-control-spacing * 0.7` (`7px`) |
|
||||
| `--plyr-control-radius` | The border radius used on controls. | `3px` |
|
||||
| `--plyr-control-toggle-checked-background` | The background color used for checked menu items. | `--plyr-color-main` |
|
||||
| `--plyr-video-controls-background` | The background for the video controls. | `linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75))` |
|
||||
| `--plyr-video-control-color` | The text/icon color for video controls. |  `#ffffff` |
|
||||
| `--plyr-video-control-color-hover` | The text/icon color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
|
||||
| `--plyr-video-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
|
||||
| `--plyr-audio-controls-background` | The background for the audio controls. |  `#ffffff` |
|
||||
| `--plyr-audio-control-color` | The text/icon color for audio controls. |  `#4a5464` |
|
||||
| `--plyr-audio-control-color-hover` | The text/icon color used when audio controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
|
||||
| `--plyr-audio-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
|
||||
| `--plyr-menu-background` | The background color for menus. | `rgba(255, 255, 255, 0.9)` |
|
||||
| `--plyr-menu-color` | The text/icon color for menu items. |  `#4a5464` |
|
||||
| `--plyr-menu-shadow` | The shadow used on menus. | `0 1px 2px rgba(0, 0, 0, 0.15)` |
|
||||
| `--plyr-menu-radius` | The border radius on the menu. | `4px` |
|
||||
| `--plyr-menu-arrow-size` | The size of the arrow on the bottom of the menu. | `6px` |
|
||||
| `--plyr-menu-item-arrow-color` | The color of the arrows in the menu. |  `#728197` |
|
||||
| `--plyr-menu-item-arrow-size` | The size of the arrows in the menu. | `4px` |
|
||||
| `--plyr-menu-border-color` | The border color for the bottom of the back button in the top of the sub menu pages. |  `#dcdfe5` |
|
||||
| `--plyr-menu-border-shadow-color` | The shadow below the border of the back button in the top of the sub menu pages. |  `#ffffff` |
|
||||
| `--plyr-progress-loading-size` | The size of the stripes in the loading state in the scrubber. | `25px` |
|
||||
| `--plyr-progress-loading-background` | The background color on the loading state in the scrubber. | `rgba(35, 40, 47, 0.6)` |
|
||||
| `--plyr-video-progress-buffered-background` | The fill color for the buffer indication in the scrubber for video. | `rgba(255, 255, 255, 0.25)` |
|
||||
| `--plyr-audio-progress-buffered-background` | The fill color for the buffer indication in the scrubber for audio. | `rgba(193, 200, 209, 0.6)` |
|
||||
| `--plyr-range-thumb-height` | The height of the scrubber handle/thumb. | `13px` |
|
||||
| `--plyr-range-thumb-background` | The background of the scrubber handle/thumb. |  `#ffffff` |
|
||||
| `--plyr-range-thumb-shadow` | The shadow of the scrubber handle/thumb. | `0 1px 1px rgba(215, 26, 18, 0.15), 0 0 0 1px rgba(215, 26, 18, 0.2)` |
|
||||
| `--plyr-range-thumb-active-shadow-width` | The width of the shadow when the scrubber handle/thumb is `:active` (pressed). | `3px` |
|
||||
| `--plyr-range-track-height` | The height of the scrubber/progress track. | `5px` |
|
||||
| `--plyr-range-fill-background` | The fill color of the scrubber/progress. | `--plyr-color-main` |
|
||||
| `--plyr-video-range-track-background` | The background of the scrubber/progress. | `--plyr-video-progress-buffered-background` |
|
||||
| `--plyr-video-range-thumb-active-shadow-color` | The color of the shadow when the video scrubber handle/thumb is `:active` (pressed). | `rgba(255, 255, 255, 0.5)` |
|
||||
| `--plyr-audio-range-track-background` | The background of the scrubber/progress. | `--plyr-video-progress-buffered-background` |
|
||||
| `--plyr-audio-range-thumb-active-shadow-color` | The color of the shadow when the audio scrubber handle/thumb is `:active` (pressed). | `rgba(215, 26, 18, 0.1)` |
|
||||
| `--plyr-tooltip-background` | The background color for tooltips. | `rgba(255, 255, 255, 0.9)` |
|
||||
| `--plyr-tooltip-color` | The text color for tooltips. |  `#4a5464` |
|
||||
| `--plyr-tooltip-padding` | The padding for tooltips. | `calc(var(--plyr-control-spacing) / 2))` |
|
||||
| `--plyr-tooltip-arrow-size` | The size of the arrow under tooltips. | `4px` |
|
||||
| `--plyr-tooltip-radius` | The border radius on tooltips. | `3px` |
|
||||
| `--plyr-tooltip-shadow` | The shadow on tooltips. | `0 1px 2px rgba(0, 0, 0, 0.15)` |
|
||||
| `--plyr-font-family` | The font family used in the player. | |
|
||||
| `--plyr-font-size-base` | The base font size. Mainly used for captions. | `15px` |
|
||||
| `--plyr-font-size-small` | The smaller font size. Mainly used for captions. | `13px` |
|
||||
| `--plyr-font-size-large` | The larger font size. Mainly used for captions. | `18px` |
|
||||
| `--plyr-font-size-xlarge` | The even larger font size. Mainly used for captions. | `21px` |
|
||||
| `--plyr-font-size-time` | The font size for the time. | `--plyr-font-size-small` |
|
||||
| `--plyr-font-size-menu` | The font size used in the menu. | `--plyr-font-size-small` |
|
||||
| `--plyr-font-size-badge` | The font size used for badges. | `9px` |
|
||||
| `--plyr-font-weight-regular` | The regular font weight. | `400` |
|
||||
| `--plyr-font-weight-bold` | The bold font weight. | `600` |
|
||||
| `--plyr-line-height` | The line height used within the player. | `1.7` |
|
||||
| `--plyr-font-smoothing` | Whether to enable font antialiasing within the player. | `false` |
|
||||
|
||||
You can set them in your CSS for all players:
|
||||
|
||||
```css
|
||||
:root {
|
||||
--plyr-color-main: #1ac266;
|
||||
}
|
||||
```
|
||||
|
||||
...or for a specific class name:
|
||||
|
||||
```css
|
||||
.player {
|
||||
--plyr-color-main: #1ac266;
|
||||
}
|
||||
```
|
||||
|
||||
...or in your HTML:
|
||||
|
||||
```html
|
||||
<video class="player" style="--plyr-color-main: #1ac266;">...</video>
|
||||
```
|
||||
|
||||
### Sass
|
||||
|
||||
You can use `plyr.scss` file included in `/src/sass` as part of your build and change variables to suit your design. The Sass requires you to
|
||||
use [autoprefixer](https://www.npmjs.com/package/gulp-autoprefixer) (you should be already!) as all declarations use the W3C definitions.
|
||||
|
||||
The HTML markup uses the BEM methodology with `plyr` as the block, e.g. `.plyr__controls`. You can change the class hooks in the options to match any custom CSS
|
||||
you write. Check out the JavaScript source for more on this.
|
||||
|
||||
## SVG
|
||||
|
||||
The icons used in the Plyr controls are loaded in an SVG sprite. The sprite is automatically loaded from our CDN by default. If you already have an icon build
|
||||
system in place, you can include the source plyr icons (see `/src/sprite` for source icons).
|
||||
|
||||
### Using the `iconUrl` option
|
||||
|
||||
You can however specify your own `iconUrl` option and Plyr will determine if the url is absolute and requires loading by AJAX/CORS due to current browser
|
||||
limitations or if it's a relative path, just use the path directly.
|
||||
|
||||
If you're using the `<base>` tag on your site, you may need to use something like this: [svgfixer.js](https://gist.github.com/leonderijke/c5cf7c5b2e424c0061d2)
|
||||
|
||||
More info on SVG sprites here: [http://css-tricks.com/svg-sprites-use-better-icon-fonts/](http://css-tricks.com/svg-sprites-use-better-icon-fonts/) and the AJAX
|
||||
technique here: [http://css-tricks.com/ajaxing-svg-sprite/](http://css-tricks.com/ajaxing-svg-sprite/)
|
||||
|
||||
## Cross Origin (CORS)
|
||||
|
||||
You'll notice the `crossorigin` attribute on the example `<video>` elements. This is because the TextTrack captions are loaded from another domain. If your
|
||||
TextTrack captions are also hosted on another domain, you will need to add this attribute and make sure your host has the correct headers setup. For more info
|
||||
on CORS checkout the MDN docs:
|
||||
[https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
|
||||
|
||||
## Captions
|
||||
|
||||
WebVTT captions are supported. To add a caption track, check the HTML example above and look for the `<track>` element. Be sure to
|
||||
[validate your caption files](https://quuz.org/webvtt/).
|
||||
|
||||
## JavaScript
|
||||
|
||||
### Initializing
|
||||
|
||||
You can specify a range of arguments for the constructor to use:
|
||||
|
||||
- A [CSS string selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
|
||||
- A [`HTMLElement`](https://developer.mozilla.org/en/docs/Web/API/HTMLElement)
|
||||
- A [jQuery](https://jquery.com) object
|
||||
|
||||
_Note_: If a `NodeList`, `Array`, or jQuery object are passed, the first element will be used for setup. To setup multiple players, see [multiple players](#multiple-players) below.
|
||||
|
||||
#### Single player
|
||||
|
||||
Passing a CSS string selector that's compatible with [`querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector):
|
||||
|
||||
```js
|
||||
const player = new Plyr('#player');
|
||||
```
|
||||
|
||||
Passing a [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElement):
|
||||
|
||||
```js
|
||||
const player = new Plyr(document.getElementById('player'));
|
||||
```
|
||||
|
||||
```js
|
||||
const player = new Plyr(document.querySelector('.js-player'));
|
||||
```
|
||||
|
||||
The HTMLElement or string selector can be the target `<video>`, `<audio>`, or `<div>` wrapper for embeds.
|
||||
|
||||
#### Multiple players
|
||||
|
||||
You have two choices here. You can either use a simple array loop to map the constructor:
|
||||
|
||||
```js
|
||||
const players = Array.from(document.querySelectorAll('.js-player')).map((p) => new Plyr(p));
|
||||
```
|
||||
|
||||
...or use a static method where you can pass a [CSS string selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), a [NodeList](https://developer.mozilla.org/en-US/docs/Web/API/NodeList), an [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElement), or a [JQuery](https://jquery.com) object:
|
||||
|
||||
```js
|
||||
const players = Plyr.setup('.js-player');
|
||||
```
|
||||
|
||||
Both options will also return an array of instances in the order of they were in the DOM for the string selector or the source NodeList or Array.
|
||||
|
||||
#### Options
|
||||
|
||||
The second argument for the constructor is the [options](#options) object:
|
||||
|
||||
```js
|
||||
const player = new Plyr('#player', {
|
||||
title: 'Example Title',
|
||||
});
|
||||
```
|
||||
|
||||
Options can be passed as an object to the constructor as above or as JSON in `data-plyr-config` attribute on each of your target elements:
|
||||
|
||||
```html
|
||||
<video src="/path/to/video.mp4" id="player" controls data-plyr-config='{ "title": "Example Title" }'></video>
|
||||
```
|
||||
|
||||
Note the single quotes encapsulating the JSON and double quotes on the object keys. Only string values need double quotes.
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
| -------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `enabled` | Boolean | `true` | Completely disable Plyr. This would allow you to do a User Agent check or similar to programmatically enable or disable Plyr for a certain UA. Example below. |
|
||||
| `debug` | Boolean | `false` | Display debugging information in the console |
|
||||
| `controls` | Array, Function or Element | `['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'pip', 'airplay', 'fullscreen']` | If a function is passed, it is assumed your method will return either an element or HTML string for the controls. Three arguments will be passed to your function; `id` (the unique id for the player), `seektime` (the seektime step in seconds), and `title` (the media title). See [CONTROLS.md](CONTROLS.md) for more info on how the html needs to be structured. |
|
||||
| `settings` | Array | `['captions', 'quality', 'speed', 'loop']` | If the default controls are used, you can specify which settings to show in the menu |
|
||||
| `i18n` | Object | See [defaults.js](/src/js/config/defaults.js) | Used for internationalization (i18n) of the text within the UI. |
|
||||
| `loadSprite` | Boolean | `true` | Load the SVG sprite specified as the `iconUrl` option (if a URL). If `false`, it is assumed you are handling sprite loading yourself. |
|
||||
| `iconUrl` | String | `null` | Specify a URL or path to the SVG sprite. See the [SVG section](#svg) for more info. |
|
||||
| `iconPrefix` | String | `plyr` | Specify the id prefix for the icons used in the default controls (e.g. "plyr-play" would be "plyr"). This is to prevent clashes if you're using your own SVG sprite but with the default controls. Most people can ignore this option. |
|
||||
| `blankVideo` | String | `https://cdn.plyr.io/static/blank.mp4` | Specify a URL or path to a blank video file used to properly cancel network requests. |
|
||||
| `autoplay`² | Boolean | `false` | Autoplay the media on load. If the `autoplay` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true. |
|
||||
| `autopause`¹ | Boolean | `true` | Only allow one player playing at once. |
|
||||
| `playsinline`³ | Boolean | `true` | Allow inline playback on iOS. Note this has no effect on iPadOS. |
|
||||
| `seekTime` | Number | `10` | The time, in seconds, to seek when a user hits fast forward or rewind. |
|
||||
| `volume` | Number | `1` | A number, between 0 and 1, representing the initial volume of the player. |
|
||||
| `muted` | Boolean | `false` | Whether to start playback muted. If the `muted` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true. |
|
||||
| `clickToPlay` | Boolean | `true` | Click (or tap) of the video container will toggle play/pause. |
|
||||
| `disableContextMenu` | Boolean | `true` | Disable right click menu on video to <em>help</em> as very primitive obfuscation to prevent downloads of content. |
|
||||
| `hideControls` | Boolean | `true` | Hide video controls automatically after 2s of no mouse or focus movement, on control element blur (tab out), on playback start or entering fullscreen. As soon as the mouse is moved, a control element is focused or playback is paused, the controls reappear instantly. |
|
||||
| `resetOnEnd` | Boolean | false | Reset the playback to the start once playback is complete. |
|
||||
| `keyboard` | Object | `{ focused: true, global: false }` | Enable [keyboard shortcuts](#shortcuts) for focused players only or globally |
|
||||
| `tooltips` | Object | `{ controls: false, seek: true }` | `controls`: Display control labels as tooltips on `:hover` & `:focus` (by default, the labels are screen reader only). `seek`: Display a seek tooltip to indicate on click where the media would seek to. |
|
||||
| `duration` | Number | `null` | Specify a custom duration for media. |
|
||||
| `displayDuration` | Boolean | `true` | Displays the duration of the media on the "metadataloaded" event (on startup) in the current time display. This will only work if the `preload` attribute is not set to `none` (or is not set at all) and you choose not to display the duration (see `controls` option). |
|
||||
| `invertTime` | Boolean | `true` | Display the current time as a countdown rather than an incremental counter. |
|
||||
| `toggleInvert` | Boolean | `true` | Allow users to click to toggle the above. |
|
||||
| `listeners` | Object | `null` | Allows binding of event listeners to the controls before the default handlers. See the `defaults.js` for available listeners. If your handler prevents default on the event (`event.preventDefault()`), the default handler will not fire. |
|
||||
| `captions` | Object | `{ active: false, language: 'auto', update: false }` | `active`: Toggles if captions should be active by default. `language`: Sets the default language to load (if available). 'auto' uses the browser language. `update`: Listen to changes to tracks and update menu. This is needed for some streaming libraries, but can result in non-selectable language options). |
|
||||
| `fullscreen` | Object | `{ enabled: true, fallback: true, iosNative: false, container: null }` | `enabled`: Toggles whether fullscreen should be enabled. `fallback`: Allow fallback to a full-window solution (`true`/`false`/`'force'`). `iosNative`: whether to use native iOS fullscreen when entering fullscreen (no custom controls) - note this has no effect on iPadOS. `container`: A selector for an ancestor of the player element, allows contextual content to remain visual in fullscreen mode. Non-ancestors are ignored. |
|
||||
| `ratio` | String | `null` | Force an aspect ratio for all videos. The format is `'w:h'` - e.g. `'16:9'` or `'4:3'`. If this is not specified then the default for HTML5 and Vimeo is to use the native resolution of the video. As dimensions are not available from YouTube via SDK, 16:9 is forced as a sensible default. |
|
||||
| `storage` | Object | `{ enabled: true, key: 'plyr' }` | `enabled`: Allow use of local storage to store user settings. `key`: The key name to use. |
|
||||
| `speed` | Object | `{ selected: 1, options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 4] }` | `selected`: The default speed for playback. `options`: The speed options to display in the UI. YouTube and Vimeo will ignore any options outside of the 0.5-2 range, so options outside of this range will be hidden automatically. |
|
||||
| `quality` | Object | `{ default: 576, options: [4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240] }` | `default` is the default quality level (if it exists in your sources). `options` are the options to display. This is used to filter the available sources. |
|
||||
| `loop` | Object | `{ active: false }` | `active`: Whether to loop the current video. If the `loop` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true This is an object to support future functionality. |
|
||||
| `ads` | Object | `{ enabled: false, publisherId: '', tagUrl: '' }` | `enabled`: Whether to enable advertisements. `publisherId`: Your unique [vi.ai](https://vi.ai/publisher-video-monetization/?aid=plyrio) publisher ID. `tagUrl` is a URL for a custom VAST tag if you're not using Vi. |
|
||||
| `urls` | Object | See source. | If you wish to override any API URLs then you can do so here. You can also set a custom download URL for the download button. |
|
||||
| `vimeo` | Object | `{ byline: false, portrait: false, title: false, speed: true, transparent: false }` | See [Vimeo embed options](https://github.com/vimeo/player.js/#embed-options). Some are set automatically based on other config options, namely: `loop`, `autoplay`, `muted`, `gesture`, `playsinline` |
|
||||
| `youtube` | Object | `{ noCookie: false, rel: 0, showinfo: 0, iv_load_policy: 3, modestbranding: 1 }` | See [YouTube embed options](https://developers.google.com/youtube/player_parameters#Parameters). The only custom option is `noCookie` to use an alternative to YouTube that doesn't use cookies (useful for GDPR, etc). Some are set automatically based on other config options, namely: `autoplay`, `hl`, `controls`, `disablekb`, `playsinline`, `cc_load_policy`, `cc_lang_pref`, `widget_referrer` |
|
||||
| `previewThumbnails` | Object | `{ enabled: false, src: '' }` | `enabled`: Whether to enable the preview thumbnails (they must be generated by you). `src` must be either a string or an array of strings representing URLs for the VTT files containing the image URL(s). Learn more about [preview thumbnails](#preview-thumbnails) below. |
|
||||
| `mediaMetadata` | Object | `{ title: '', artist: '', album: '', artwork: [] }` | The [MediaMetadata](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata) interface of the Media Session API allows a web page to provide rich media metadata for display in a platform UI. |
|
||||
| `markers` | Object | `{ enabled: false, points: [] }` | `enabled`: Whether to enable markers. `points` is an array of `{ time: number; label: string; }` objects where `time` represents the marker position in seconds and `label` is the HTML string to be displayed. |
|
||||
|
||||
1. Vimeo only
|
||||
2. Autoplay is generally not recommended as it is seen as a negative user experience. It is also disabled in many browsers. Before raising issues, do your homework. More info can be found here:
|
||||
|
||||
- <https://webkit.org/blog/6784/new-video-policies-for-ios/>
|
||||
- <https://developers.google.com/web/updates/2017/09/autoplay-policy-changes>
|
||||
- <https://hacks.mozilla.org/2019/02/firefox-66-to-block-automatically-playing-audible-video-and-audio/>
|
||||
|
||||
3. YouTube does not support programatically toggling the native fullscreen player via it's API. This means on iOS you have two options, neither being perfect:
|
||||
|
||||
- Use the fallback/faux fullscreen option which covers the whole viewport (this is the default)
|
||||
- Set `playsinline` to `false` and/or `fullscreen.iosNative` to `true` - either option hides the fullscreen toggle in the UI (because of the above API issue) and means iOS will play the video in it's native player.
|
||||
|
||||
# API
|
||||
|
||||
There are methods, setters and getters on a Plyr object.
|
||||
|
||||
## Object
|
||||
|
||||
The easiest way to access the Plyr object is to set the return value from your call to the constructor to a variable. For example:
|
||||
|
||||
```js
|
||||
const player = new Plyr('#player', {
|
||||
/* options */
|
||||
});
|
||||
```
|
||||
|
||||
You can also access the object through any events:
|
||||
|
||||
```js
|
||||
element.addEventListener('ready', (event) => {
|
||||
const player = event.detail.plyr;
|
||||
});
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
Example method use:
|
||||
|
||||
```js
|
||||
player.play(); // Start playback
|
||||
player.fullscreen.enter(); // Enter fullscreen
|
||||
```
|
||||
|
||||
| Method | Parameters | Description |
|
||||
| -------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `play()`¹ | - | Start playback. |
|
||||
| `pause()` | - | Pause playback. |
|
||||
| `togglePlay(toggle)`¹ | Boolean | Toggle playback, if no parameters are passed, it will toggle based on current status. |
|
||||
| `stop()` | - | Stop playback and reset to start. |
|
||||
| `restart()` | - | Restart playback. |
|
||||
| `rewind(seekTime)` | Number | Rewind playback by the specified seek time. If no parameter is passed, the default seek time will be used. |
|
||||
| `forward(seekTime)` | Number | Fast forward by the specified seek time. If no parameter is passed, the default seek time will be used. |
|
||||
| `increaseVolume(step)` | Number | Increase volume by the specified step. If no parameter is passed, the default step will be used. |
|
||||
| `decreaseVolume(step)` | Number | Increase volume by the specified step. If no parameter is passed, the default step will be used. |
|
||||
| `toggleCaptions(toggle)` | Boolean | Toggle captions display. If no parameter is passed, it will toggle based on current status. |
|
||||
| `fullscreen.enter()` | - | Enter fullscreen. If fullscreen is not supported, a fallback "full window/viewport" is used instead. |
|
||||
| `fullscreen.exit()` | - | Exit fullscreen. |
|
||||
| `fullscreen.toggle()` | - | Toggle fullscreen. |
|
||||
| `airplay()` | - | Trigger the airplay dialog on supported devices. |
|
||||
| `setPreviewThumbnails(source: PreviewThumbnailsOptions)` | - | Sets the preview thumbnails for the current source. |
|
||||
| `toggleControls(toggle)` | Boolean | Toggle the controls (video only). Takes optional truthy value to force it on/off. |
|
||||
| `on(event, function)` | String, Function | Add an event listener for the specified event. |
|
||||
| `once(event, function)` | String, Function | Add an event listener for the specified event once. |
|
||||
| `off(event, function)` | String, Function | Remove an event listener for the specified event. |
|
||||
| `supports(type)` | String | Check support for a mime type. |
|
||||
| `destroy()` | - | Destroy the instance and garbage collect any elements. |
|
||||
|
||||
1. For HTML5 players, `play()` will return a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) for most browsers - e.g. Chrome, Firefox, Opera, Safari and Edge [according to MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play) at time of writing.
|
||||
|
||||
## Getters and Setters
|
||||
|
||||
Example setters:
|
||||
|
||||
```js
|
||||
player.volume = 0.5; // Sets volume at 50%
|
||||
player.currentTime = 10; // Seeks to 10 seconds
|
||||
```
|
||||
|
||||
Example getters:
|
||||
|
||||
```js
|
||||
player.volume; // 0.5;
|
||||
player.currentTime; // 10
|
||||
player.fullscreen.active; // false;
|
||||
```
|
||||
|
||||
| Property | Getter | Setter | Description |
|
||||
| -------------------- | ------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `isHTML5` | ✓ | - | Returns a boolean indicating if the current player is HTML5. |
|
||||
| `isEmbed` | ✓ | - | Returns a boolean indicating if the current player is an embedded player. |
|
||||
| `playing` | ✓ | - | Returns a boolean indicating if the current player is playing. |
|
||||
| `paused` | ✓ | - | Returns a boolean indicating if the current player is paused. |
|
||||
| `stopped` | ✓ | - | Returns a boolean indicating if the current player is stopped. |
|
||||
| `ended` | ✓ | - | Returns a boolean indicating if the current player has finished playback. |
|
||||
| `buffered` | ✓ | - | Returns a float between 0 and 1 indicating how much of the media is buffered |
|
||||
| `currentTime` | ✓ | ✓ | Gets or sets the currentTime for the player. The setter accepts a float in seconds. |
|
||||
| `seeking` | ✓ | - | Returns a boolean indicating if the current player is seeking. |
|
||||
| `duration` | ✓ | - | Returns the duration for the current media. |
|
||||
| `volume` | ✓ | ✓ | Gets or sets the volume for the player. The setter accepts a float between 0 and 1. |
|
||||
| `muted` | ✓ | ✓ | Gets or sets the muted state of the player. The setter accepts a boolean. |
|
||||
| `hasAudio` | ✓ | - | Returns a boolean indicating if the current media has an audio track. |
|
||||
| `speed` | ✓ | ✓ | Gets or sets the speed for the player. The setter accepts a value in the options specified in your config. Generally the minimum should be 0.5. |
|
||||
| `quality`¹ | ✓ | ✓ | Gets or sets the quality for the player. The setter accepts a value from the options specified in your config. |
|
||||
| `loop` | ✓ | ✓ | Gets or sets the current loop state of the player. The setter accepts a boolean. |
|
||||
| `source` | ✓ | ✓ | Gets or sets the current source for the player. The setter accepts an object. See [source setter](#the-source-setter) below for examples. |
|
||||
| `poster` | ✓ | ✓ | Gets or sets the current poster image for the player. The setter accepts a string; the URL for the updated poster image. |
|
||||
| `previewThumbnails` | ✓ | ✓ | Gets or sets the current preview thumbnail source for the player. The setter accepts a string |
|
||||
| `autoplay` | ✓ | ✓ | Gets or sets the autoplay state of the player. The setter accepts a boolean. |
|
||||
| `currentTrack` | ✓ | ✓ | Gets or sets the caption track by index. `-1` means the track is missing or captions is not active |
|
||||
| `language` | ✓ | ✓ | Gets or sets the preferred captions language for the player. The setter accepts an ISO two-letter language code. Support for the languages is dependent on the captions you include. If your captions don't have any language data, or if you have multiple tracks with the same language, you may want to use `currentTrack` instead. |
|
||||
| `fullscreen.active` | ✓ | - | Returns a boolean indicating if the current player is in fullscreen mode. |
|
||||
| `fullscreen.enabled` | ✓ | - | Returns a boolean indicating if the current player has fullscreen enabled. |
|
||||
| `pip`¹ | ✓ | ✓ | Gets or sets the picture-in-picture state of the player. The setter accepts a boolean. This currently only supported on Safari 10+ (on MacOS Sierra+ and iOS 10+) and Chrome 70+. |
|
||||
| `ratio` | ✓ | ✓ | Gets or sets the video aspect ratio. The setter accepts a string in the same format as the `ratio` option. |
|
||||
| `download` | ✓ | ✓ | Gets or sets the URL for the download button. The setter accepts a string containing a valid absolute URL. |
|
||||
|
||||
1. HTML5 only
|
||||
|
||||
### The `.source` setter
|
||||
|
||||
This allows changing the player source and type on the fly.
|
||||
|
||||
Video example:
|
||||
|
||||
```js
|
||||
player.source = {
|
||||
type: 'video',
|
||||
title: 'Example title',
|
||||
sources: [
|
||||
{
|
||||
src: '/path/to/movie.mp4',
|
||||
type: 'video/mp4',
|
||||
size: 720,
|
||||
},
|
||||
{
|
||||
src: '/path/to/movie.webm',
|
||||
type: 'video/webm',
|
||||
size: 1080,
|
||||
},
|
||||
],
|
||||
poster: '/path/to/poster.jpg',
|
||||
previewThumbnails: {
|
||||
src: '/path/to/thumbnails.vtt',
|
||||
},
|
||||
tracks: [
|
||||
{
|
||||
kind: 'captions',
|
||||
label: 'English',
|
||||
srclang: 'en',
|
||||
src: '/path/to/captions.en.vtt',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
kind: 'captions',
|
||||
label: 'French',
|
||||
srclang: 'fr',
|
||||
src: '/path/to/captions.fr.vtt',
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
Audio example:
|
||||
|
||||
```js
|
||||
player.source = {
|
||||
type: 'audio',
|
||||
title: 'Example title',
|
||||
sources: [
|
||||
{
|
||||
src: '/path/to/audio.mp3',
|
||||
type: 'audio/mp3',
|
||||
},
|
||||
{
|
||||
src: '/path/to/audio.ogg',
|
||||
type: 'audio/ogg',
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
YouTube example:
|
||||
|
||||
```js
|
||||
player.source = {
|
||||
type: 'video',
|
||||
sources: [
|
||||
{
|
||||
src: 'bTqVqk7FSmY',
|
||||
provider: 'youtube',
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
Vimeo example
|
||||
|
||||
```js
|
||||
player.source = {
|
||||
type: 'video',
|
||||
sources: [
|
||||
{
|
||||
src: '76979871',
|
||||
provider: 'vimeo',
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
_Note:_ `src` property for YouTube and Vimeo can either be the video ID or the whole URL.
|
||||
|
||||
| Property | Type | Description |
|
||||
| ------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | String | Either `video` or `audio`. _Note:_ YouTube and Vimeo are currently not supported as audio sources. |
|
||||
| `title` | String | _Optional._ Title of the new media. Used for the `aria-label` attribute on the play button, and outer container. YouTube and Vimeo are populated automatically. |
|
||||
| `sources` | Array | This is an array of sources. For HTML5 media, the properties of this object are mapped directly to HTML attributes so more can be added to the object if required. |
|
||||
| `poster`¹ | String | The URL for the poster image (HTML5 video only). |
|
||||
| `tracks`¹ | String | An array of track objects. Each element in the array is mapped directly to a track element and any keys mapped directly to HTML attributes so as in the example above, it will render as `<track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.0/example_captions_en.vtt" default>` and similar for the French version. Booleans are converted to HTML5 value-less attributes. |
|
||||
| `previewThumbnails`¹ | Object | The same object like in the `previewThumbnails` constructor option. This means you can either change the thumbnails vtt via the `src` key or disable the thumbnails plugin for the next video by passing `{ enabled: false }`. |
|
||||
|
||||
1. HTML5 only
|
||||
|
||||
# Events
|
||||
|
||||
You can listen for events on the target element you setup Plyr on (see example under the table). Some events only apply to HTML5 audio and video. Using your
|
||||
reference to the instance, you can use the `on()` API method or `addEventListener()`. Access to the API can be obtained this way through the `event.detail.plyr`
|
||||
property. Here's an example:
|
||||
|
||||
```js
|
||||
player.on('ready', (event) => {
|
||||
const instance = event.detail.plyr;
|
||||
});
|
||||
```
|
||||
|
||||
## Standard Media Events
|
||||
|
||||
| Event Type | Description |
|
||||
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `progress` | Sent periodically to inform interested parties of progress downloading the media. Information about the current amount of the media that has been downloaded is available in the media element's `buffered` attribute. |
|
||||
| `playing` | Sent when the media begins to play (either for the first time, after having been paused, or after ending and then restarting). |
|
||||
| `play` | Sent when playback of the media starts after having been paused; that is, when playback is resumed after a prior `pause` event. |
|
||||
| `pause` | Sent when playback is paused. |
|
||||
| `timeupdate` | The time indicated by the element's `currentTime` attribute has changed. |
|
||||
| `volumechange` | Sent when the audio volume changes (both when the volume is set and when the `muted` state is changed). |
|
||||
| `seeking` | Sent when a seek operation begins. |
|
||||
| `seeked` | Sent when a seek operation completes. |
|
||||
| `ratechange` | Sent when the playback speed changes. |
|
||||
| `ended` | Sent when playback completes. _Note:_ This does not fire if `autoplay` is true. |
|
||||
| `enterfullscreen` | Sent when the player enters fullscreen mode (either the proper fullscreen or full-window fallback for older browsers). |
|
||||
| `exitfullscreen` | Sent when the player exits fullscreen mode. |
|
||||
| `captionsenabled` | Sent when captions are enabled. |
|
||||
| `captionsdisabled` | Sent when captions are disabled. |
|
||||
| `languagechange` | Sent when the caption language is changed. |
|
||||
| `controlshidden` | Sent when the controls are hidden. |
|
||||
| `controlsshown` | Sent when the controls are shown. |
|
||||
| `ready` | Triggered when the instance is ready for API calls. |
|
||||
|
||||
### HTML5 only
|
||||
|
||||
| Event Type | Description |
|
||||
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `loadstart` | Sent when loading of the media begins. |
|
||||
| `loadeddata` | The first frame of the media has finished loading. |
|
||||
| `loadedmetadata` | The media's metadata has finished loading; all attributes now contain as much useful information as they're going to. |
|
||||
| `qualitychange` | The quality of playback has changed. |
|
||||
| `canplay` | Sent when enough data is available that the media can be played, at least for a couple of frames. This corresponds to the `HAVE_ENOUGH_DATA` `readyState`. |
|
||||
| `canplaythrough` | Sent when the ready state changes to `CAN_PLAY_THROUGH`, indicating that the entire media can be played without interruption, assuming the download rate remains at least at the current level. _Note:_ Manually setting the `currentTime` will eventually fire a `canplaythrough` event in firefox. Other browsers might not fire this event. |
|
||||
| `stalled` | Sent when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. |
|
||||
| `waiting` | Sent when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek). |
|
||||
| `emptied` | he media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the `load()` method is called to reload it. |
|
||||
| `cuechange` | Sent when a `TextTrack` has changed the currently displaying cues. |
|
||||
| `error` | Sent when an error occurs. The element's `error` attribute contains more information. |
|
||||
|
||||
### YouTube only
|
||||
|
||||
| Event Type | Description |
|
||||
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `statechange` | The state of the player has changed. The code can be accessed via `event.detail.code`. Possible values are `-1`: Unstarted, `0`: Ended, `1`: Playing, `2`: Paused, `3`: Buffering, `5`: Video cued. See the [YouTube Docs](https://developers.google.com/youtube/iframe_api_reference#onStateChange) for more information. |
|
||||
|
||||
_Note:_ These events also bubble up the DOM. The event target will be the container element.
|
||||
|
||||
Some event details borrowed from [MDN](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events).
|
||||
|
||||
# Embeds
|
||||
|
||||
YouTube and Vimeo are currently supported and function much like a HTML5 video. Similar events and API methods are available for all types. However if you wish
|
||||
to access the API's directly. You can do so via the `embed` property of your player object - e.g. `player.embed`. You can then use the relevant methods from the
|
||||
third party APIs. More info on the respective API's here:
|
||||
|
||||
- [YouTube iframe API Reference](https://developers.google.com/youtube/iframe_api_reference)
|
||||
- [Vimeo player.js Reference](https://github.com/vimeo/player.js)
|
||||
|
||||
_Note_: Not all API methods may work 100%. Your mileage may vary. It's better to use the Plyr API where possible.
|
||||
|
||||
# Shortcuts
|
||||
|
||||
By default, a player will bind the following keyboard shortcuts when it has focus. If you have the `global` option to `true` and there's only one player in the
|
||||
document then the shortcuts will work when any element has focus, apart from an element that requires input.
|
||||
|
||||
| Key | Action |
|
||||
| ---------- | -------------------------------------- |
|
||||
| `0` to `9` | Seek from 0 to 90% respectively |
|
||||
| `space` | Toggle playback |
|
||||
| `K` | Toggle playback |
|
||||
| ← | Seek backward by the `seekTime` option |
|
||||
| → | Seek forward by the `seekTime` option |
|
||||
| ↑ | Increase volume |
|
||||
| ↓ | Decrease volume |
|
||||
| `M` | Toggle mute |
|
||||
| `F` | Toggle fullscreen |
|
||||
| `C` | Toggle captions |
|
||||
| `L` | Toggle loop |
|
||||
|
||||
# Preview thumbnails
|
||||
|
||||
It's possible to display preview thumbnails as per the demo when you hover over the scrubber or while you are scrubbing in the main video area. This can be used for all video types but is easiest with HTML5 of course. You will need to generate the sprite or images yourself. This is possible using something like AWS transcoder to generate the frames and then combine them into a sprite image. Sprites are recommended for performance reasons - they will be much faster to download and easier to compress into a small file size making them load faster.
|
||||
|
||||
You can see the example VTT files [here](https://cdn.plyr.io/static/demo/thumbs/100p.vtt) and [here](https://cdn.plyr.io/static/demo/thumbs/240p.vtt) for how the sprites are done. The coordinates are set as the `xywh` hash on the URL in the order X Offset, Y Offset, Width, Height (e.g. `240p-00001.jpg#xywh=1708,480,427,240` is offset `1708px` from the left, `480px` from the top and is `427x240px`. If you want to include images per frame, this is also possible but will be slower, resulting in a degraded experience.
|
||||
|
||||
# Fullscreen
|
||||
|
||||
Fullscreen in Plyr is supported by all browsers that [currently support it](http://caniuse.com/#feat=fullscreen).
|
||||
|
||||
# Browser support
|
||||
|
||||
Plyr supports the last 2 versions of most _modern_ browsers.
|
||||
|
||||
| Browser | Supported |
|
||||
| ------------- | --------------- |
|
||||
| Safari | ✓ |
|
||||
| Mobile Safari | ✓¹ |
|
||||
| Firefox | ✓ |
|
||||
| Chrome | ✓ |
|
||||
| Opera | ✓ |
|
||||
| Edge | ✓ |
|
||||
| IE11 | ✓³ |
|
||||
| IE10 | ✓<sup>2,3</sup> |
|
||||
|
||||
1. Mobile Safari on the iPhone forces the native player for `<video>` unless the `playsinline` attribute is present. Volume controls are also disabled as they are handled device wide.
|
||||
2. Native player used (no support for `<progress>` or `<input type="range">`) but the API is supported. No native fullscreen support, fallback can be used (see [options](#options)).
|
||||
3. Polyfills required. See below.
|
||||
|
||||
## Polyfills
|
||||
|
||||
Plyr uses ES6 which isn't supported in all browsers quite yet. This means some features will need to be polyfilled to be available otherwise you'll run into issues. We've elected to not burden the ~90% of users that do support these features with extra JS and instead leave polyfilling to you to work out based on your needs. The easiest method I've found is to use [polyfill.io](https://polyfill.io) which provides polyfills based on user agent. This is the method the demo uses.
|
||||
|
||||
## Checking for support
|
||||
|
||||
You can use the static method to check for support. For example
|
||||
|
||||
```js
|
||||
const supported = Plyr.supported('video', 'html5');
|
||||
```
|
||||
|
||||
The arguments are:
|
||||
|
||||
- Media type (`'audio' | 'video'`)
|
||||
- Provider (`'html5' | 'youtube' | 'vimeo'`)
|
||||
|
||||
## Disable support programmatically
|
||||
|
||||
The `enabled` option can be used to disable certain User Agents. For example, if you don't want to use Plyr for smartphones, you could use:
|
||||
|
||||
```js
|
||||
{
|
||||
enabled: !/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);
|
||||
}
|
||||
```
|
||||
|
||||
If a User Agent is disabled but supports `<video>` and `<audio>` natively, it will use the native player.
|
||||
|
||||
# Plugins & Components
|
||||
|
||||
Some awesome folks have made plugins for CMSs and Components for JavaScript frameworks:
|
||||
|
||||
| Type | Maintainer | Link |
|
||||
| ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| WordPress | Brandon Lavigne ([@drrobotnik](https://github.com/drrobotnik)) | [https://wordpress.org/plugins/plyr/](https://wordpress.org/plugins/plyr/) |
|
||||
| Angular | Simon Bobrov ([@smnbbrv](https://github.com/smnbbrv)) | [https://github.com/smnbbrv/ngx-plyr](https://github.com/smnbbrv/ngx-plyr) |
|
||||
| React | Chintan Prajapati ([@chintan9](https://github.com/chintan9)) | [https://github.com/chintan9/plyr-react](https://github.com/chintan9/plyr-react) |
|
||||
| Vue | Gabe Dunn ([@redxtech](https://github.com/redxtech)) | [https://github.com/redxtech/vue-plyr](https://github.com/redxtech/vue-plyr) |
|
||||
| Neos | Jon Uhlmann ([@jonnitto](https://github.com/jonnitto)) | [https://packagist.org/packages/jonnitto/plyr](https://packagist.org/packages/jonnitto/plyr) |
|
||||
| Kirby | Dominik Pschenitschni ([@dpschen](https://github.com/dpschen)) | [https://github.com/dpschen/kirby-plyrtag](https://github.com/dpschen/kirby-plyrtag) |
|
||||
| REDAXO | FriendsOfRedaxo / skerbis ([@skerbis](https://friendsofredaxo.github.io)) | [https://github.com/FriendsOfREDAXO/plyr](https://github.com/FriendsOfREDAXO/plyr) |
|
||||
| svelte-plyr | Ben Woodward / benwoodward ([@benwoodward](https://github.com/benwoodward)) | [https://github.com/benwoodward/svelte-plyr](https://github.com/benwoodward/svelte-plyr) |
|
||||
|
||||
# Issues
|
||||
|
||||
If you find anything weird with Plyr, please let us know using the GitHub issues tracker.
|
||||
|
||||
# Author
|
||||
|
||||
Plyr is developed by [@sam_potts](https://twitter.com/sam_potts) / [sampotts.me](http://sampotts.me) with help from the awesome
|
||||
[contributors](https://github.com/sampotts/plyr/graphs/contributors)
|
||||
|
||||
# Donate
|
||||
|
||||
Plyr costs money to run, not only my time. I donate my time for free as I enjoy building Plyr but unfortunately have to pay for domains, hosting, and more. Any help with costs is appreciated...
|
||||
|
||||
- [Donate via Patreon](https://www.patreon.com/plyr)
|
||||
- [Donate via PayPal](https://www.paypal.me/pottsy/20usd)
|
||||
|
||||
# Mentions
|
||||
|
||||
- [ProductHunt](https://www.producthunt.com/tech/plyr)
|
||||
- [The Changelog](http://thechangelog.com/plyr-simple-html5-media-player-custom-controls-webvtt-captions/)
|
||||
- [HTML5 Weekly #177](http://html5weekly.com/issues/177)
|
||||
- [Responsive Design #149](http://us4.campaign-archive2.com/?u=559bc631fe5294fc66f5f7f89&id=451a61490f)
|
||||
- [Web Design Weekly #174](https://web-design-weekly.com/2015/02/24/web-design-weekly-174/)
|
||||
- [Front End Focus #177](https://frontendfoc.us/issues/177)
|
||||
- [Hacker News](https://news.ycombinator.com/item?id=9136774)
|
||||
- [Web Platform Daily](http://webplatformdaily.org/releases/2015-03-04)
|
||||
- [LayerVault Designer News](https://news.layervault.com/stories/45394-plyr--a-simple-html5-media-player)
|
||||
- [The Treehouse Show #131](https://teamtreehouse.com/library/episode-131-origami-react-responsive-hero-images)
|
||||
- [noupe.com](http://www.noupe.com/design/html5-plyr-is-a-responsive-and-accessible-video-player-94389.html)
|
||||
|
||||
# Used by
|
||||
|
||||
- [Selz.com](https://selz.com)
|
||||
- [Peugeot.fr](http://www.peugeot.fr/marque-et-technologie/technologies/peugeot-i-cockpit.html)
|
||||
- [Peugeot.de](http://www.peugeot.de/modelle/modellberater/208-3-turer/fotos-videos.html)
|
||||
- [TomTom.com](http://prioritydriving.tomtom.com/)
|
||||
- [DIGBMX](http://digbmx.com/)
|
||||
- [Grime Archive](https://grimearchive.com/)
|
||||
- [koel - A personal music streaming server that works.](http://koel.phanan.net/)
|
||||
- [Oscar Radio](http://oscar-radio.xyz/)
|
||||
- [Sparkk TV](https://www.sparkktv.com/)
|
||||
- [@halfhalftravel](https://www.halfhalftravel.com/)
|
||||
- [BitChute](https://www.bitchute.com)
|
||||
- [Rutheneum-Bote](https://gymnasium-rutheneum.de/content/newspaper/kreativwettbewerb.php)
|
||||
- [pressakey.com | Blog-Magazin für Videospiele](https://pressakey.com)
|
||||
- [STROLLÿN: Work with a View](https://strollyn.com)
|
||||
- [CFDA Runway360](https://runway360.cfda.com/)
|
||||
- [NKLAV | Filmmaker](https://nklav.com)
|
||||
- [GDI.JS.ORG - Google Drive Index](https://gitlab.com/GoogleDriveIndex/Google-Drive-Index)
|
||||
|
||||
If you want to be added to the list, open a pull request. It'd be awesome to see how you're using Plyr 😎
|
||||
|
||||
# Useful links and credits
|
||||
|
||||
- [PayPal's Accessible HTML5 Video Player (which Plyr was originally ported from)](https://github.com/paypal/accessible-html5-video-player)
|
||||
- [An awesome guide for Plyr in Japanese!](http://syncer.jp/how-to-use-plyr-io) by [@arayutw](https://twitter.com/arayutw)
|
||||
|
||||
# Thanks
|
||||
|
||||
- [Cloudflare](https://www.cloudflare.com/) and [Fastly](https://www.fastly.com/) for providing the CDN services.
|
||||
- [Sentry](https://sentry.io/) for error logging service on the demo website.
|
||||
|
||||
## Contributors
|
||||
|
||||
### Code Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
|
||||
<a href="https://github.com/sampotts/plyr/graphs/contributors"><img src="https://opencollective.com/plyr/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
### Financial Contributors
|
||||
|
||||
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/plyr/contribute)]
|
||||
|
||||
#### Individuals
|
||||
|
||||
<a href="https://opencollective.com/plyr"><img src="https://opencollective.com/plyr/individuals.svg?width=890"></a>
|
||||
|
||||
#### Organizations
|
||||
|
||||
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/plyr/contribute)]
|
||||
|
||||
<a href="https://opencollective.com/plyr/organization/0/website"><img src="https://opencollective.com/plyr/organization/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/plyr/organization/1/website"><img src="https://opencollective.com/plyr/organization/1/avatar.svg"></a><a href="https://opencollective.com/plyr/organization/2/website"><img src="https://opencollective.com/plyr/organization/2/avatar.svg"></a>
|
||||
|
||||
# Copyright and License
|
||||
|
||||
[The MIT license](LICENSE.md)
|
33
bower.json
33
bower.json
@ -1,33 +0,0 @@
|
||||
{
|
||||
"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/sprite.svg",
|
||||
"src/less/plyr.less",
|
||||
"src/sass/plyr.scss",
|
||||
"src/js/plyr.js"
|
||||
],
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
".gitignore"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/selz/plyr.git"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
48
build.json
Normal file
48
build.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"js": {
|
||||
"plyr.js": {
|
||||
"src": "./src/js/plyr.js",
|
||||
"dist": "./dist/",
|
||||
"formats": ["es", "umd"],
|
||||
"namespace": "Plyr"
|
||||
},
|
||||
"plyr.polyfilled.js": {
|
||||
"src": "./src/js/plyr.polyfilled.js",
|
||||
"dist": "./dist/",
|
||||
"formats": ["es", "umd"],
|
||||
"namespace": "Plyr",
|
||||
"polyfill": true
|
||||
},
|
||||
"demo.js": {
|
||||
"src": "./demo/src/js/demo.js",
|
||||
"dist": "./demo/dist/",
|
||||
"formats": ["iife"],
|
||||
"namespace": "Demo",
|
||||
"polyfill": true
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"plyr.css": {
|
||||
"src": "./src/sass/plyr.scss",
|
||||
"dist": "./dist/"
|
||||
},
|
||||
"demo.css": {
|
||||
"src": "./demo/src/sass/bundles/demo.scss",
|
||||
"dist": "./demo/dist/"
|
||||
},
|
||||
"error.css": {
|
||||
"src": "./demo/src/sass/bundles/error.scss",
|
||||
"dist": "./demo/dist/"
|
||||
}
|
||||
},
|
||||
"sprite": {
|
||||
"plyr.svg": {
|
||||
"src": "./src/sprite/*.svg",
|
||||
"dist": "./dist"
|
||||
},
|
||||
"demo.svg": {
|
||||
"src": "./src/sprite/*.svg",
|
||||
"dist": "./demo/dist"
|
||||
}
|
||||
}
|
||||
}
|
25
bundles.json
25
bundles.json
@ -1,25 +0,0 @@
|
||||
{
|
||||
"plyr": {
|
||||
"less": {
|
||||
"plyr.css": ["src/less/plyr.less"]
|
||||
},
|
||||
"sass": {
|
||||
"plyr.css": ["src/less/plyr.sass"]
|
||||
},
|
||||
"js": {
|
||||
"plyr.js": ["src/js/plyr.js"]
|
||||
}
|
||||
},
|
||||
"docs": {
|
||||
"less": {
|
||||
"docs.css": ["docs/src/less/docs.less"]
|
||||
},
|
||||
"js": {
|
||||
"docs.js": [
|
||||
"docs/src/js/lib/hogan-3.0.2.mustache.js",
|
||||
"docs/dist/templates.js",
|
||||
"docs/src/js/docs.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
174
changelog.md
174
changelog.md
@ -1,174 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## 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
|
86
controls.md
86
controls.md
@ -1,86 +0,0 @@
|
||||
# Controls HTML
|
||||
|
||||
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.
|
||||
|
||||
The demo Plyr setup uses a Hogan template. This purely to allow for localization at a later date. Check out `controls.html` in `/src/templates` to get an idea of how the default html is structured.
|
||||
|
||||
## Requirements
|
||||
|
||||
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
|
||||
["<div class='player-controls'>",
|
||||
"<div class='player-progress'>",
|
||||
"<label for='seek{id}' class='sr-only'>Seek</label>",
|
||||
"<input id='seek{id}' class='player-progress-seek' type='range' min='0' max='100' step='0.5' value='0' data-player='seek'>",
|
||||
"<progress class='player-progress-played' max='100' value='0'>",
|
||||
"<span>0</span>% played",
|
||||
"</progress>",
|
||||
"<progress class='player-progress-buffer' max='100' value='0'>",
|
||||
"<span>0</span>% buffered",
|
||||
"</progress>",
|
||||
"</div>",
|
||||
"<span class='player-controls-left'>",
|
||||
"<button type='button' data-player='restart'>",
|
||||
"<svg><use xlink:href='#icon-restart'></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 {seektime} secs</span>",
|
||||
"</button>",
|
||||
"<button type='button' 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'>Forward {seektime} secs</span>",
|
||||
"</button>",
|
||||
"<span class='player-time'>",
|
||||
"<span class='sr-only'>Current time</span>",
|
||||
"<span class='player-current-time'>00:00</span>",
|
||||
"</span>",
|
||||
"<span class='player-time'>",
|
||||
"<span class='sr-only'>Duration</span>",
|
||||
"<span class='player-duration'>00:00</span>",
|
||||
"</span>",
|
||||
"</span>",
|
||||
"<span class='player-controls-right'>",
|
||||
"<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-volume'></use></svg>",
|
||||
"<span class='sr-only'>Toggle 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 class='icon-captions-on'><use xlink:href='#icon-captions-on'></use></svg>",
|
||||
"<svg><use xlink:href='#icon-captions-off'></use></svg>",
|
||||
"<span class='sr-only'>Toggle Captions</span>",
|
||||
"</label>",
|
||||
"<button type='button' data-player='fullscreen'>",
|
||||
"<svg class='icon-exit-fullscreen'><use xlink:href='#icon-exit-fullscreen'></use></svg>",
|
||||
"<svg><use xlink:href='#icon-enter-fullscreen'></use></svg>",
|
||||
"<span class='sr-only'>Toggle Fullscreen</span>",
|
||||
"</button>",
|
||||
"</span>",
|
||||
"</div>"].join("\n");
|
||||
```
|
36
cspell.json
Normal file
36
cspell.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"version": "0.2",
|
||||
"ignorePaths": ["package.json", "dist/*", "demo/node_modules/*"],
|
||||
"dictionaryDefinitions": [],
|
||||
"dictionaries": ["en-gb", "softwareTerms", "html", "css", "typescript"],
|
||||
"words": [
|
||||
"autopause",
|
||||
"autoplay",
|
||||
"bote",
|
||||
"cfda",
|
||||
"classname",
|
||||
"digbmx",
|
||||
"fastly",
|
||||
"fullscreen",
|
||||
"gordita",
|
||||
"loadjs",
|
||||
"magazin",
|
||||
"menuitemradio",
|
||||
"noupe",
|
||||
"otransitionend",
|
||||
"playsinline",
|
||||
"plyr",
|
||||
"rutheneum",
|
||||
"seektime",
|
||||
"selz",
|
||||
"sparkk",
|
||||
"srclang",
|
||||
"strol",
|
||||
"stylelint",
|
||||
"unmute",
|
||||
"videospiele",
|
||||
"xywh"
|
||||
],
|
||||
"ignoreWords": [],
|
||||
"import": []
|
||||
}
|
31
demo/error.html
Normal file
31
demo/error.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!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">
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="icon" href="https://cdn.plyr.io/static/icons/favicon.ico">
|
||||
<link rel="icon" type="image/png" href="https://cdn.plyr.io/static/icons/32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.plyr.io/static/icons/16x16.png" sizes="16x16">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.plyr.io/static/icons/180x180.png">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="dist/error.css?v=2">
|
||||
|
||||
<!-- Preload -->
|
||||
<link rel="preload" as="font" crossorigin type="font/woff2" href="https://cdn.plyr.io/static/fonts/gordita-medium.woff2">
|
||||
<link rel="preload" as="font" crossorigin type="font/woff2" href="https://cdn.plyr.io/static/fonts/gordita-bold.woff2">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<h1>Doh.</h1>
|
||||
<p>Looks like something went wrong.</p>
|
||||
<a href="javascript:history.back()" class="button">Go back</a>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
267
demo/index.html
Normal file
267
demo/index.html
Normal file
@ -0,0 +1,267 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Plyr - A simple, customizable HTML5 Video, Audio, YouTube and Vimeo player</title>
|
||||
<meta
|
||||
name="description"
|
||||
property="og: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" />
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="icon" href="https://cdn.plyr.io/static/icons/favicon.ico" />
|
||||
<link rel="icon" type="image/png" href="https://cdn.plyr.io/static/icons/32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="https://cdn.plyr.io/static/icons/16x16.png" sizes="16x16" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.plyr.io/static/icons/180x180.png" />
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:title" content="Plyr - A simple, customizable HTML5 Video, Audio, YouTube and Vimeo player" />
|
||||
<meta property="og:site_name" content="Plyr" />
|
||||
<meta property="og:url" content="https://plyr.io" />
|
||||
<meta property="og:image" content="https://cdn.plyr.io/static/icons/1200x630.png" />
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:site" content="@sam_potts" />
|
||||
<meta name="twitter:creator" content="@sam_potts" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="dist/demo.css" />
|
||||
|
||||
<!-- Preload -->
|
||||
<link
|
||||
rel="preload"
|
||||
as="font"
|
||||
crossorigin
|
||||
type="font/woff2"
|
||||
href="https://cdn.plyr.io/static/fonts/gordita-medium.woff2"
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
as="font"
|
||||
crossorigin
|
||||
type="font/woff2"
|
||||
href="https://cdn.plyr.io/static/fonts/gordita-bold.woff2"
|
||||
/>
|
||||
|
||||
<!-- Google Analytics-->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-132699580-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-132699580-1');
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="grid">
|
||||
<header>
|
||||
<h1>Pl<span>a</span>y<span>e</span>r</h1>
|
||||
<p>
|
||||
A simple, accessible and customisable media player for
|
||||
<button type="button" class="link" data-source="video">
|
||||
<svg class="icon">
|
||||
<title>HTML5</title>
|
||||
<path
|
||||
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
|
||||
></path>
|
||||
</svg>
|
||||
Video</button
|
||||
>,
|
||||
<button type="button" class="link" data-source="audio">
|
||||
<svg class="icon">
|
||||
<title>HTML5</title>
|
||||
<path
|
||||
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
|
||||
></path>
|
||||
</svg>
|
||||
Audio</button
|
||||
>,
|
||||
<button type="button" class="link" data-source="youtube">
|
||||
<svg class="icon" role="presentation">
|
||||
<title>YouTube</title>
|
||||
<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"
|
||||
></path>
|
||||
</svg>
|
||||
YouTube
|
||||
</button>
|
||||
and
|
||||
<button type="button" class="link" data-source="vimeo">
|
||||
<svg class="icon" role="presentation">
|
||||
<title>Vimeo</title>
|
||||
<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"
|
||||
></path>
|
||||
</svg>
|
||||
Vimeo
|
||||
</button>
|
||||
</p>
|
||||
|
||||
<div class="call-to-action">
|
||||
<a href="https://github.com/sampotts/plyr" target="_blank" class="button js-shr">
|
||||
<svg class="icon" role="presentation">
|
||||
<title>GitHub</title>
|
||||
<path
|
||||
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"
|
||||
></path>
|
||||
</svg>
|
||||
Download on GitHub
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div id="container">
|
||||
<video
|
||||
controls
|
||||
crossorigin
|
||||
playsinline
|
||||
data-poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg"
|
||||
id="player"
|
||||
>
|
||||
<!-- Video files -->
|
||||
<source
|
||||
src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4"
|
||||
type="video/mp4"
|
||||
size="576"
|
||||
/>
|
||||
<source
|
||||
src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4"
|
||||
type="video/mp4"
|
||||
size="720"
|
||||
/>
|
||||
<source
|
||||
src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4"
|
||||
type="video/mp4"
|
||||
size="1080"
|
||||
/>
|
||||
|
||||
<!-- Caption files -->
|
||||
<track
|
||||
kind="captions"
|
||||
label="English"
|
||||
srclang="en"
|
||||
src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt"
|
||||
default
|
||||
/>
|
||||
<track
|
||||
kind="captions"
|
||||
label="Français"
|
||||
srclang="fr"
|
||||
src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.fr.vtt"
|
||||
/>
|
||||
|
||||
<!-- Fallback for browsers that don't support the <video> element -->
|
||||
<a href="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4" download>Download</a>
|
||||
</video>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li class="plyr__cite plyr__cite--video" hidden>
|
||||
<small>
|
||||
<svg class="icon">
|
||||
<title>HTML5</title>
|
||||
<path
|
||||
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
|
||||
></path>
|
||||
</svg>
|
||||
<a
|
||||
href="https://itunes.apple.com/au/movie/view-from-a-blue-moon/id1041586323"
|
||||
target="_blank"
|
||||
class="link"
|
||||
>View From A Blue Moon</a
|
||||
>
|
||||
© Brainfarm
|
||||
</small>
|
||||
</li>
|
||||
<li class="plyr__cite plyr__cite--audio" hidden>
|
||||
<small>
|
||||
<svg class="icon" title="HTML5">
|
||||
<title>HTML5</title>
|
||||
<path
|
||||
d="M14.738.326C14.548.118 14.28 0 14 0H2c-.28 0-.55.118-.738.326S.98.81 1.004 1.09l1 11c.03.317.208.603.48.767l5 3c.16.095.338.143.516.143s.356-.048.515-.143l5-3c.273-.164.452-.45.48-.767l1-11c.026-.28-.067-.557-.257-.764zM12 4H6v2h6v5.72l-4 1.334-4-1.333V9h2v1.28l2 .666 2-.667V8H4V2h8v2z"
|
||||
></path>
|
||||
</svg>
|
||||
<a href="http://www.kishibashi.com/" target="_blank" class="link"
|
||||
>Kishi Bashi – “It All Began With A Burst”</a
|
||||
>
|
||||
© Kishi Bashi
|
||||
</small>
|
||||
</li>
|
||||
<li class="plyr__cite plyr__cite--youtube" hidden>
|
||||
<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" role="presentation">
|
||||
<title>YouTube</title>
|
||||
<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"
|
||||
></path></svg
|
||||
>YouTube
|
||||
</span>
|
||||
</small>
|
||||
</li>
|
||||
<li class="plyr__cite plyr__cite--vimeo" hidden>
|
||||
<small>
|
||||
<a href="https://vimeo.com/40648169" target="_blank" class="link">Toob “Wavaphon” Music Video</a>
|
||||
on
|
||||
<span class="color--vimeo">
|
||||
<svg class="icon" role="presentation">
|
||||
<title>Vimeo</title>
|
||||
<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"
|
||||
></path></svg
|
||||
>Vimeo
|
||||
</span>
|
||||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<aside>
|
||||
<svg class="icon">
|
||||
<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"
|
||||
></path>
|
||||
</svg>
|
||||
<p>
|
||||
If you think Plyr's good,
|
||||
<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="link js-shr"
|
||||
>tweet it</a
|
||||
>
|
||||
👍
|
||||
</p>
|
||||
</aside>
|
||||
|
||||
<script src="dist/demo.js" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
29
demo/media/View_From_A_Blue_Moon_Trailer-HD.en.vtt
Normal file
29
demo/media/View_From_A_Blue_Moon_Trailer-HD.en.vtt
Normal file
@ -0,0 +1,29 @@
|
||||
WEBVTT FILE
|
||||
|
||||
1
|
||||
00:00:09.500 --> 00:00:12.000
|
||||
The ocean floor rises 5 miles to the shores
|
||||
|
||||
2
|
||||
00:00:12.001 --> 00:00:16.500
|
||||
of what people call, the seven mile miracle
|
||||
|
||||
3
|
||||
00:00:25.500 --> 00:00:28.000
|
||||
What would it be like to be born on this island?
|
||||
|
||||
4
|
||||
00:00:32.500 --> 00:00:34.500
|
||||
To grow up on these shores
|
||||
|
||||
5
|
||||
00:00:37.500 --> 00:00:40.000
|
||||
To witness this water, every day
|
||||
|
||||
6
|
||||
00:00:43.500 --> 00:00:46.000
|
||||
You're about to meet someone, who did
|
||||
|
||||
7
|
||||
00:02:45.500 --> 00:02:49.000
|
||||
This is a film about John John Florence
|
29
demo/media/View_From_A_Blue_Moon_Trailer-HD.fr.vtt
Normal file
29
demo/media/View_From_A_Blue_Moon_Trailer-HD.fr.vtt
Normal file
@ -0,0 +1,29 @@
|
||||
WEBVTT FILE
|
||||
|
||||
1
|
||||
00:00:09.500 --> 00:00:12.000
|
||||
Le fond de l'océan monte 5 miles des rives
|
||||
|
||||
2
|
||||
00:00:12.001 --> 00:00:16.500
|
||||
de ce que les gens appellent le miracle de sept mile
|
||||
|
||||
3
|
||||
00:00:25.500 --> 00:00:28.000
|
||||
Que serait-il d'être né sur cette île?
|
||||
|
||||
4
|
||||
00:00:32.500 --> 00:00:34.500
|
||||
Pour grandir sur ces rivages
|
||||
|
||||
5
|
||||
00:00:37.500 --> 00:00:40.000
|
||||
Pour assister à cette eau, tous les jours
|
||||
|
||||
6
|
||||
00:00:43.500 --> 00:00:46.000
|
||||
Vous êtes sur le point de rencontrer quelqu'un, qui ne
|
||||
|
||||
7
|
||||
00:02:45.500 --> 00:02:49.000
|
||||
Ceci est un film sur John John Florence
|
BIN
demo/media/View_From_A_Blue_Moon_Trailer-HD.jpg
Normal file
BIN
demo/media/View_From_A_Blue_Moon_Trailer-HD.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 154 KiB |
14
demo/package.json
Normal file
14
demo/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "plyr-demo",
|
||||
"version": "1.0.0",
|
||||
"description": "Demo for Plyr",
|
||||
"homepage": "https://plyr.io",
|
||||
"author": "Sam Potts <sam@potts.es>",
|
||||
"dependencies": {
|
||||
"@sentry/browser": "^5.22.3",
|
||||
"core-js": "^3.6.5",
|
||||
"custom-event-polyfill": "^1.0.7",
|
||||
"shr-buttons": "2.0.3",
|
||||
"url-polyfill": "^1.1.10"
|
||||
}
|
||||
}
|
176
demo/src/js/demo.js
Normal file
176
demo/src/js/demo.js
Normal file
@ -0,0 +1,176 @@
|
||||
// ==========================================================================
|
||||
// Plyr.io demo
|
||||
// This code is purely for the https://plyr.io website
|
||||
// Please see README.md in the root or github.com/sampotts/plyr
|
||||
// ==========================================================================
|
||||
|
||||
import 'custom-event-polyfill';
|
||||
import 'url-polyfill';
|
||||
|
||||
import * as Sentry from '@sentry/browser';
|
||||
import Shr from 'shr-buttons';
|
||||
|
||||
import Plyr from '../../../src/js/plyr';
|
||||
import sources from './sources';
|
||||
|
||||
(() => {
|
||||
const production = 'plyr.io';
|
||||
const isProduction = window.location.host.includes(production);
|
||||
|
||||
// Sentry for demo site (https://plyr.io) only
|
||||
if (isProduction) {
|
||||
Sentry.init({
|
||||
dsn: 'https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555',
|
||||
whitelistUrls: [production].map((d) => new RegExp(`https://(([a-z0-9])+(.))*${d}`)),
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const selector = '#player';
|
||||
|
||||
// Setup share buttons
|
||||
Shr.setup('.js-shr', {
|
||||
count: {
|
||||
className: 'button__count',
|
||||
},
|
||||
wrapper: {
|
||||
className: 'button--with-count',
|
||||
},
|
||||
});
|
||||
|
||||
// Setup the player
|
||||
const player = new Plyr(selector, {
|
||||
debug: true,
|
||||
title: 'View From A Blue Moon',
|
||||
iconUrl: 'dist/demo.svg',
|
||||
keyboard: {
|
||||
global: true,
|
||||
},
|
||||
tooltips: {
|
||||
controls: true,
|
||||
},
|
||||
captions: {
|
||||
active: true,
|
||||
},
|
||||
/* ads: {
|
||||
enabled: isProduction,
|
||||
publisherId: '918848828995742',
|
||||
}, */
|
||||
previewThumbnails: {
|
||||
enabled: true,
|
||||
src: ['https://cdn.plyr.io/static/demo/thumbs/100p.vtt', 'https://cdn.plyr.io/static/demo/thumbs/240p.vtt'],
|
||||
},
|
||||
vimeo: {
|
||||
// Prevent Vimeo blocking plyr.io demo site
|
||||
referrerPolicy: 'no-referrer',
|
||||
},
|
||||
mediaMetadata: {
|
||||
title: 'View From A Blue Moon',
|
||||
album: 'Sports',
|
||||
artist: 'Brainfarm',
|
||||
artwork: [
|
||||
{
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg',
|
||||
type: 'image/jpeg',
|
||||
},
|
||||
],
|
||||
},
|
||||
markers: {
|
||||
enabled: true,
|
||||
points: [
|
||||
{
|
||||
time: 10,
|
||||
label: 'first marker',
|
||||
},
|
||||
{
|
||||
time: 40,
|
||||
label: 'second marker',
|
||||
},
|
||||
{
|
||||
time: 120,
|
||||
label: '<strong>third</strong> marker',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
// Expose for tinkering in the console
|
||||
window.player = player;
|
||||
|
||||
// Setup type toggle
|
||||
const buttons = document.querySelectorAll('[data-source]');
|
||||
const types = Object.keys(sources);
|
||||
const historySupport = Boolean(window.history && window.history.pushState);
|
||||
let currentType = window.location.hash.substring(1);
|
||||
const hasInitialType = currentType.length;
|
||||
|
||||
function render(type) {
|
||||
// Remove active classes
|
||||
Array.from(buttons).forEach((button) => button.parentElement.classList.toggle('active', false));
|
||||
|
||||
// Set active on parent
|
||||
document.querySelector(`[data-source="${type}"]`).classList.toggle('active', true);
|
||||
|
||||
// Show cite
|
||||
Array.from(document.querySelectorAll('.plyr__cite')).forEach((cite) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
cite.hidden = true;
|
||||
});
|
||||
|
||||
document.querySelector(`.plyr__cite--${type}`).hidden = false;
|
||||
}
|
||||
|
||||
// Set a new source
|
||||
function setSource(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 (!types.includes(type) || (!init && type === currentType) || (!currentType.length && type === 'video')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the new source
|
||||
player.source = sources[type];
|
||||
|
||||
// Set the current type for next time
|
||||
currentType = type;
|
||||
|
||||
render(type);
|
||||
}
|
||||
|
||||
// Bind to each button
|
||||
Array.from(buttons).forEach((button) => {
|
||||
button.addEventListener('click', () => {
|
||||
const type = button.getAttribute('data-source');
|
||||
|
||||
setSource(type);
|
||||
|
||||
if (historySupport) {
|
||||
window.history.pushState({ type }, '', `#${type}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// List for backwards/forwards
|
||||
window.addEventListener('popstate', (event) => {
|
||||
if (event.state && Object.keys(event.state).includes('type')) {
|
||||
setSource(event.state.type);
|
||||
}
|
||||
});
|
||||
|
||||
// If there's no current type set, assume video
|
||||
if (!hasInitialType) {
|
||||
currentType = 'video';
|
||||
}
|
||||
|
||||
// Replace current history state
|
||||
if (historySupport && types.includes(currentType)) {
|
||||
window.history.replaceState({ type: currentType }, '', hasInitialType ? `#${currentType}` : '');
|
||||
}
|
||||
|
||||
// If it's not video, load the source
|
||||
if (currentType !== 'video') {
|
||||
setSource(currentType, true);
|
||||
}
|
||||
|
||||
render(currentType);
|
||||
});
|
||||
})();
|
81
demo/src/js/sources.js
Normal file
81
demo/src/js/sources.js
Normal file
@ -0,0 +1,81 @@
|
||||
const sources = {
|
||||
video: {
|
||||
type: 'video',
|
||||
title: 'View From A Blue Moon',
|
||||
sources: [
|
||||
{
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4',
|
||||
type: 'video/mp4',
|
||||
size: 576,
|
||||
},
|
||||
{
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4',
|
||||
type: 'video/mp4',
|
||||
size: 720,
|
||||
},
|
||||
{
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4',
|
||||
type: 'video/mp4',
|
||||
size: 1080,
|
||||
},
|
||||
{
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1440p.mp4',
|
||||
type: 'video/mp4',
|
||||
size: 1440,
|
||||
},
|
||||
],
|
||||
poster: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg',
|
||||
tracks: [
|
||||
{
|
||||
kind: 'captions',
|
||||
label: 'English',
|
||||
srclang: 'en',
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
kind: 'captions',
|
||||
label: 'French',
|
||||
srclang: 'fr',
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.fr.vtt',
|
||||
},
|
||||
],
|
||||
previewThumbnails: {
|
||||
src: ['https://cdn.plyr.io/static/demo/thumbs/100p.vtt', 'https://cdn.plyr.io/static/demo/thumbs/240p.vtt'],
|
||||
},
|
||||
},
|
||||
audio: {
|
||||
type: 'audio',
|
||||
title: 'Kishi Bashi – “It All Began With A Burst”',
|
||||
sources: [
|
||||
{
|
||||
src: 'https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3',
|
||||
type: 'audio/mp3',
|
||||
},
|
||||
{
|
||||
src: 'https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg',
|
||||
type: 'audio/ogg',
|
||||
},
|
||||
],
|
||||
},
|
||||
youtube: {
|
||||
type: 'video',
|
||||
sources: [
|
||||
{
|
||||
src: 'https://youtube.com/watch?v=bTqVqk7FSmY',
|
||||
provider: 'youtube',
|
||||
},
|
||||
],
|
||||
},
|
||||
vimeo: {
|
||||
type: 'video',
|
||||
sources: [
|
||||
{
|
||||
src: 'https://vimeo.com/40648169',
|
||||
provider: 'vimeo',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export default sources;
|
51
demo/src/sass/bundles/demo.scss
Normal file
51
demo/src/sass/bundles/demo.scss
Normal file
@ -0,0 +1,51 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
// ==========================================================================
|
||||
// Plyr.io Demo Page
|
||||
// ==========================================================================
|
||||
|
||||
@import '../../../../src/sass/lib/css-vars';
|
||||
|
||||
$css-vars-use-native: true;
|
||||
|
||||
// Settings
|
||||
@import '../settings/breakpoints';
|
||||
@import '../settings/colors';
|
||||
@import '../settings/cosmetic';
|
||||
@import '../settings/icons';
|
||||
@import '../settings/layout';
|
||||
@import '../settings/plyr';
|
||||
@import '../settings/spacing';
|
||||
@import '../settings/type';
|
||||
|
||||
// Libs
|
||||
@import '../lib/fontface';
|
||||
@import '../lib/animation';
|
||||
@import '../lib/mixins';
|
||||
@import '../lib/normalize';
|
||||
@import '../lib/reset';
|
||||
|
||||
// Layout
|
||||
@import '../layout/core';
|
||||
@import '../layout/grid';
|
||||
|
||||
// Type
|
||||
@import '../type/base';
|
||||
@import '../type/headings';
|
||||
|
||||
// Components
|
||||
@import '../components/buttons';
|
||||
@import '../components/header';
|
||||
@import '../components/icons';
|
||||
@import '../components/links';
|
||||
@import '../components/lists';
|
||||
@import '../components/media';
|
||||
@import '../components/navigation';
|
||||
@import '../components/players';
|
||||
|
||||
// Plyr
|
||||
@import '../../../../src/sass/plyr';
|
||||
|
||||
// Utils
|
||||
@import '../utilities/cosmetic';
|
||||
@import '../utilities/hidden';
|
30
demo/src/sass/bundles/error.scss
Normal file
30
demo/src/sass/bundles/error.scss
Normal file
@ -0,0 +1,30 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
// ==========================================================================
|
||||
// Plyr.io Error Page
|
||||
// ==========================================================================
|
||||
|
||||
// Settings
|
||||
@import '../settings/colors';
|
||||
@import '../settings/cosmetic';
|
||||
@import '../settings/icons';
|
||||
@import '../settings/layout';
|
||||
@import '../settings/spacing';
|
||||
@import '../settings/type';
|
||||
|
||||
// Libs
|
||||
@import '../lib/fontface';
|
||||
@import '../lib/mixins';
|
||||
@import '../lib/normalize';
|
||||
@import '../lib/reset';
|
||||
|
||||
// Layout
|
||||
@import '../layout/error';
|
||||
|
||||
// Type
|
||||
@import '../type/base';
|
||||
@import '../type/headings';
|
||||
|
||||
// Components
|
||||
@import '../components/buttons';
|
||||
@import '../components/links';
|
89
demo/src/sass/components/buttons.scss
Normal file
89
demo/src/sass/components/buttons.scss
Normal file
@ -0,0 +1,89 @@
|
||||
// ==========================================================================
|
||||
// Buttons
|
||||
// ==========================================================================
|
||||
|
||||
// Shared
|
||||
.button,
|
||||
.button__count {
|
||||
align-items: center;
|
||||
border: 0;
|
||||
border-radius: $border-radius-medium;
|
||||
display: inline-flex;
|
||||
padding: ($spacing-base * 0.75);
|
||||
position: relative;
|
||||
text-shadow: none;
|
||||
user-select: none;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
.button {
|
||||
--shadow-color: 0deg 0% 20%;
|
||||
align-items: center;
|
||||
background-color: $color-button-background;
|
||||
background-image: linear-gradient(0deg, transparent, rgba(255, 255, 255, 0.05));
|
||||
border: 1px solid darken($color-button-background, 5);
|
||||
box-shadow: 0 0.8px 1px hsl(var(--shadow-color) / 0.05), 0 1.3px 1.6px -1px hsl(var(--shadow-color) / 0.06),
|
||||
0 2.8px 3.4px -2px hsl(var(--shadow-color) / 0.07);
|
||||
color: $color-button-text;
|
||||
display: inline-flex;
|
||||
font-weight: $font-weight-bold;
|
||||
gap: 0.25rem;
|
||||
padding-left: ($spacing-base * 1.25);
|
||||
padding-right: ($spacing-base * 1.25);
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background: $color-button-background-hover;
|
||||
border-color: darken($color-button-background, 7);
|
||||
|
||||
// Remove the underline/border
|
||||
&::after {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
@include focus-visible($color-button-background);
|
||||
}
|
||||
|
||||
&:active {
|
||||
box-shadow: none;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Count bubble
|
||||
.button__count {
|
||||
animation: fade-in 0.2s ease;
|
||||
background: $color-button-count-background;
|
||||
border: 1px solid $color-gray-100;
|
||||
color: $color-button-count-text;
|
||||
margin-left: ($spacing-base * 0.75);
|
||||
|
||||
&::before {
|
||||
background-color: $color-button-count-background;
|
||||
border: inherit;
|
||||
border-width: 0 0 1px 1px;
|
||||
content: '';
|
||||
display: block;
|
||||
height: 8px;
|
||||
position: absolute;
|
||||
right: 100%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%) translateX(50%) translateX(-1px) rotate(45deg);
|
||||
width: 8px;
|
||||
}
|
||||
}
|
30
demo/src/sass/components/header.scss
Normal file
30
demo/src/sass/components/header.scss
Normal file
@ -0,0 +1,30 @@
|
||||
// ==========================================================================
|
||||
// Header
|
||||
// ==========================================================================
|
||||
|
||||
header {
|
||||
padding-bottom: $spacing-base;
|
||||
text-align: center;
|
||||
|
||||
h1 span {
|
||||
animation: shrink-hide 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 2s forwards;
|
||||
display: inline-block;
|
||||
font-weight: $font-weight-light;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.call-to-action {
|
||||
margin-top: ($spacing-base * 1.5);
|
||||
}
|
||||
|
||||
@media only screen and (min-width: $screen-md) {
|
||||
margin-right: ($spacing-base * 3);
|
||||
max-width: 360px;
|
||||
padding-bottom: ($spacing-base * 2);
|
||||
text-align: left;
|
||||
|
||||
p:first-of-type {
|
||||
@include font-size($font-size-base + 1);
|
||||
}
|
||||
}
|
||||
}
|
25
demo/src/sass/components/icons.scss
Normal file
25
demo/src/sass/components/icons.scss
Normal file
@ -0,0 +1,25 @@
|
||||
// ==========================================================================
|
||||
// Icons
|
||||
// ==========================================================================
|
||||
|
||||
@use 'sass:math';
|
||||
|
||||
// Base size icon styles
|
||||
.icon {
|
||||
fill: currentColor;
|
||||
height: $icon-size;
|
||||
vertical-align: -3px;
|
||||
width: $icon-size;
|
||||
}
|
||||
|
||||
// Within elements
|
||||
a svg,
|
||||
button svg,
|
||||
label svg {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
a .icon,
|
||||
.btn .icon {
|
||||
margin-right: math.div($spacing-base, 4);
|
||||
}
|
42
demo/src/sass/components/links.scss
Normal file
42
demo/src/sass/components/links.scss
Normal file
@ -0,0 +1,42 @@
|
||||
// ==========================================================================
|
||||
// Links
|
||||
// ==========================================================================
|
||||
|
||||
.link {
|
||||
align-items: center;
|
||||
border-bottom: 1px dashed currentColor;
|
||||
color: $color-link;
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&::after {
|
||||
background: currentColor;
|
||||
content: '';
|
||||
height: 1px;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
transform: translateX(-50%);
|
||||
transition: width 0.2s ease;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
border-bottom-color: transparent;
|
||||
outline: 0;
|
||||
|
||||
&::after {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
@include focus-visible($color-link);
|
||||
}
|
||||
|
||||
&.no-border::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
// ==========================================================================
|
||||
// Animations
|
||||
// Lists
|
||||
// ==========================================================================
|
||||
|
||||
// Fade
|
||||
@keyframes fade-in {
|
||||
0% { opacity: 0 }
|
||||
100% { opacity: 1 }
|
||||
}
|
||||
// Lists
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
10
demo/src/sass/components/media.scss
Normal file
10
demo/src/sass/components/media.scss
Normal file
@ -0,0 +1,10 @@
|
||||
// ==========================================================================
|
||||
// Basic media
|
||||
// ==========================================================================
|
||||
|
||||
img,
|
||||
video,
|
||||
audio {
|
||||
max-width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
9
demo/src/sass/components/navigation.scss
Normal file
9
demo/src/sass/components/navigation.scss
Normal file
@ -0,0 +1,9 @@
|
||||
// ==========================================================================
|
||||
// Navigation
|
||||
// ==========================================================================
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: $spacing-base;
|
||||
}
|
41
demo/src/sass/components/players.scss
Normal file
41
demo/src/sass/components/players.scss
Normal file
@ -0,0 +1,41 @@
|
||||
// ==========================================================================
|
||||
// Examples
|
||||
// ==========================================================================
|
||||
|
||||
@use 'sass:math';
|
||||
|
||||
// Example players
|
||||
.plyr {
|
||||
--shadow-color: 197deg 32% 65%;
|
||||
border-radius: $border-radius-2x-large;
|
||||
box-shadow: 0 0.5px 0.6px hsl(var(--shadow-color) / 0.36), 0 1.7px 1.9px -0.8px hsl(var(--shadow-color) / 0.36),
|
||||
0 4.3px 4.8px -1.7px hsl(var(--shadow-color) / 0.36), -0.1px 10.6px 11.9px -2.5px hsl(var(--shadow-color) / 0.36);
|
||||
margin: $spacing-base auto;
|
||||
|
||||
&.plyr--audio {
|
||||
max-width: 480px;
|
||||
}
|
||||
}
|
||||
|
||||
.plyr__video-wrapper::after {
|
||||
border: 1px solid rgba(#000, 0.15);
|
||||
border-bottom-color: rgba(#000, 0.25);
|
||||
border-radius: inherit;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
// Style full supported player
|
||||
.plyr__cite {
|
||||
color: $color-gray-500;
|
||||
|
||||
.icon {
|
||||
margin-right: math.div($spacing-base, 6);
|
||||
}
|
||||
}
|
66
demo/src/sass/layout/core.scss
Normal file
66
demo/src/sass/layout/core.scss
Normal file
@ -0,0 +1,66 @@
|
||||
// ==========================================================================
|
||||
// Core
|
||||
// ==========================================================================
|
||||
|
||||
@use 'sass:math';
|
||||
|
||||
html,
|
||||
body {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
html {
|
||||
background: $page-background;
|
||||
background-attachment: fixed;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.grid {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
main {
|
||||
margin: auto;
|
||||
padding-bottom: 1px; // Collapsing margins
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
aside {
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
justify-content: center;
|
||||
padding: $spacing-base;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
text-shadow: none;
|
||||
width: 100%;
|
||||
|
||||
.icon {
|
||||
fill: $color-twitter;
|
||||
margin-right: math.div($spacing-base, 2);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $color-twitter;
|
||||
|
||||
&:focus-visible {
|
||||
@include focus-visible($color-twitter);
|
||||
}
|
||||
}
|
||||
}
|
30
demo/src/sass/layout/error.scss
Normal file
30
demo/src/sass/layout/error.scss
Normal file
@ -0,0 +1,30 @@
|
||||
// ==========================================================================
|
||||
// Errors (AWS pages)
|
||||
// ==========================================================================
|
||||
|
||||
// Error page
|
||||
html.error,
|
||||
.error body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
html.error {
|
||||
background: $page-background;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.error body {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.error main {
|
||||
padding: $spacing-base;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
|
||||
p {
|
||||
@include font-size($font-size-large);
|
||||
}
|
||||
}
|
19
demo/src/sass/layout/grid.scss
Normal file
19
demo/src/sass/layout/grid.scss
Normal file
@ -0,0 +1,19 @@
|
||||
// ==========================================================================
|
||||
// Super basic grid
|
||||
// ==========================================================================
|
||||
|
||||
.grid {
|
||||
margin: 0 auto;
|
||||
padding: $spacing-base;
|
||||
|
||||
@media only screen and (min-width: $screen-md) {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
max-width: $container-max-width;
|
||||
width: 100%;
|
||||
|
||||
> * {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
30
demo/src/sass/lib/animation.scss
Normal file
30
demo/src/sass/lib/animation.scss
Normal file
@ -0,0 +1,30 @@
|
||||
// ==========================================================================
|
||||
// Animations
|
||||
// ==========================================================================
|
||||
|
||||
// Fade
|
||||
@keyframes fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes shrink-hide {
|
||||
0% {
|
||||
opacity: 0.5;
|
||||
width: 38px;
|
||||
}
|
||||
|
||||
20% {
|
||||
width: 45px;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
}
|
||||
}
|
48
demo/src/sass/lib/fontface.scss
Normal file
48
demo/src/sass/lib/fontface.scss
Normal file
@ -0,0 +1,48 @@
|
||||
// ==========================================================================
|
||||
// Fonts
|
||||
// ==========================================================================
|
||||
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: Gordita;
|
||||
font-style: normal;
|
||||
font-weight: $font-weight-light;
|
||||
src: url('https://cdn.plyr.io/static/fonts/gordita-light.woff2') format('woff2'),
|
||||
url('https://cdn.plyr.io/static/fonts/gordita-light.woff') format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: Gordita;
|
||||
font-style: normal;
|
||||
font-weight: $font-weight-regular;
|
||||
src: url('https://cdn.plyr.io/static/fonts/gordita-regular.woff2') format('woff2'),
|
||||
url('https://cdn.plyr.io/static/fonts/gordita-regular.woff') format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: Gordita;
|
||||
font-style: normal;
|
||||
font-weight: $font-weight-medium;
|
||||
src: url('https://cdn.plyr.io/static/fonts/gordita-medium.woff2') format('woff2'),
|
||||
url('https://cdn.plyr.io/static/fonts/gordita-medium.woff') format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: Gordita;
|
||||
font-style: normal;
|
||||
font-weight: $font-weight-bold;
|
||||
src: url('https://cdn.plyr.io/static/fonts/gordita-bold.woff2') format('woff2'),
|
||||
url('https://cdn.plyr.io/static/fonts/gordita-bold.woff') format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: Gordita;
|
||||
font-style: normal;
|
||||
font-weight: $font-weight-black;
|
||||
src: url('https://cdn.plyr.io/static/fonts/gordita-black.woff2') format('woff2'),
|
||||
url('https://cdn.plyr.io/static/fonts/gordita-black.woff') format('woff');
|
||||
}
|
37
demo/src/sass/lib/mixins.scss
Normal file
37
demo/src/sass/lib/mixins.scss
Normal file
@ -0,0 +1,37 @@
|
||||
// ==========================================================================
|
||||
// Mixins
|
||||
// ==========================================================================
|
||||
|
||||
@use 'sass:math';
|
||||
|
||||
// Nicer focus styles
|
||||
// ---------------------------------------
|
||||
@mixin focus-visible($color: $focus-default-color) {
|
||||
outline: 2px dashed $color;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
// Use rems for font sizing
|
||||
// Leave <body> at 100%/16px
|
||||
// ---------------------------------------
|
||||
@function calculate-rem($size) {
|
||||
$rem: math.div($size, 16);
|
||||
@return #{$rem}rem;
|
||||
}
|
||||
|
||||
@mixin font-size($size: $font-size-base) {
|
||||
font-size: $size * 1px; // Fallback in px
|
||||
font-size: calculate-rem($size);
|
||||
}
|
||||
|
||||
// Font smoothing
|
||||
// ---------------------------------------
|
||||
@mixin font-smoothing($enabled: true) {
|
||||
@if $enabled {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
} @else {
|
||||
-moz-osx-font-smoothing: auto;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
}
|
||||
}
|
449
demo/src/sass/lib/normalize.scss
vendored
Normal file
449
demo/src/sass/lib/normalize.scss
vendored
Normal file
@ -0,0 +1,449 @@
|
||||
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
/* Document
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Correct the line height in all browsers.
|
||||
* 2. Prevent adjustments of font size after orientation changes in
|
||||
* IE on Windows Phone and in iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
line-height: 1.15; /* 1 */
|
||||
text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/* Sections
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the margin in all browsers (opinionated).
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
footer,
|
||||
header,
|
||||
nav,
|
||||
section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
* 1. Add the correct display in IE.
|
||||
*/
|
||||
|
||||
figcaption,
|
||||
figure,
|
||||
main {
|
||||
/* 1 */
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct margin in IE 8.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; /* 1 */
|
||||
height: 0; /* 1 */
|
||||
overflow: visible; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
font-family: monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Remove the gray background on active links in IE 10.
|
||||
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent; /* 1 */
|
||||
text-decoration-skip: objects; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 0; /* 1 */
|
||||
text-decoration: underline; /* 2 */
|
||||
text-decoration: underline dotted; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font style in Android 4.3-.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct background and color in IE 9-.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background-color: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
audio,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in iOS 4-7.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10-.
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the overflow in IE.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change the font styles in all browsers (opinionated).
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: sans-serif; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
line-height: 1.15; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
/* 1 */
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
/* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
|
||||
* controls in Android 4.
|
||||
* 2. Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
html [type='button'],
|
||||
[type='reset'],
|
||||
[type='submit'] {
|
||||
appearance: button; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type='button']::-moz-focus-inner,
|
||||
[type='reset']::-moz-focus-inner,
|
||||
[type='submit']::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
button:-moz-focusring,
|
||||
[type='button']:-moz-focusring,
|
||||
[type='reset']:-moz-focusring,
|
||||
[type='submit']:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the padding in Firefox.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
padding: 0.35em 0.75em 0.625em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
box-sizing: border-box; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
display: table; /* 1 */
|
||||
max-width: 100%; /* 1 */
|
||||
padding: 0; /* 3 */
|
||||
white-space: normal; /* 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct display in IE 9-.
|
||||
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
progress {
|
||||
display: inline-block; /* 1 */
|
||||
vertical-align: baseline; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10-.
|
||||
* 2. Remove the padding in IE 10-.
|
||||
*/
|
||||
|
||||
[type='checkbox'],
|
||||
[type='radio'] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
|
||||
[type='number']::-webkit-inner-spin-button,
|
||||
[type='number']::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type='search'] {
|
||||
appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
[type='search']::-webkit-search-cancel-button,
|
||||
[type='search']::-webkit-search-decoration {
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/* Interactive
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Add the correct display in IE 9-.
|
||||
* 1. Add the correct display in Edge, IE, and Firefox.
|
||||
*/
|
||||
|
||||
details,
|
||||
menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* Scripting
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
canvas {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE.
|
||||
*/
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hidden
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10-.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
15
demo/src/sass/lib/reset.scss
Normal file
15
demo/src/sass/lib/reset.scss
Normal file
@ -0,0 +1,15 @@
|
||||
// ==========================================================================
|
||||
// Resets
|
||||
// ==========================================================================
|
||||
|
||||
// BORDER-BOX ALL THE THINGS!
|
||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||
*,
|
||||
*::after,
|
||||
*::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
button {
|
||||
all: unset;
|
||||
}
|
6
demo/src/sass/settings/breakpoints.scss
Normal file
6
demo/src/sass/settings/breakpoints.scss
Normal file
@ -0,0 +1,6 @@
|
||||
// ==========================================================================
|
||||
// Breakpoints
|
||||
// ==========================================================================
|
||||
|
||||
$screen-sm: 480px;
|
||||
$screen-md: 768px;
|
42
demo/src/sass/settings/colors.scss
Normal file
42
demo/src/sass/settings/colors.scss
Normal file
@ -0,0 +1,42 @@
|
||||
// ==========================================================================
|
||||
// Colors
|
||||
// ==========================================================================
|
||||
|
||||
// Grayscale
|
||||
$color-gray-900: hsl(210deg 15% 16%);
|
||||
$color-gray-800: lighten($color-gray-900, 9%);
|
||||
$color-gray-700: lighten($color-gray-800, 9%);
|
||||
$color-gray-600: lighten($color-gray-700, 9%);
|
||||
$color-gray-500: lighten($color-gray-600, 9%);
|
||||
$color-gray-400: lighten($color-gray-500, 9%);
|
||||
$color-gray-300: lighten($color-gray-400, 9%);
|
||||
$color-gray-200: lighten($color-gray-300, 9%);
|
||||
$color-gray-100: lighten($color-gray-200, 9%);
|
||||
$color-gray-50: lighten($color-gray-100, 9%);
|
||||
|
||||
// Branding
|
||||
$color-brand-primary: hsl(198deg 100% 50%);
|
||||
|
||||
// Text
|
||||
$color-text: $color-gray-700;
|
||||
$color-headings: $color-brand-primary;
|
||||
|
||||
// Brands
|
||||
$color-twitter: #4baaf4;
|
||||
|
||||
// Elements
|
||||
$color-link: $color-brand-primary;
|
||||
|
||||
// Background
|
||||
$color-background-from: hsl(198deg 100% 94%);
|
||||
$color-background-to: hsl(198deg 100% 98%);
|
||||
|
||||
// Buttons
|
||||
$color-button-background: $color-brand-primary;
|
||||
$color-button-text: #fff;
|
||||
$color-button-background-hover: hsl(198deg 100% 55%);
|
||||
$color-button-count-background: #fff;
|
||||
$color-button-count-text: $color-gray-600;
|
||||
|
||||
// Focus
|
||||
$focus-default-color: $color-brand-primary;
|
14
demo/src/sass/settings/cosmetic.scss
Normal file
14
demo/src/sass/settings/cosmetic.scss
Normal file
@ -0,0 +1,14 @@
|
||||
// ==========================================================================
|
||||
// Misc cosmetic
|
||||
// ==========================================================================
|
||||
|
||||
// Button count arrow size
|
||||
$arrow-size: 5px;
|
||||
|
||||
// Radii
|
||||
$border-radius-small: 4px;
|
||||
$border-radius-medium: 6px;
|
||||
$border-radius-2x-large: 12px;
|
||||
|
||||
// Background
|
||||
$page-background: linear-gradient(to left top, $color-background-from, $color-background-to);
|
5
demo/src/sass/settings/icons.scss
Normal file
5
demo/src/sass/settings/icons.scss
Normal file
@ -0,0 +1,5 @@
|
||||
// ==========================================================================
|
||||
// Icons
|
||||
// ==========================================================================
|
||||
|
||||
$icon-size: 16px;
|
5
demo/src/sass/settings/layout.scss
Normal file
5
demo/src/sass/settings/layout.scss
Normal file
@ -0,0 +1,5 @@
|
||||
// ==========================================================================
|
||||
// Layout
|
||||
// ==========================================================================
|
||||
|
||||
$container-max-width: 1240px;
|
18
demo/src/sass/settings/plyr.scss
Normal file
18
demo/src/sass/settings/plyr.scss
Normal file
@ -0,0 +1,18 @@
|
||||
// ==========================================================================
|
||||
// Plyr Settings
|
||||
// ==========================================================================
|
||||
|
||||
@include css-vars(
|
||||
(
|
||||
--plyr-color-main: $color-brand-primary,
|
||||
--plyr-font-size-base: 13px,
|
||||
--plyr-font-size-small: 12px,
|
||||
--plyr-font-size-time: 11px,
|
||||
--plyr-font-size-badges: 9px,
|
||||
--plyr-font-size-menu: var(--plyr-font-size-base),
|
||||
--plyr-font-weight-regular: 500,
|
||||
--plyr-font-weight-bold: 600,
|
||||
--plyr-font-size-captions-medium: 18px,
|
||||
--plyr-font-size-captions-large: 21px,
|
||||
)
|
||||
);
|
5
demo/src/sass/settings/spacing.scss
Normal file
5
demo/src/sass/settings/spacing.scss
Normal file
@ -0,0 +1,5 @@
|
||||
// ==========================================================================
|
||||
// Colors
|
||||
// ==========================================================================
|
||||
|
||||
$spacing-base: 16px;
|
17
demo/src/sass/settings/type.scss
Normal file
17
demo/src/sass/settings/type.scss
Normal file
@ -0,0 +1,17 @@
|
||||
// ==========================================================================
|
||||
// Typography
|
||||
// ==========================================================================
|
||||
|
||||
$font-sans-serif: 'Gordita', 'Avenir', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol';
|
||||
$font-size-base: 15;
|
||||
$font-size-small: 13;
|
||||
$font-size-large: 18;
|
||||
$font-size-h1: 64;
|
||||
$font-weight-light: 300;
|
||||
$font-weight-regular: 400;
|
||||
$font-weight-medium: 500;
|
||||
$font-weight-bold: 600;
|
||||
$font-weight-black: 900;
|
||||
$line-height-base: 1.75;
|
||||
$letter-spacing-headings: -0.025em;
|
36
demo/src/sass/type/base.scss
Normal file
36
demo/src/sass/type/base.scss
Normal file
@ -0,0 +1,36 @@
|
||||
// ==========================================================================
|
||||
// Base
|
||||
// ==========================================================================
|
||||
|
||||
// Set to 100% for rem sizing
|
||||
html {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
@include font-smoothing;
|
||||
@include font-size($font-size-base);
|
||||
|
||||
color: $color-text;
|
||||
font-family: $font-sans-serif;
|
||||
font-weight: $font-weight-medium;
|
||||
line-height: $line-height-base;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
p,
|
||||
small {
|
||||
margin: 0 0 ($spacing-base * 1.5);
|
||||
}
|
||||
|
||||
small {
|
||||
@include font-size($font-size-small);
|
||||
|
||||
display: block;
|
||||
}
|
13
demo/src/sass/type/headings.scss
Normal file
13
demo/src/sass/type/headings.scss
Normal file
@ -0,0 +1,13 @@
|
||||
// ==========================================================================
|
||||
// Headings
|
||||
// ==========================================================================
|
||||
|
||||
h1 {
|
||||
@include font-size($font-size-h1);
|
||||
|
||||
color: $color-headings;
|
||||
font-weight: $font-weight-bold;
|
||||
letter-spacing: $letter-spacing-headings;
|
||||
line-height: 1.2;
|
||||
margin: 0 0 ($spacing-base * 1.5);
|
||||
}
|
7
demo/src/sass/utilities/cosmetic.scss
Normal file
7
demo/src/sass/utilities/cosmetic.scss
Normal file
@ -0,0 +1,7 @@
|
||||
// ==========================================================================
|
||||
// Misc cosmetic
|
||||
// ==========================================================================
|
||||
|
||||
.no-border {
|
||||
border: 0;
|
||||
}
|
4
demo/src/sass/utilities/focus.scss
Normal file
4
demo/src/sass/utilities/focus.scss
Normal file
@ -0,0 +1,4 @@
|
||||
*:focus-visible {
|
||||
outline: 2px dotted $color-brand-primary;
|
||||
outline-offset: 2px;
|
||||
}
|
20
demo/src/sass/utilities/hidden.scss
Normal file
20
demo/src/sass/utilities/hidden.scss
Normal file
@ -0,0 +1,20 @@
|
||||
// ==========================================================================
|
||||
// Hidden
|
||||
// ==========================================================================
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Hide only visually, but have it available for screen readers: h5bp.com/v
|
||||
.sr-only {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
opacity: 0.001;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
80
demo/yarn.lock
Normal file
80
demo/yarn.lock
Normal file
@ -0,0 +1,80 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@sentry/browser@^5.22.3":
|
||||
version "5.22.3"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.22.3.tgz#7a64bd1cf01bf393741a3e4bf35f82aa927f5b4e"
|
||||
integrity sha512-2TzE/CoBa5ZkvxJizDdi1Iz1ldmXSJpFQ1mL07PIXBjCt0Wxf+WOuFSj5IP4L40XHfJE5gU8wEvSH0VDR8nXtA==
|
||||
dependencies:
|
||||
"@sentry/core" "5.22.3"
|
||||
"@sentry/types" "5.22.3"
|
||||
"@sentry/utils" "5.22.3"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/core@5.22.3":
|
||||
version "5.22.3"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.22.3.tgz#030f435f2b518f282ba8bd954dac90cd70888bd7"
|
||||
integrity sha512-eGL5uUarw3o4i9QUb9JoFHnhriPpWCaqeaIBB06HUpdcvhrjoowcKZj1+WPec5lFg5XusE35vez7z/FPzmJUDw==
|
||||
dependencies:
|
||||
"@sentry/hub" "5.22.3"
|
||||
"@sentry/minimal" "5.22.3"
|
||||
"@sentry/types" "5.22.3"
|
||||
"@sentry/utils" "5.22.3"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/hub@5.22.3":
|
||||
version "5.22.3"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.22.3.tgz#08309a70d2ea8d5e313d05840c1711f34f2fffe5"
|
||||
integrity sha512-INo47m6N5HFEs/7GMP9cqxOIt7rmRxdERunA3H2L37owjcr77MwHVeeJ9yawRS6FMtbWXplgWTyTIWIYOuqVbw==
|
||||
dependencies:
|
||||
"@sentry/types" "5.22.3"
|
||||
"@sentry/utils" "5.22.3"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/minimal@5.22.3":
|
||||
version "5.22.3"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.22.3.tgz#706e4029ae5494123d3875c658ba8911aa5cc440"
|
||||
integrity sha512-HoINpYnVYCpNjn2XIPIlqH5o4BAITpTljXjtAftOx6Hzj+Opjg8tR8PWliyKDvkXPpc4kXK9D6TpEDw8MO0wZA==
|
||||
dependencies:
|
||||
"@sentry/hub" "5.22.3"
|
||||
"@sentry/types" "5.22.3"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/types@5.22.3":
|
||||
version "5.22.3"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.22.3.tgz#d1d547b30ee8bd7771fa893af74c4f3d71f0fd18"
|
||||
integrity sha512-cv+VWK0YFgCVDvD1/HrrBWOWYG3MLuCUJRBTkV/Opdy7nkdNjhCAJQrEyMM9zX0sac8FKWKOHT0sykNh8KgmYw==
|
||||
|
||||
"@sentry/utils@5.22.3":
|
||||
version "5.22.3"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.22.3.tgz#e3bda3e789239eb16d436f768daa12829f33d18f"
|
||||
integrity sha512-AHNryXMBvIkIE+GQxTlmhBXD0Ksh+5w1SwM5qi6AttH+1qjWLvV6WB4+4pvVvEoS8t5F+WaVUZPQLmCCWp6zKw==
|
||||
dependencies:
|
||||
"@sentry/types" "5.22.3"
|
||||
tslib "^1.9.3"
|
||||
|
||||
core-js@^3.6.5:
|
||||
version "3.6.5"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a"
|
||||
integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==
|
||||
|
||||
custom-event-polyfill@^1.0.7:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz#9bc993ddda937c1a30ccd335614c6c58c4f87aee"
|
||||
integrity sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==
|
||||
|
||||
shr-buttons@2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/shr-buttons/-/shr-buttons-2.0.3.tgz#2ffd021fc3d789e1510ce2736b938bd09ea1da5a"
|
||||
integrity sha512-sPAgHiw4uaIt9TnxTfyZEedDChcldSVtnBHE44cpe/mSC7rqm4IEKZRLYqnVlTcGM+FSDNBPUNpSf50Q2ntd+w==
|
||||
|
||||
tslib@^1.9.3:
|
||||
version "1.11.1"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
|
||||
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
|
||||
|
||||
url-polyfill@^1.1.10:
|
||||
version "1.1.10"
|
||||
resolved "https://registry.yarnpkg.com/url-polyfill/-/url-polyfill-1.1.10.tgz#fd5bbcf66c9491fa682b0cb6d6a855e1643a9281"
|
||||
integrity sha512-vSaPpaRgBrf41+Uky1myiSh6gpcbw8FpwHYnEy0abxndojOBnIs+yh/49gKYFLtUMP9qoNWjn6j9aUVy23Ie2A==
|
12
deploy.json
Normal file
12
deploy.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"cdn": {
|
||||
"bucket": "plyr",
|
||||
"domain": "cdn.plyr.io",
|
||||
"region": "us-east-1"
|
||||
},
|
||||
"demo": {
|
||||
"bucket": "plyr.io",
|
||||
"domain": "plyr.io",
|
||||
"region": "us-west-1"
|
||||
}
|
||||
}
|
1
dist/plyr.css
vendored
1
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
1
dist/plyr.js
vendored
1
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
1
dist/sprite.svg
vendored
1
dist/sprite.svg
vendored
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 5.3 KiB |
1
docs/dist/docs.css
vendored
1
docs/dist/docs.css
vendored
File diff suppressed because one or more lines are too long
1
docs/dist/docs.js
vendored
1
docs/dist/docs.js
vendored
File diff suppressed because one or more lines are too long
2
docs/dist/templates.js
vendored
2
docs/dist/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(" <div class=\"player-progress\">");t.b("\n" + i);t.b(" <label for=\"seek{id}\" class=\"sr-only\">Seek</label>");t.b("\n" + i);t.b(" <input id=\"seek{id}\" class=\"player-progress-seek\" type=\"range\" min=\"0\" max=\"100\" step=\"0.5\" value=\"0\" data-player=\"seek\">");t.b("\n" + i);t.b(" <progress class=\"player-progress-played\" 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(" <progress class=\"player-progress-buffer\" max=\"100\" value=\"0\">");t.b("\n" + i);t.b(" <span>0</span>% buffered");t.b("\n" + i);t.b(" </progress>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" <span class=\"player-controls-left\">");t.b("\n" + i);t.b(" <button type=\"button\" data-player=\"restart\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-restart\"></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 {seektime} secs</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button type=\"button\" 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\">Forward {seektime} secs</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\">Current time</span>");t.b("\n" + i);t.b(" <span class=\"player-current-time\">00:00</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" <span class=\"player-time\">");t.b("\n" + i);t.b(" <span class=\"sr-only\">Duration</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-right\">");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-volume\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Toggle 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\" step=\"0.5\" value=\"0\" 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 class=\"icon-captions-on\"><use xlink:href=\"#icon-captions-on\"></use></svg>");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-captions-off\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Toggle 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-exit-fullscreen\"></use></svg>");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-enter-fullscreen\"></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,18 +0,0 @@
|
||||
<!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="//cdn.plyr.io/1.2.2/docs.css">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Doh.</h1>
|
||||
<p>Looks like something went wrong.</p>
|
||||
<a href="http://plyr.io" class="btn">Back to plyr.io</a>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
109
docs/index.html
109
docs/index.html
@ -1,109 +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="https://cdn.plyr.io/1.2.2/plyr.css?1">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="https://cdn.plyr.io/1.2.2/docs.css?4">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Plyr</h1>
|
||||
<p>A simple HTML5 media player with custom controls and WebVTT captions by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a></p>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/selz/plyr" target="_blank" class="btn btn-primary">Download on GitHub</a>
|
||||
<span class="btn-count js-stargazers-count">…</span>
|
||||
</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 js-popup" data-window-height="250" data-window-width="500">Tweet</a>
|
||||
<span class="btn-count js-tweet-count">…</span>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main role="main" id="main">
|
||||
<nav class="btn-bar nav-panel">
|
||||
<ul>
|
||||
<li><a href="#video" class="btn active btn-small">Video</a></li>
|
||||
<li><a href="#youtube" class="btn btn-small">YouTube</a></li>
|
||||
<li><a href="#audio" class="btn btn-small">Audio</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="panels">
|
||||
<section class="panel example-video active" id="video">
|
||||
<div class="player">
|
||||
<video poster="https://cdn.plyr.io/static/poster.jpg" controls crossorigin>
|
||||
<!-- Video files -->
|
||||
<source src="https://cdn.selz.com/plyr/1.0/movie.mp4" type="video/mp4">
|
||||
<source src="https://cdn.selz.com/plyr/1.0/movie.webm" type="video/webm">
|
||||
|
||||
<!-- Text track file -->
|
||||
<track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.0/en.vtt" default>
|
||||
|
||||
<!-- Fallback for browsers that don't support the <video> element -->
|
||||
<a href="https://cdn.selz.com/plyr/1.0/movie.mp4">Download</a>
|
||||
</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="panel example-video" id="youtube">
|
||||
<div class="player">
|
||||
<div data-video-id="Au87oAJ2jeE" data-type="youtube"></div>
|
||||
</div>
|
||||
<small>Envato's "Made By" interview of <a href="https://www.youtube.com/watch?v=Au87oAJ2jeE" target="_blank">Dan Cederholm</a> from <a href="https://dribbble.com" target="_blank">Dribbble</a>.</small>
|
||||
</section>
|
||||
<section class="panel example-audio" id="audio">
|
||||
<div class="player">
|
||||
<audio controls>
|
||||
<!-- Audio files -->
|
||||
<source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3" type="audio/mp3">
|
||||
<source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.ogg" type="audio/ogg">
|
||||
|
||||
<!-- Fallback for browsers that don't support the <audio> element -->
|
||||
<a href="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3">Download</a>
|
||||
</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>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Load SVG defs -->
|
||||
<!-- You should bundle all SVG/Icons into one file using a build tool such as gulp and svg store -->
|
||||
<script>
|
||||
(function(d, u){
|
||||
var a = new XMLHttpRequest(),
|
||||
b = d.body;
|
||||
|
||||
// Check for CORS support
|
||||
// If you're loading from same domain, you can remove the if statement
|
||||
if("withCredentials" in a) {
|
||||
a.open("GET", u, true);
|
||||
a.send();
|
||||
a.onload = function(){
|
||||
var c = d.createElement("div");
|
||||
c.setAttribute("hidden", "");
|
||||
c.innerHTML = a.responseText;
|
||||
b.insertBefore(c, b.childNodes[0]);
|
||||
}
|
||||
}
|
||||
})(document, "https://cdn.plyr.io/1.2.2/sprite.svg");
|
||||
</script>
|
||||
|
||||
<!-- Plyr core script -->
|
||||
<script src="https://cdn.plyr.io/1.2.2/plyr.js?1"></script>
|
||||
|
||||
<!-- Docs script -->
|
||||
<script src="https://cdn.plyr.io/1.2.2/docs.js?1"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,183 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Docs example
|
||||
// ==========================================================================
|
||||
|
||||
/*global plyr, templates */
|
||||
|
||||
// Setup the player
|
||||
plyr.setup({
|
||||
debug: true,
|
||||
volume: 9,
|
||||
title: "Video demo",
|
||||
html: templates.controls.render({}),
|
||||
tooltips: true,
|
||||
captions: {
|
||||
defaultActive: true
|
||||
},
|
||||
onSetup: function() {
|
||||
if(!("media" in this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var player = this,
|
||||
type = player.media.tagName.toLowerCase(),
|
||||
toggle = document.querySelector("[data-toggle='fullscreen']");
|
||||
|
||||
console.log("✓ Setup done for <" + type + ">");
|
||||
|
||||
if(type === "video" && toggle) {
|
||||
toggle.addEventListener("click", player.toggleFullscreen, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// General functions
|
||||
(function() {
|
||||
// Popup
|
||||
function popup(event) {
|
||||
// Prevent the link opening
|
||||
if(event.target.nodeName.toLowerCase() == "a") {
|
||||
if(event.preventDefault) {
|
||||
event.preventDefault();
|
||||
}
|
||||
else {
|
||||
event.returnValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
var link = event.target,
|
||||
url = link.href,
|
||||
width = link.getAttribute("data-window-width") || 600,
|
||||
height = link.getAttribute("data-window-height") || 600,
|
||||
name = link.getAttribute("data-window-name") || "popup";
|
||||
|
||||
// If window exists, just focus it
|
||||
if(window["window-"+name] && !window["window-"+name].closed) {
|
||||
window["window-"+name].focus();
|
||||
}
|
||||
else {
|
||||
// Get position
|
||||
var left = window.screenLeft !== undefined ? window.screenLeft : screen.left;
|
||||
var top = window.screenTop !== undefined ? window.screenTop : screen.top;
|
||||
|
||||
// Open in the centre of the screen
|
||||
var x = (screen.width / 2) - (width / 2) + left,
|
||||
y = (screen.height / 2) - (height / 2) + top;
|
||||
|
||||
// Open that window
|
||||
window["window-"+name] = window.open(url, name, "top=" + y +",left="+ x +",width=" + width + ",height=" + height);
|
||||
|
||||
// Focus new window
|
||||
window["window-"+name].focus();
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger popups
|
||||
document.querySelector(".js-popup").addEventListener("click", popup);
|
||||
|
||||
// Get JSONP
|
||||
function getJSONP(url, callback) {
|
||||
var name = "jsonp_callback_" + Math.round(100000 * Math.random());
|
||||
|
||||
// Cleanup to prevent memory leaks and hit original callback
|
||||
window[name] = function(data) {
|
||||
delete window[name];
|
||||
document.body.removeChild(script);
|
||||
callback(data);
|
||||
};
|
||||
|
||||
// Create a faux script
|
||||
var script = document.createElement("script");
|
||||
script.setAttribute("src", url + (url.indexOf("?") >= 0 ? "&" : "?") + "callback=" + name);
|
||||
|
||||
// Inject to the body
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
// Get star count
|
||||
var storageSupported = ("sessionStorage" in window),
|
||||
selectors = {
|
||||
github: ".js-stargazers-count",
|
||||
twitter: ".js-tweet-count"
|
||||
};
|
||||
|
||||
// Display the count next to the button
|
||||
function displayCount(selector, count) {
|
||||
document.querySelector(selector).innerHTML = count;
|
||||
}
|
||||
|
||||
// Add star
|
||||
function formatGitHubCount(count) {
|
||||
return "★ " + count;
|
||||
}
|
||||
|
||||
// Check if it's in session storage first
|
||||
if(storageSupported && "github_stargazers" in window.sessionStorage) {
|
||||
displayCount(selectors.github, formatGitHubCount(window.sessionStorage.github_stargazers));
|
||||
}
|
||||
else {
|
||||
getJSONP("https://api.github.com/repos/selz/plyr?access_token=a46ac653210ba6a6be44260c29c333470c3fbbf5", function (json) {
|
||||
if (json && typeof json.data.stargazers_count !== "undefined") {
|
||||
// Update UI
|
||||
displayCount(selectors.github, formatGitHubCount(json.data.stargazers_count));
|
||||
|
||||
// Store in session storage
|
||||
window.sessionStorage.github_stargazers = json.data.stargazers_count;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Get tweet count
|
||||
if(storageSupported && "tweets" in window.sessionStorage) {
|
||||
displayCount(selectors.twitter, window.sessionStorage.tweets);
|
||||
}
|
||||
else {
|
||||
getJSONP("https://cdn.api.twitter.com/1/urls/count.json?url=plyr.io", function (json) {
|
||||
if (json && typeof json.count !== "undefined") {
|
||||
// Update UI
|
||||
displayCount(selectors.twitter, json.count);
|
||||
|
||||
// Store in session storage
|
||||
window.sessionStorage.tweets = json.count;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Tabs
|
||||
var tabs = document.querySelectorAll(".nav-panel a"),
|
||||
panels = document.querySelectorAll(".panels > .panel"),
|
||||
activeClass = "active";
|
||||
|
||||
for (var i = tabs.length - 1; i >= 0; i--) {
|
||||
tabs[i].addEventListener("click", togglePanel);
|
||||
}
|
||||
|
||||
function togglePanel(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var tab = event.target,
|
||||
panel = document.querySelector(tab.getAttribute("href"));
|
||||
|
||||
for (var i = panels.length - 1; i >= 0; i--) {
|
||||
panels[i].classList.remove(activeClass);
|
||||
}
|
||||
|
||||
for (var x = tabs.length - 1; x >= 0; x--) {
|
||||
tabs[x].classList.remove(activeClass);
|
||||
}
|
||||
|
||||
panel.classList.add(activeClass);
|
||||
event.target.classList.add(activeClass);
|
||||
}
|
||||
})();
|
||||
|
||||
// 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");
|
||||
}
|
@ -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,51 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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%;
|
||||
font-size: 100%;
|
||||
background: linear-gradient(#fff, @body-background) fixed;
|
||||
}
|
||||
body {
|
||||
font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
color: @gray;
|
||||
.font-smoothing(on);
|
||||
}
|
||||
|
||||
// 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 {
|
||||
padding-bottom: @padding-base;
|
||||
|
||||
@media (min-width: @screen-sm) {
|
||||
padding-bottom: (@padding-base * 2);
|
||||
}
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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;
|
||||
|
||||
&::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;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
display: block;
|
||||
border-radius: 0;
|
||||
}
|
||||
.active {
|
||||
&:extend(.btn-primary);
|
||||
}
|
||||
.btn.active {
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0, .2);
|
||||
position: relative;
|
||||
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;
|
||||
font-weight: 600;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
.btn {
|
||||
padding: (@padding-base / 2) @padding-base;
|
||||
background: @body-background;
|
||||
border: 1px solid @gray-light;
|
||||
box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(0,0,0, .05);
|
||||
text-shadow: 0 1px 1px #fff;
|
||||
color: @gray;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: #fff;
|
||||
border-color: darken(@gray-light, 5%);
|
||||
color: @link-color;
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
.btn-primary {
|
||||
background: linear-gradient(@link-color, darken(@link-color, 3%));
|
||||
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-small {
|
||||
padding-top: ceil(@padding-base / 3);
|
||||
padding-bottom: ceil(@padding-base / 3);
|
||||
}
|
||||
|
||||
// Count bubble
|
||||
.btn-count {
|
||||
position: relative;
|
||||
margin-left: 6px;
|
||||
padding: ((@padding-base / 2) - 1px);
|
||||
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%);
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Examples
|
||||
// ==========================================================================
|
||||
|
||||
// Example players
|
||||
.example-audio .player,
|
||||
.example-video .player {
|
||||
margin: 0 auto @padding-base;
|
||||
|
||||
&-controls {
|
||||
border-radius: 0 0 @border-radius-base @border-radius-base;
|
||||
}
|
||||
}
|
||||
.example-audio .player {
|
||||
max-width: @example-width-audio;
|
||||
|
||||
&-controls {
|
||||
border-radius: @border-radius-base;
|
||||
}
|
||||
&-progress {
|
||||
border-radius: @border-radius-base @border-radius-base 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.example-video .player {
|
||||
max-width: @example-width-video;
|
||||
|
||||
video,
|
||||
iframe {
|
||||
border-radius: @border-radius-base @border-radius-base 0 0;
|
||||
}
|
||||
iframe {
|
||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
||||
}
|
||||
&-fullscreen,
|
||||
&.fullscreen-active {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Typography
|
||||
// ==========================================================================
|
||||
|
||||
// Headings
|
||||
h1,
|
||||
h2 {
|
||||
letter-spacing: -.025em;
|
||||
color: #2E3C44;
|
||||
margin: 0 0 (@padding-base / 2);
|
||||
line-height: 1.2;
|
||||
.font-smoothing();
|
||||
}
|
||||
h1 {
|
||||
.font-size(64);
|
||||
color: #3498DB;
|
||||
}
|
||||
|
||||
// Paragraph and small
|
||||
p,
|
||||
small {
|
||||
margin: 0 0 @padding-base;
|
||||
}
|
||||
small {
|
||||
display: block;
|
||||
padding: 0 (@padding-base / 2);
|
||||
.font-size(14);
|
||||
}
|
||||
|
||||
// Links
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: @link-color;
|
||||
border-bottom: 1px solid currentColor;
|
||||
transition: background .3s ease, color .3s ease;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: @gray-dark;
|
||||
}
|
||||
&:focus {
|
||||
.tab-focus();
|
||||
}
|
||||
&.logo {
|
||||
border: 0;
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
// ==========================================================================
|
||||
// HTML5 Video Player Demo Page
|
||||
// ==========================================================================
|
||||
|
||||
// CSS Reset
|
||||
@import "lib/normalize.less";
|
||||
|
||||
// Mixins
|
||||
@import "lib/mixins.less";
|
||||
|
||||
// Variables
|
||||
@import "variables.less";
|
||||
|
||||
// Animation
|
||||
@import "lib/animation.less";
|
||||
|
||||
// Base layout
|
||||
@import "components/base.less";
|
||||
|
||||
// Type
|
||||
@import "lib/fontface.less";
|
||||
@import "components/type.less";
|
||||
|
||||
// Buttons
|
||||
@import "components/buttons.less";
|
||||
|
||||
// Panels
|
||||
@import "components/panels.less";
|
||||
|
||||
// Error
|
||||
@import "components/error.less";
|
||||
|
||||
// Examples
|
||||
@import "components/examples.less";
|
@ -1,18 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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: 400;
|
||||
}
|
||||
@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: 600;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Mixins
|
||||
// ==========================================================================
|
||||
|
||||
// Contain floats: nicolasgallagher.com/micro-clearfix-hack/
|
||||
// ---------------------------------------
|
||||
.clearfix() {
|
||||
zoom: 1;
|
||||
&:before,
|
||||
&:after { content: ""; display: table; }
|
||||
&:after { clear: both; }
|
||||
}
|
||||
|
||||
// Webkit-style focus
|
||||
// ---------------------------------------
|
||||
.tab-focus() {
|
||||
// Default
|
||||
outline: thin dotted @gray-dark;
|
||||
// Webkit
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
// Use rems for font sizing
|
||||
// Leave <body> at 100%/16px
|
||||
// ---------------------------------------
|
||||
.font-size(@font-size: 16){
|
||||
@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;
|
||||
}
|
||||
.font-smoothing(@mode: on) when (@mode = off) {
|
||||
-moz-osx-font-smoothing: auto;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
}
|
406
docs/src/less/lib/normalize.less
vendored
406
docs/src/less/lib/normalize.less
vendored
@ -1,406 +0,0 @@
|
||||
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
|
||||
|
||||
/* ==========================================================================
|
||||
HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct `block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct `inline-block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `[hidden]` styling not present in IE 8/9.
|
||||
* Hide the `template` element in IE, Safari, and Firefox < 22.
|
||||
*/
|
||||
|
||||
[hidden],
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Set default font family to sans-serif.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background color from active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct font family set oddly in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability of pre-formatted text in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set consistent quote types.
|
||||
*/
|
||||
|
||||
q {
|
||||
quotes: "\201C" "\201D" "\2018" "\2019";
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove border when inside `a` element in IE 8/9.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct overflow displayed oddly in IE 9.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Figures
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margin not present in IE 8/9 and Safari 5.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct `color` not being inherited in IE 8/9.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct font family not being inherited in all browsers.
|
||||
* 2. Correct font size not being inherited in all browsers.
|
||||
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 2 */
|
||||
margin: 0; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
|
||||
* Correct `select` style inheritance in Firefox 4+ and Opera.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Correct inability to style clickable `input` types in iOS.
|
||||
* 3. Improve usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
||||
* 2. Remove excess padding in IE 8/9/10.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari 5 and Chrome
|
||||
* on OS X.
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove default vertical scrollbar in IE 8/9.
|
||||
* 2. Improve readability and alignment in all browsers.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Variables
|
||||
// ==========================================================================
|
||||
|
||||
// Colors
|
||||
@blue: #3498db;
|
||||
@gray-dark: #343f4a;
|
||||
@gray: #55646b;
|
||||
@gray-light: #cbd0d3;
|
||||
@gray-lighter: #dbe3e8;
|
||||
@off-white: #f2f5f7;
|
||||
|
||||
// Base
|
||||
@body-background: @off-white;
|
||||
|
||||
// Elements
|
||||
@link-color: @blue;
|
||||
@padding-base: 20px;
|
||||
@arrow-size: 8px;
|
||||
|
||||
// Breakpoints
|
||||
@screen-sm: 480px;
|
||||
@screen-md: 768px;
|
||||
|
||||
// Radii
|
||||
@border-radius-base: 4px;
|
||||
|
||||
// Examples
|
||||
@example-width-audio: 520px;
|
||||
@example-width-video: 1200px;
|
@ -1,66 +0,0 @@
|
||||
<div class="player-controls">
|
||||
<div class="player-progress">
|
||||
<label for="seek{id}" class="sr-only">Seek</label>
|
||||
<input id="seek{id}" class="player-progress-seek" type="range" min="0" max="100" step="0.5" value="0" data-player="seek">
|
||||
<progress class="player-progress-played" max="100" value="0">
|
||||
<span>0</span>% played
|
||||
</progress>
|
||||
<progress class="player-progress-buffer" max="100" value="0">
|
||||
<span>0</span>% buffered
|
||||
</progress>
|
||||
</div>
|
||||
<span class="player-controls-left">
|
||||
<button type="button" data-player="restart">
|
||||
<svg><use xlink:href="#icon-restart"></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 {seektime} secs</span>
|
||||
</button>
|
||||
<button type="button" 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">Forward {seektime} secs</span>
|
||||
</button>
|
||||
<span class="player-time">
|
||||
<span class="sr-only">Current time</span>
|
||||
<span class="player-current-time">00:00</span>
|
||||
</span>
|
||||
<span class="player-time">
|
||||
<span class="sr-only">Duration</span>
|
||||
<span class="player-duration">00:00</span>
|
||||
</span>
|
||||
</span>
|
||||
<span class="player-controls-right">
|
||||
<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-volume"></use></svg>
|
||||
<span class="sr-only">Toggle 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" step="0.5" value="0" data-player="volume">
|
||||
|
||||
<input class="sr-only" id="captions{id}" type="checkbox" data-player="captions">
|
||||
<label for="captions{id}">
|
||||
<svg class="icon-captions-on"><use xlink:href="#icon-captions-on"></use></svg>
|
||||
<svg><use xlink:href="#icon-captions-off"></use></svg>
|
||||
<span class="sr-only">Toggle Captions</span>
|
||||
</label>
|
||||
|
||||
<button type="button" data-player="fullscreen">
|
||||
<svg class="icon-exit-fullscreen"><use xlink:href="#icon-exit-fullscreen"></use></svg>
|
||||
<svg><use xlink:href="#icon-enter-fullscreen"></use></svg>
|
||||
<span class="sr-only">Toggle Fullscreen</span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
274
gulpfile.js
274
gulpfile.js
@ -1,276 +1,8 @@
|
||||
// ==========================================================================
|
||||
// Gulp build script
|
||||
// ==========================================================================
|
||||
/*global require, __dirname*/
|
||||
/*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"),
|
||||
sass = require("gulp-sass"),
|
||||
minify = require("gulp-minify-css"),
|
||||
run = require("run-sequence"),
|
||||
prefix = require("gulp-autoprefixer"),
|
||||
svgstore = require("gulp-svgstore"),
|
||||
svgmin = require("gulp-svgmin"),
|
||||
hogan = require("gulp-hogan-compile"),
|
||||
rename = require("gulp-rename"),
|
||||
s3 = require("gulp-s3"),
|
||||
gzip = require("gulp-gzip"),
|
||||
replace = require("gulp-replace"),
|
||||
open = require("gulp-open"),
|
||||
size = require("gulp-size");
|
||||
const gulp = require('gulp');
|
||||
const HubRegistry = require('gulp-hub');
|
||||
|
||||
var root = __dirname,
|
||||
paths = {
|
||||
plyr: {
|
||||
// Source paths
|
||||
src: {
|
||||
less: path.join(root, "src/less/**/*"),
|
||||
sass: path.join(root, "src/sass/**/*"),
|
||||
js: path.join(root, "src/js/**/*"),
|
||||
sprite: path.join(root, "src/sprite/*.svg")
|
||||
},
|
||||
// Output paths
|
||||
output: path.join(root, "dist/")
|
||||
},
|
||||
docs: {
|
||||
// Source paths
|
||||
src: {
|
||||
less: path.join(root, "docs/src/less/**/*"),
|
||||
js: path.join(root, "docs/src/js/**/*"),
|
||||
templates: path.join(root, "docs/src/templates/*.html")
|
||||
},
|
||||
// Output paths
|
||||
output: path.join(root, "docs/dist/"),
|
||||
// Docs
|
||||
root: path.join(root, "docs/")
|
||||
},
|
||||
upload: [path.join(root, "dist/**"), path.join(root, "docs/dist/**")]
|
||||
},
|
||||
|
||||
// Task arrays
|
||||
tasks = {
|
||||
less: [],
|
||||
sass: [],
|
||||
js: []
|
||||
},
|
||||
|
||||
// Fetch bundles from 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));
|
||||
}
|
||||
|
||||
var build = {
|
||||
js: function (files, bundle) {
|
||||
for (var key in files) {
|
||||
(function(key) {
|
||||
var name = "js-" + key;
|
||||
tasks.js.push(name);
|
||||
|
||||
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);
|
||||
|
||||
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(minify())
|
||||
.pipe(gulp.dest(paths[bundle].output));
|
||||
});
|
||||
})(key);
|
||||
}
|
||||
},
|
||||
sass: function(files, bundle) {
|
||||
for (var key in files) {
|
||||
(function (key) {
|
||||
var name = "sass-" + key;
|
||||
tasks.sass.push(name);
|
||||
|
||||
gulp.task(name, function () {
|
||||
return gulp
|
||||
.src(bundles[bundle].sass[key])
|
||||
.pipe(sass())
|
||||
.on("error", gutil.log)
|
||||
.pipe(concat(key))
|
||||
.pipe(prefix(["last 2 versions"], { cascade: true }))
|
||||
.pipe(minify())
|
||||
.pipe(gulp.dest(paths[bundle].output));
|
||||
});
|
||||
})(key);
|
||||
}
|
||||
},
|
||||
sprite: function() {
|
||||
// Process Icons
|
||||
gulp.task("sprite", function () {
|
||||
return gulp
|
||||
.src(paths.plyr.src.sprite)
|
||||
.pipe(svgmin({
|
||||
plugins: [{
|
||||
removeDesc: true
|
||||
}]
|
||||
}))
|
||||
.pipe(svgstore())
|
||||
.pipe(gulp.dest(paths.plyr.output));
|
||||
});
|
||||
},
|
||||
templates: function() {
|
||||
// Build templates
|
||||
gulp.task("templates", function () {
|
||||
return gulp
|
||||
.src(paths.docs.src.templates)
|
||||
.pipe(hogan("templates.js", {
|
||||
wrapper: false,
|
||||
templateName: function (file) {
|
||||
return path.basename(file.relative.replace(/\\/g, "-"), path.extname(file.relative));
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest(paths.docs.output));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Plyr core files
|
||||
build.js(bundles.plyr.js, "plyr");
|
||||
build.less(bundles.plyr.less, "plyr");
|
||||
build.sass(bundles.plyr.sass, "plyr");
|
||||
build.sprite();
|
||||
|
||||
// Docs files
|
||||
build.templates();
|
||||
build.less(bundles.docs.less, "docs");
|
||||
build.js(bundles.docs.js, "docs");
|
||||
|
||||
// Default gulp task
|
||||
gulp.task("default", function(){
|
||||
run("templates", tasks.js, tasks.less, "sprite");
|
||||
});
|
||||
|
||||
// Build all JS (inc. templates)
|
||||
gulp.task("js", function(){
|
||||
run("templates", tasks.js);
|
||||
});
|
||||
|
||||
// Build SASS (for testing, default is LESS)
|
||||
gulp.task("sass", function(){
|
||||
run(tasks.sass);
|
||||
});
|
||||
|
||||
// Watch for file changes
|
||||
gulp.task("watch", function () {
|
||||
// Plyr core
|
||||
gulp.watch(paths.plyr.src.js, tasks.js);
|
||||
gulp.watch(paths.plyr.src.less, tasks.less);
|
||||
gulp.watch(paths.plyr.src.sprite, ["sprite"]);
|
||||
|
||||
// Docs
|
||||
gulp.watch(paths.docs.src.js, tasks.js);
|
||||
gulp.watch(paths.docs.src.less, tasks.less);
|
||||
gulp.watch(paths.docs.src.templates, ["js"]);
|
||||
});
|
||||
|
||||
// Publish a version to CDN and docs
|
||||
// --------------------------------------------
|
||||
|
||||
// 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 + ", no-transform, public",
|
||||
"Vary": "Accept-Encoding"
|
||||
},
|
||||
gzippedOnly: true
|
||||
},
|
||||
docs: {
|
||||
headers: {
|
||||
"Cache-Control": "public, must-revalidate, proxy-revalidate, max-age=0",
|
||||
"Vary": "Accept-Encoding"
|
||||
},
|
||||
gzippedOnly: true
|
||||
}
|
||||
},
|
||||
cdnpath = new RegExp(aws.cdn.bucket + "\/(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)","gi");
|
||||
|
||||
// Publish version to CDN bucket
|
||||
gulp.task("cdn", function () {
|
||||
console.log("Uploading " + version + " to " + aws.cdn.bucket);
|
||||
|
||||
// Upload to CDN
|
||||
gulp.src(paths.upload)
|
||||
.pipe(size({
|
||||
showFiles: true,
|
||||
gzip: true
|
||||
}))
|
||||
.pipe(rename(function (path) {
|
||||
path.dirname = path.dirname.replace(".", version);
|
||||
}))
|
||||
.pipe(gzip())
|
||||
.pipe(s3(aws.cdn, options.cdn));
|
||||
});
|
||||
|
||||
// Publish to Docs bucket
|
||||
gulp.task("docs", function () {
|
||||
console.log("Uploading " + version + " docs to " + aws.docs.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 *.html
|
||||
gulp.src([paths.docs.root + "*.html"])
|
||||
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
||||
.pipe(gulp.dest(paths.docs.root))
|
||||
.pipe(gzip())
|
||||
.pipe(s3(aws.docs, options.docs));
|
||||
|
||||
// Upload error.html to cdn using docs options
|
||||
gulp.src([paths.docs.root + "error.html"])
|
||||
.pipe(gzip())
|
||||
.pipe(s3(aws.cdn, options.docs));
|
||||
});
|
||||
|
||||
// Open the docs site to check it's sweet
|
||||
gulp.task("open", function () {
|
||||
console.log("Opening " + aws.docs.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...
|
||||
gulp.src([paths.docs.root + "index.html"])
|
||||
.pipe(open("", {
|
||||
url: "http://" + aws.docs.bucket
|
||||
}));
|
||||
});
|
||||
|
||||
// Do everything
|
||||
gulp.task("publish", function () {
|
||||
run("templates", tasks.js, tasks.less, "sprite", "cdn", "docs");
|
||||
});
|
||||
gulp.registry(new HubRegistry(['tasks/*.js']));
|
||||
|
125
package.json
125
package.json
@ -1,44 +1,101 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"version": "1.2.2",
|
||||
"description": "A simple HTML5 media player using custom controls",
|
||||
"homepage": "http://plyr.io",
|
||||
"main": "gulpfile.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"gulp": "^3.8.6",
|
||||
"gulp-autoprefixer": "^0.0.8",
|
||||
"gulp-concat": "^2.3.3",
|
||||
"gulp-gzip": "^1.0.0",
|
||||
"gulp-hogan-compile": "^0.4.1",
|
||||
"gulp-less": "^1.3.1",
|
||||
"gulp-minify-css": "^0.3.6",
|
||||
"gulp-open": "^0.3.2",
|
||||
"gulp-rename": "^1.2.0",
|
||||
"gulp-replace": "^0.5.3",
|
||||
"gulp-s3": "^0.3.0",
|
||||
"gulp-sass": "^1.3.3",
|
||||
"gulp-size": "^1.2.1",
|
||||
"gulp-svgmin": "^1.0.0",
|
||||
"gulp-svgstore": "^5.0.0",
|
||||
"gulp-uglify": "^0.3.1",
|
||||
"gulp-util": "^2.2.20",
|
||||
"run-sequence": "^0.3.6"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "npm install -g gulp"
|
||||
},
|
||||
"version": "3.7.8",
|
||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||
"homepage": "https://plyr.io",
|
||||
"author": "Sam Potts <sam@potts.es>",
|
||||
"main": "dist/plyr.js",
|
||||
"types": "src/js/plyr.d.ts",
|
||||
"module": "dist/plyr.min.mjs",
|
||||
"jsnext:main": "dist/plyr.min.mjs",
|
||||
"browser": "dist/plyr.min.js",
|
||||
"sass": "src/sass/plyr.scss",
|
||||
"style": "dist/plyr.css",
|
||||
"keywords": [
|
||||
"HTML5 Video",
|
||||
"HTML5 Audio",
|
||||
"Media Player"
|
||||
"Media Player",
|
||||
"DASH",
|
||||
"Shaka",
|
||||
"WordPress",
|
||||
"HLS"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/selz/plyr.git"
|
||||
"url": "git://github.com/sampotts/plyr.git"
|
||||
},
|
||||
"authors": [
|
||||
"Sam Potts <me@sampotts.me>"
|
||||
],
|
||||
"license": "MIT"
|
||||
"bugs": {
|
||||
"url": "https://github.com/sampotts/plyr/issues"
|
||||
},
|
||||
"browserslist": "> 1%",
|
||||
"scripts": {
|
||||
"build": "gulp build",
|
||||
"lint": "eslint src/js && npm run remark && stylelint **/*.scss",
|
||||
"lint:fix": "eslint --fix src/js && stylelint **/*.scss --fix",
|
||||
"remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'",
|
||||
"deploy": "npm run lint && gulp version && gulp build && gulp deploy",
|
||||
"format": "prettier --write \"./{src,demo/src}/**/*.{js,scss}\"",
|
||||
"spellcheck": "cspell \"**/*.{js,md,scss,json}\" --no-must-find-files",
|
||||
"start": "gulp"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@sampotts/eslint-config": "1.1.7",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"aws-sdk": "^2.1256.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"browser-sync": "^2.27.10",
|
||||
"colorette": "2.0.19",
|
||||
"cspell": "^6.14.2",
|
||||
"cssnano": "^5.1.14",
|
||||
"del": "^6.1.1",
|
||||
"eslint": "^7.23.0",
|
||||
"fancy-log": "^2.0.0",
|
||||
"git-branch": "^2.0.1",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-awspublish": "^6.0.2",
|
||||
"gulp-better-rollup": "^4.0.1",
|
||||
"gulp-filter": "^7.0.0",
|
||||
"gulp-header": "^2.0.9",
|
||||
"gulp-hub": "^4.2.0",
|
||||
"gulp-if": "^3.0.0",
|
||||
"gulp-imagemin": "^7.1.0",
|
||||
"gulp-open": "^3.0.1",
|
||||
"gulp-plumber": "^1.2.1",
|
||||
"gulp-postcss": "^9.0.1",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-replace": "^1.1.3",
|
||||
"gulp-sass": "^5.1.0",
|
||||
"gulp-size": "^4.0.1",
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-svgstore": "^9.0.0",
|
||||
"gulp-terser": "^2.1.0",
|
||||
"postcss": "^8.4.19",
|
||||
"postcss-custom-properties": "^12.1.9",
|
||||
"postcss-scss": "^4.0.5",
|
||||
"prettier-eslint": "^12.0.0",
|
||||
"prettier-stylelint": "^0.4.2",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-validate-links": "^12.1.0",
|
||||
"rollup": "^3.3.0",
|
||||
"rollup-plugin-babel": "^4.4.0",
|
||||
"rollup-plugin-commonjs": "^10.1.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"sass": "^1.56.1",
|
||||
"stylelint": "^14.15.0",
|
||||
"stylelint-config-prettier": "^9.0.4",
|
||||
"stylelint-config-sass-guidelines": "^9.0.1",
|
||||
"stylelint-selector-bem-pattern": "^2.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.26.1",
|
||||
"custom-event-polyfill": "^1.0.7",
|
||||
"loadjs": "^4.2.0",
|
||||
"rangetouch": "^2.0.1",
|
||||
"url-polyfill": "^1.1.12"
|
||||
}
|
||||
}
|
||||
|
39
plyr.code-workspace
Normal file
39
plyr.code-workspace
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/dist": true
|
||||
},
|
||||
|
||||
// Linting
|
||||
"stylelint.enable": true,
|
||||
"stylelint.validate": ["css", "scss"],
|
||||
"css.validate": false,
|
||||
"less.validate": false,
|
||||
"scss.validate": false,
|
||||
"javascript.validate.enable": false,
|
||||
|
||||
// Formatting
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.tabSize": 2,
|
||||
"editor.insertSpaces": true,
|
||||
"editor.formatOnSave": true,
|
||||
|
||||
// Trim on save
|
||||
"files.trimTrailingWhitespace": true,
|
||||
|
||||
// Special file associations
|
||||
"files.associations": {
|
||||
".eslintrc": "jsonc"
|
||||
},
|
||||
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true
|
||||
}
|
||||
}
|
||||
}
|
13882
pnpm-lock.yaml
generated
Normal file
13882
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
499
readme.md
499
readme.md
@ -1,499 +0,0 @@
|
||||
# Plyr
|
||||
A simple, accessible HTML5 media player.
|
||||
|
||||
[Checkout the demo](http://plyr.io)
|
||||
|
||||
[](http://plyr.io)
|
||||
|
||||
## Why?
|
||||
We wanted a lightweight, accessible and customisable media player that just supports [*modern*](#browser-support) browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job.
|
||||
|
||||
## Features
|
||||
- **Accessible** - full support for captions and screen readers.
|
||||
- **Lightweight** - just 7.5KB minified and gzipped.
|
||||
- **[Customisable](#html)** - make the player look how you want with the markup you want.
|
||||
- **Semantic** - uses the *right* elements. `<input type="range">` for volume and `<progress>` for progress and well, `<button>`s for buttons. There's no `<span>` or `<a href="#">` button hacks.
|
||||
- **Responsive** - as you'd expect these days.
|
||||
- **Audio & Video** - support for both formats.
|
||||
- **[Embedded Video](#embeds)** - support for YouTube (Vimeo soon).
|
||||
- **[API](#api)** - toggle playback, volume, seeking, and more.
|
||||
- **[Fullscreen](#fullscreen)** - supports native fullscreen with fallback to "full window" modes.
|
||||
- **No dependencies** - written in vanilla JavaScript, no jQuery required.
|
||||
|
||||
Oh and yes, it works with Bootstrap.
|
||||
|
||||
## Changelog
|
||||
Check out [the changelog](changelog.md)
|
||||
|
||||
## Planned development
|
||||
- Playlists
|
||||
- ~~YouTube~~ and Vimeo support
|
||||
- Playback speed
|
||||
- Multiple language captions (with selection)
|
||||
- Audio captions
|
||||
... and whatever else has been raised in [issues](https://github.com/Selz/plyr/issues)
|
||||
|
||||
If you have any cool ideas or features, please let me know by [creating an issue](https://github.com/Selz/plyr/issues/new) or of course, forking and sending a pull request.
|
||||
|
||||
## Implementation
|
||||
|
||||
Check `docs/index.html` and `docs/dist/docs.js` for an example setup.
|
||||
|
||||
**Heads up**, the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.2.2/plyr.js` to `https://cdn.plyr.io/1.2.2/plyr.js`
|
||||
|
||||
### Bower
|
||||
If bower is your thang, you can grab Plyr using:
|
||||
```
|
||||
bower install plyr
|
||||
```
|
||||
More info on setting up dependencies can be found in the [Bower Docs](http://bower.io/docs/creating-packages/#maintaining-dependencies)
|
||||
|
||||
### Ember
|
||||
The awesome [@louisrudner](https://twitter.com/louisrudner) has created an ember component, available by running:
|
||||
```
|
||||
ember addon:install ember-cli-plyr
|
||||
```
|
||||
More info is on [npm](https://www.npmjs.com/package/ember-cli-plyr) and [GitHub](https://github.com/louisrudner/ember-cli-plyr)
|
||||
|
||||
### CDN
|
||||
If you want to use our CDN, you can use the following:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.plyr.io/1.2.2/plyr.css">
|
||||
<script src="https://cdn.plyr.io/1.2.2/plyr.js"></script>
|
||||
```
|
||||
|
||||
You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.2.2/sprite.svg`.
|
||||
|
||||
### CSS
|
||||
If you want to use the default css, add the `plyr.css` file from /dist into your head, or even better use `plyr.less` or `plyr.sass` file included in `/src` in your build to save a request.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="dist/plyr.css">
|
||||
```
|
||||
|
||||
### SVG
|
||||
The SVG sprite for the controls icons is loaded in by AJAX to help with performance. This is best added before the closing `</body>`, before any other scripts.
|
||||
|
||||
```html
|
||||
<script>
|
||||
(function(d, p){
|
||||
var a = new XMLHttpRequest(),
|
||||
b = d.body;
|
||||
a.open("GET", p, true);
|
||||
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/sprite.svg");
|
||||
</script>
|
||||
```
|
||||
More info on SVG sprites here:
|
||||
[http://css-tricks.com/svg-sprites-use-better-icon-fonts/](http://css-tricks.com/svg-sprites-use-better-icon-fonts/)
|
||||
and the AJAX technique here:
|
||||
[http://css-tricks.com/ajaxing-svg-sprite/](http://css-tricks.com/ajaxing-svg-sprite/)
|
||||
|
||||
### HTML
|
||||
The only extra markup that's needed to use plyr is a `<div>` wrapper. Replace the source, poster and captions with urls for your media.
|
||||
```html
|
||||
<div class="player">
|
||||
<video poster="https://cdn.selz.com/plyr/1.0/poster.jpg" controls crossorigin>
|
||||
<!-- Video files -->
|
||||
<source src="https://cdn.selz.com/plyr/1.0/movie.mp4" type="video/mp4">
|
||||
<source src="https://cdn.selz.com/plyr/1.0/movie.webm" type="video/webm">
|
||||
|
||||
<!-- Text track file -->
|
||||
<track kind="captions" label="English captions" src="https://cdn.selz.com/plyr/1.0/movie_captions_en.vtt" srclang="en" default>
|
||||
|
||||
<!-- Fallback for browsers that don't support the <video> element -->
|
||||
<a href="https://cdn.selz.com/plyr/1.0/movie.mp4">Download</a>
|
||||
</video>
|
||||
</div>
|
||||
```
|
||||
And the same for `<audio>`
|
||||
|
||||
```html
|
||||
<div class="player">
|
||||
<audio controls>
|
||||
<!-- Audio files -->
|
||||
<source src="https://cdn.selz.com/plyr/1.0/logistics-96-sample.mp3" type="audio/mp3">
|
||||
<source src="https://cdn.selz.com/plyr/1.0/logistics-96-sample.ogg" type="audio/ogg">
|
||||
|
||||
<!-- Fallback for browsers that don't support the <audio> element -->
|
||||
<a href="https://cdn.selz.com/plyr/1.0/logistics-96-sample.mp3">Download</a>
|
||||
</audio>
|
||||
</div>
|
||||
```
|
||||
|
||||
For YouTube, Plyr uses the standard YouTube API markup (an empty `<div>`):
|
||||
|
||||
```html
|
||||
<div class="player">
|
||||
<div data-video-id="L1h9xxCU20g" data-type="youtube"></div>
|
||||
</div>
|
||||
```
|
||||
|
||||
#### Cross Origin (CORS)
|
||||
You'll notice the `crossorigin` attribute on the example `<video>` and `<audio>` elements. This is because the media is loaded from another domain. If your media is hosted on another domain, you may need to add this attribute.
|
||||
|
||||
More info on CORS here:
|
||||
[https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)
|
||||
|
||||
### JavaScript
|
||||
Much of the behaviour of the player is configurable when initialising the library. Here's an example of a default setup:
|
||||
|
||||
```html
|
||||
<script src="dist/plyr.js"></script>
|
||||
<script>plyr.setup();</script>
|
||||
```
|
||||
|
||||
#### Options
|
||||
|
||||
You can pass the following options to the setup method using `plyr.setup({...})`.
|
||||
|
||||
<table class="table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%">Option</th>
|
||||
<th width="15%">Type</th>
|
||||
<th width="15%">Default</th>
|
||||
<th width="50%">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>enabled</code></td>
|
||||
<td>Boolean</td>
|
||||
<td><code>true</code></td>
|
||||
<td>Completely disable Plyr. This would allow you to do a User Agent check or similar to programatically enable or disable Plyr for a certain UA. Example below.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>html</code></td>
|
||||
<td>String</td>
|
||||
<td><code><a href="controls.md">See controls.md</a></code></td>
|
||||
<td>See <a href="controls.md">controls.md</a> for more info on how the html needs to be structured.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>controls</code></td>
|
||||
<td>Array</td>
|
||||
<td><code>["restart", "rewind", "play", "fast-forward", "current-time", "duration", "mute", "volume", "captions", "fullscreen"]</code></td>
|
||||
<td>Toggle which control elements you would like to display when using the default controls html. If you specify a <code>html</code> option, this is redundant. The default value is to display everything.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>iconPrefix</code></td>
|
||||
<td>String</td>
|
||||
<td><code>icon</code></td>
|
||||
<td>Specify the id prefix for the icons used in the default controls (e.g. "icon-play" would be "icon"). This is to prevent clashes if you're using your own SVG defs file but with the default controls. Most people can ignore this option.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>debug</code></td>
|
||||
<td>Boolean</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Display debugging information on what Plyr is doing.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>seekTime</code></td>
|
||||
<td>Number</td>
|
||||
<td><code>10</code></td>
|
||||
<td>The time, in seconds, to seek when a user hits fast forward or rewind.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>volume</code></td>
|
||||
<td>Number</td>
|
||||
<td><code>5</code></td>
|
||||
<td>A number, between 1 and 10, representing the initial volume of the player.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>click</code></td>
|
||||
<td>Boolean</td>
|
||||
<td><code>true</code></td>
|
||||
<td>Click (or tap) will toggle pause/play of a <code><video></code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>tooltips</code></td>
|
||||
<td>Boolean</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Display control labels as tooltips on :hover & :focus (by default, the labels are screen reader only).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>displayDuration</code></td>
|
||||
<td>Boolean</td>
|
||||
<td><code>true</code></td>
|
||||
<td>Displays the duration of the media on the "metadataloaded" event (on startup) in the current time display. This will only work if the `preload` attribute is not set to `none` (or is not set at all) and you choose not to display the duration (see <code>controls</code> option).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>selectors</code></td>
|
||||
<td>Object</td>
|
||||
<td>—</td>
|
||||
<td>See <code>plyr.js</code> in <code>/src</code> for more info. The only option you might want to change is <code>player</code> which is the hook used for Plyr, the default is <code>.player</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>classes</code></td>
|
||||
<td>Object</td>
|
||||
<td>—</td>
|
||||
<td>Similar to above, these are the classes added to the player when state changes occur.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>captions</code></td>
|
||||
<td>Object</td>
|
||||
<td>—</td>
|
||||
<td>One property <code>defaultActive</code> which toggles if captions should be on by default. The default value is <code>false</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>fullscreen</code></td>
|
||||
<td>Object</td>
|
||||
<td>—</td>
|
||||
<td>Three properties; <code>enabled</code> which toggles if fullscreen should be enabled (if the browser supports it). The default value is <code>true</code>. A <code>fallback</code> property which will enable a full window view for older browsers. The default value is <code>true</code>. A <code>hideControls</code> property which will hide the controls when fullscreen is active and the video is playing, after 1s. The controls reappear on hover of the progress bar (mouse), focusing a child control or pausing the video (by tap/click of video if `click` is `true`). The default value is <code>true</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>storage</code></td>
|
||||
<td>Object</td>
|
||||
<td>—</td>
|
||||
<td>Two properties; <code>enabled</code> which toggles if local storage should be enabled (if the browser supports it). The default value is `true`. This enables storing user settings, currently it only stores volume but more will be added later. The second property <code>key</code> is the key used for the local storage. The default is <code>plyr_volume</code> until more settings are stored.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>onSetup</code></td>
|
||||
<td>Function</td>
|
||||
<td>—</td>
|
||||
<td>This callback function is called on every new plyr instance created. The context (<code>this</code>) is the plyr instance itself.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## API
|
||||
|
||||
A `plyr` object is added to any element that Plyr is initialised on. You can then control the player by accessing methods in the `plyr` object. For example if you wanted to pause Plyr:
|
||||
|
||||
```javascript
|
||||
document.querySelectorAll(".player")[0].plyr.pause();
|
||||
```
|
||||
|
||||
Here's a list of the methods supported:
|
||||
|
||||
<table class="table" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%">Method</th>
|
||||
<th width="15%">Parameters</th>
|
||||
<th width="65%">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>play()</code></td>
|
||||
<td>—</td>
|
||||
<td>Plays the media</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>pause()</code></td>
|
||||
<td>—</td>
|
||||
<td>Pauses the media</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>restart()</code></td>
|
||||
<td>—</td>
|
||||
<td>Restarts playback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>rewind(...)</code></td>
|
||||
<td>Number</td>
|
||||
<td>Rewinds by the provided parameter, in seconds. If no parameter is provided, the default seekInterval is used (10 seconds).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>forward(...)</code></td>
|
||||
<td>Number</td>
|
||||
<td>Fast forwards by the provided parameter, in seconds. If no parameter is provided, the default seekInterval is used (10 seconds).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>seek(...)</code></td>
|
||||
<td>Number</td>
|
||||
<td>Seeks the media to the provided parameter, time in seconds.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>setVolume(...)</code></td>
|
||||
<td>Number</td>
|
||||
<td>Sets the player volume to the provided parameter. The value should be between 0 (muted) and 10 (loudest). If no parameter is provided, the default volume is used (5). Values over 10 are ignored.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>togglePlay()</code></td>
|
||||
<td>Boolean</td>
|
||||
<td>Toggles playback for the player based on either the boolean argument or it's current state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>toggleMute()</code></td>
|
||||
<td>—</td>
|
||||
<td>Toggles mute for the player.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>toggleCaptions()</code></td>
|
||||
<td>—</td>
|
||||
<td>Toggles whether captions are enabled.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>toggleFullscreen()</code></td>
|
||||
<td>Event</td>
|
||||
<td>Toggles fullscreen. This can only be initiated by a user gesture due to browser security, i.e. a user event such as click.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>isFullscreen()</code></td>
|
||||
<td>—</td>
|
||||
<td>Boolean returned if the player is in fullscreen.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>support(...)</code></td>
|
||||
<td>String</td>
|
||||
<td>Determine if a player supports a certain MIME type. This is not supported for embedded content (YouTube).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>source(...)</code></td>
|
||||
<td>String or Array</td>
|
||||
<td>
|
||||
Set the media source.
|
||||
<br><br>
|
||||
<strong>string</strong><br>
|
||||
<code>.source("/path/to/video.mp4")</code><br>
|
||||
This will set the <code>src</code> attribute on the <code>video</code> or <code>audio</code> element.
|
||||
<br><br>
|
||||
<strong>array</strong><br>
|
||||
<code>.source([{ src: "/path/to/video.webm", type: "video/webm", ...more attributes... }, { src: "/path/to/video.mp4", type: "video/mp4", ...more attributes... }])`</code><br>
|
||||
This will inject a child `source` element for every element in the array with the specified attributes. `src` is the only required attribute although adding `type` is recommended as it helps the browser decide which file to download and play.
|
||||
<br><br>
|
||||
<strong>YouTube</strong><br>
|
||||
Currently this API method only accepts a YouTube ID when used with a YouTube player. I will add URL support soon, along with being able to swap between types (e.g. YouTube to Audio or Video and vice versa.)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>poster(...)</code></td>
|
||||
<td>String</td>
|
||||
<td>Set the poster url. This is supported for the <code>video</code> element only.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>destroy()</code></td>
|
||||
<td>—</td>
|
||||
<td>Destroys the plyr UI and any media event listeners, effectively restoring to the previous state before <code>setup()</code> was called.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>restore()</code></td>
|
||||
<td>—</td>
|
||||
<td>Reverses the effects of the <code>destroy()</code> method, restoring the UI and listeners.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Events/Callbacks
|
||||
|
||||
The `plyr` object on the player element also contains a `media` property which is a reference to the `<audio>` or `<video>` element within the player which you can use to listen for events. Here's an example:
|
||||
|
||||
```javascript
|
||||
var media = document.querySelectorAll(".player")[0].plyr.media;
|
||||
|
||||
media.addEventListener("playing", function() {
|
||||
console.log("playing");
|
||||
});
|
||||
```
|
||||
A complete list of events can be found here:
|
||||
[Media Events - W3.org](http://www.w3.org/2010/05/video/mediaevents.html)
|
||||
|
||||
## Embeds
|
||||
|
||||
Currently only YouTube is supported. Vimeo will be coming soon. Some HTML5 media events are triggered on the `media` property of the `plyr` object:
|
||||
- `play`
|
||||
- `pause`
|
||||
- `timeupdate`
|
||||
- `progress`
|
||||
|
||||
Due to the way the YouTube API works, the `timeupdate` and `progress` events are triggered by polling every 200ms so the event may trigger without an actual value change. Buffering progress is `media.buffered` in the `plyr` object. It is a a number between 0 and 1 that specifies the percentage of the video that the player shows as buffered.
|
||||
|
||||
```javascript
|
||||
document.querySelector(".player").plyr.media.addEventListener("play", function() {
|
||||
console.log("play");
|
||||
});
|
||||
```
|
||||
|
||||
The `.source()` API method can also be used but the video id must be passed as the argument.
|
||||
|
||||
Currently caption control is not supported but I will work on this.
|
||||
|
||||
## Fullscreen
|
||||
|
||||
Fullscreen in Plyr is supported for all browsers that [currently support it](http://caniuse.com/#feat=fullscreen). If you're using the default CSS, you can also use a "full browser" mode which will use the full browser window by adding the `player-fullscreen` class to your container.
|
||||
|
||||
## Browser support
|
||||
|
||||
<table width="100%" style="text-align: center">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Safari</td>
|
||||
<td>Firefox</td>
|
||||
<td>Chrome</td>
|
||||
<td>Opera</td>
|
||||
<td>IE9</td>
|
||||
<td>IE10+</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>✔¹</td>
|
||||
<td>✔</td>
|
||||
<td>✔</td>
|
||||
<td>✔</td>
|
||||
<td>API²</td>
|
||||
<td>✔³</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
¹ Mobile Safari on the iPhone forces the native player for `<video>` so no useful customisation is possible. `<audio>` elements have volume controls disabled.
|
||||
|
||||
² Native player used (no support for `<progress>` or `<input type="range">`) but the API is supported (v1.0.28+)
|
||||
|
||||
³ IE10 has no native fullscreen support, fallback can be used (see options)
|
||||
|
||||
The `enabled` option can be used to disable certain User Agents. For example, if you don't want to use Plyr for smartphones, you could use:
|
||||
|
||||
```javascript
|
||||
enabled: /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)
|
||||
```
|
||||
If a User Agent is disabled but supports `<video>` and `<audio>` natively, it will use the native player.
|
||||
|
||||
Any unsupported browsers will display links to download the media if the correct html is used.
|
||||
|
||||
### Checking for support
|
||||
There's an API method for checking support. You can call `plyr.supported()` and optionally pass a type to it, e.g. `plyr.supported("video")`. It will return an object with two keys; `basic` meaning there's basic support for that media type (or both if no type is passed) and `full` meaning there's full support for plyr.
|
||||
|
||||
## Issues
|
||||
If you find anything weird with Plyr, please let us know using the GitHub issues tracker.
|
||||
|
||||
## Author
|
||||
Plyr is developed by [@sam_potts](https://twitter.com/sam_potts) / [sampotts.me](http://sampotts.me) with help from the awesome [contributors](https://github.com/Selz/plyr/graphs/contributors)
|
||||
|
||||
## Mentions
|
||||
- [The Changelog](http://thechangelog.com/plyr-simple-html5-media-player-custom-controls-webvtt-captions/)
|
||||
- [HTML5 Weekly #177](http://html5weekly.com/issues/177)
|
||||
- [Responsive Design #149](http://us4.campaign-archive2.com/?u=559bc631fe5294fc66f5f7f89&id=451a61490f)
|
||||
- [Web Design Weekly #174](https://web-design-weekly.com/2015/02/24/web-design-weekly-174/)
|
||||
- [Hacker News](https://news.ycombinator.com/item?id=9136774)
|
||||
- [Web Platform Daily](http://webplatformdaily.org/releases/2015-03-04)
|
||||
- [LayerVault Designer News](https://news.layervault.com/stories/45394-plyr--a-simple-html5-media-player)
|
||||
- [The Treehouse Show #131](https://teamtreehouse.com/library/episode-131-origami-react-responsive-hero-images)
|
||||
|
||||
## Used by
|
||||
- [Selz.com](https://selz.com)
|
||||
|
||||
Let me know on [Twitter](https://twitter.com/sam_potts) I can add you to the above list. It'd be awesome to see how you're using Plyr :-)
|
||||
|
||||
## Useful links and credits
|
||||
Credit to the PayPal HTML5 Video player from which Plyr's caption functionality is ported from:
|
||||
- [PayPal's Accessible HTML5 Video Player](https://github.com/paypal/accessible-html5-video-player)
|
||||
- The icons used in Plyr are [Vicons](https://dribbble.com/shots/1663443-60-Vicons-Free-Icon-Set) plus some ones I made
|
||||
- [An awesome guide for Plyr in Japanese!](http://syncer.jp/how-to-use-plyr-io) by [@arayutw](https://twitter.com/arayutw)
|
||||
|
||||
Also these links helped created Plyr:
|
||||
- [Media Events - W3.org](http://www.w3.org/2010/05/video/mediaevents.html)
|
||||
- [Styling the `<progress>` element - hongkiat.com](http://www.hongkiat.com/blog/html5-progress-bar/)
|
||||
|
||||
## Copyright and License
|
||||
[The MIT license](license.md).
|
410
src/js/captions.js
Normal file
410
src/js/captions.js
Normal file
@ -0,0 +1,410 @@
|
||||
// ==========================================================================
|
||||
// Plyr Captions
|
||||
// TODO: Create as class
|
||||
// ==========================================================================
|
||||
|
||||
import controls from './controls';
|
||||
import support from './support';
|
||||
import { dedupe } from './utils/arrays';
|
||||
import browser from './utils/browser';
|
||||
import {
|
||||
createElement,
|
||||
emptyElement,
|
||||
getAttributesFromSelector,
|
||||
insertAfter,
|
||||
removeElement,
|
||||
toggleClass,
|
||||
} from './utils/elements';
|
||||
import { on, triggerEvent } from './utils/events';
|
||||
import fetch from './utils/fetch';
|
||||
import i18n from './utils/i18n';
|
||||
import is from './utils/is';
|
||||
import { getHTML } from './utils/strings';
|
||||
import { parseUrl } from './utils/urls';
|
||||
|
||||
const captions = {
|
||||
// Setup captions
|
||||
setup() {
|
||||
// Requires UI support
|
||||
if (!this.supported.ui) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only Vimeo and HTML5 video supported at this point
|
||||
if (!this.isVideo || this.isYouTube || (this.isHTML5 && !support.textTracks)) {
|
||||
// Clear menu and hide
|
||||
if (
|
||||
is.array(this.config.controls) &&
|
||||
this.config.controls.includes('settings') &&
|
||||
this.config.settings.includes('captions')
|
||||
) {
|
||||
controls.setCaptionsMenu.call(this);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Inject the container
|
||||
if (!is.element(this.elements.captions)) {
|
||||
this.elements.captions = createElement('div', getAttributesFromSelector(this.config.selectors.captions));
|
||||
this.elements.captions.setAttribute('dir', 'auto');
|
||||
|
||||
insertAfter(this.elements.captions, this.elements.wrapper);
|
||||
}
|
||||
|
||||
// Fix IE captions if CORS is used
|
||||
// Fetch captions and inject as blobs instead (data URIs not supported!)
|
||||
if (browser.isIE && window.URL) {
|
||||
const elements = this.media.querySelectorAll('track');
|
||||
|
||||
Array.from(elements).forEach((track) => {
|
||||
const src = track.getAttribute('src');
|
||||
const url = parseUrl(src);
|
||||
|
||||
if (
|
||||
url !== null &&
|
||||
url.hostname !== window.location.href.hostname &&
|
||||
['http:', 'https:'].includes(url.protocol)
|
||||
) {
|
||||
fetch(src, 'blob')
|
||||
.then((blob) => {
|
||||
track.setAttribute('src', window.URL.createObjectURL(blob));
|
||||
})
|
||||
.catch(() => {
|
||||
removeElement(track);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Get and set initial data
|
||||
// The "preferred" options are not realized unless / until the wanted language has a match
|
||||
// * languages: Array of user's browser languages.
|
||||
// * language: The language preferred by user settings or config
|
||||
// * active: The state preferred by user settings or config
|
||||
// * toggled: The real captions state
|
||||
|
||||
const browserLanguages = navigator.languages || [navigator.language || navigator.userLanguage || 'en'];
|
||||
const languages = dedupe(browserLanguages.map((language) => language.split('-')[0]));
|
||||
let language = (this.storage.get('language') || this.config.captions.language || 'auto').toLowerCase();
|
||||
|
||||
// Use first browser language when language is 'auto'
|
||||
if (language === 'auto') {
|
||||
[language] = languages;
|
||||
}
|
||||
|
||||
let active = this.storage.get('captions');
|
||||
if (!is.boolean(active)) {
|
||||
({ active } = this.config.captions);
|
||||
}
|
||||
|
||||
Object.assign(this.captions, {
|
||||
toggled: false,
|
||||
active,
|
||||
language,
|
||||
languages,
|
||||
});
|
||||
|
||||
// Watch changes to textTracks and update captions menu
|
||||
if (this.isHTML5) {
|
||||
const trackEvents = this.config.captions.update ? 'addtrack removetrack' : 'removetrack';
|
||||
on.call(this, this.media.textTracks, trackEvents, captions.update.bind(this));
|
||||
}
|
||||
|
||||
// Update available languages in list next tick (the event must not be triggered before the listeners)
|
||||
setTimeout(captions.update.bind(this), 0);
|
||||
},
|
||||
|
||||
// Update available language options in settings based on tracks
|
||||
update() {
|
||||
const tracks = captions.getTracks.call(this, true);
|
||||
// Get the wanted language
|
||||
const { active, language, meta, currentTrackNode } = this.captions;
|
||||
const languageExists = Boolean(tracks.find((track) => track.language === language));
|
||||
|
||||
// Handle tracks (add event listener and "pseudo"-default)
|
||||
if (this.isHTML5 && this.isVideo) {
|
||||
tracks
|
||||
.filter((track) => !meta.get(track))
|
||||
.forEach((track) => {
|
||||
this.debug.log('Track added', track);
|
||||
|
||||
// Attempt to store if the original dom element was "default"
|
||||
meta.set(track, {
|
||||
default: track.mode === 'showing',
|
||||
});
|
||||
|
||||
// Turn off native caption rendering to avoid double captions
|
||||
// Note: mode='hidden' forces a track to download. To ensure every track
|
||||
// isn't downloaded at once, only 'showing' tracks should be reassigned
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
if (track.mode === 'showing') {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
track.mode = 'hidden';
|
||||
}
|
||||
|
||||
// Add event listener for cue changes
|
||||
on.call(this, track, 'cuechange', () => captions.updateCues.call(this));
|
||||
});
|
||||
}
|
||||
|
||||
// Update language first time it matches, or if the previous matching track was removed
|
||||
if ((languageExists && this.language !== language) || !tracks.includes(currentTrackNode)) {
|
||||
captions.setLanguage.call(this, language);
|
||||
captions.toggle.call(this, active && languageExists);
|
||||
}
|
||||
|
||||
// Enable or disable captions based on track length
|
||||
if (this.elements) {
|
||||
toggleClass(this.elements.container, this.config.classNames.captions.enabled, !is.empty(tracks));
|
||||
}
|
||||
|
||||
// Update available languages in list
|
||||
if (
|
||||
is.array(this.config.controls) &&
|
||||
this.config.controls.includes('settings') &&
|
||||
this.config.settings.includes('captions')
|
||||
) {
|
||||
controls.setCaptionsMenu.call(this);
|
||||
}
|
||||
},
|
||||
|
||||
// Toggle captions display
|
||||
// Used internally for the toggleCaptions method, with the passive option forced to false
|
||||
toggle(input, passive = true) {
|
||||
// If there's no full support
|
||||
if (!this.supported.ui) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { toggled } = this.captions; // Current state
|
||||
const activeClass = this.config.classNames.captions.active;
|
||||
// Get the next state
|
||||
// If the method is called without parameter, toggle based on current value
|
||||
const active = is.nullOrUndefined(input) ? !toggled : input;
|
||||
|
||||
// Update state and trigger event
|
||||
if (active !== toggled) {
|
||||
// When passive, don't override user preferences
|
||||
if (!passive) {
|
||||
this.captions.active = active;
|
||||
this.storage.set({ captions: active });
|
||||
}
|
||||
|
||||
// Force language if the call isn't passive and there is no matching language to toggle to
|
||||
if (!this.language && active && !passive) {
|
||||
const tracks = captions.getTracks.call(this);
|
||||
const track = captions.findTrack.call(this, [this.captions.language, ...this.captions.languages], true);
|
||||
|
||||
// Override user preferences to avoid switching languages if a matching track is added
|
||||
this.captions.language = track.language;
|
||||
|
||||
// Set caption, but don't store in localStorage as user preference
|
||||
captions.set.call(this, tracks.indexOf(track));
|
||||
return;
|
||||
}
|
||||
|
||||
// Toggle button if it's enabled
|
||||
if (this.elements.buttons.captions) {
|
||||
this.elements.buttons.captions.pressed = active;
|
||||
}
|
||||
|
||||
// Add class hook
|
||||
toggleClass(this.elements.container, activeClass, active);
|
||||
|
||||
this.captions.toggled = active;
|
||||
|
||||
// Update settings menu
|
||||
controls.updateSetting.call(this, 'captions');
|
||||
|
||||
// Trigger event (not used internally)
|
||||
triggerEvent.call(this, this.media, active ? 'captionsenabled' : 'captionsdisabled');
|
||||
}
|
||||
|
||||
// Wait for the call stack to clear before setting mode='hidden'
|
||||
// on the active track - forcing the browser to download it
|
||||
setTimeout(() => {
|
||||
if (active && this.captions.toggled) {
|
||||
this.captions.currentTrackNode.mode = 'hidden';
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// Set captions by track index
|
||||
// Used internally for the currentTrack setter with the passive option forced to false
|
||||
set(index, passive = true) {
|
||||
const tracks = captions.getTracks.call(this);
|
||||
|
||||
// Disable captions if setting to -1
|
||||
if (index === -1) {
|
||||
captions.toggle.call(this, false, passive);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is.number(index)) {
|
||||
this.debug.warn('Invalid caption argument', index);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(index in tracks)) {
|
||||
this.debug.warn('Track not found', index);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.captions.currentTrack !== index) {
|
||||
this.captions.currentTrack = index;
|
||||
const track = tracks[index];
|
||||
const { language } = track || {};
|
||||
|
||||
// Store reference to node for invalidation on remove
|
||||
this.captions.currentTrackNode = track;
|
||||
|
||||
// Update settings menu
|
||||
controls.updateSetting.call(this, 'captions');
|
||||
|
||||
// When passive, don't override user preferences
|
||||
if (!passive) {
|
||||
this.captions.language = language;
|
||||
this.storage.set({ language });
|
||||
}
|
||||
|
||||
// Handle Vimeo captions
|
||||
if (this.isVimeo) {
|
||||
this.embed.enableTextTrack(language);
|
||||
}
|
||||
|
||||
// Trigger event
|
||||
triggerEvent.call(this, this.media, 'languagechange');
|
||||
}
|
||||
|
||||
// Show captions
|
||||
captions.toggle.call(this, true, passive);
|
||||
|
||||
if (this.isHTML5 && this.isVideo) {
|
||||
// If we change the active track while a cue is already displayed we need to update it
|
||||
captions.updateCues.call(this);
|
||||
}
|
||||
},
|
||||
|
||||
// Set captions by language
|
||||
// Used internally for the language setter with the passive option forced to false
|
||||
setLanguage(input, passive = true) {
|
||||
if (!is.string(input)) {
|
||||
this.debug.warn('Invalid language argument', input);
|
||||
return;
|
||||
}
|
||||
// Normalize
|
||||
const language = input.toLowerCase();
|
||||
this.captions.language = language;
|
||||
|
||||
// Set currentTrack
|
||||
const tracks = captions.getTracks.call(this);
|
||||
const track = captions.findTrack.call(this, [language]);
|
||||
captions.set.call(this, tracks.indexOf(track), passive);
|
||||
},
|
||||
|
||||
// Get current valid caption tracks
|
||||
// If update is false it will also ignore tracks without metadata
|
||||
// This is used to "freeze" the language options when captions.update is false
|
||||
getTracks(update = false) {
|
||||
// Handle media or textTracks missing or null
|
||||
const tracks = Array.from((this.media || {}).textTracks || []);
|
||||
// For HTML5, use cache instead of current tracks when it exists (if captions.update is false)
|
||||
// Filter out removed tracks and tracks that aren't captions/subtitles (for example metadata)
|
||||
return tracks
|
||||
.filter((track) => !this.isHTML5 || update || this.captions.meta.has(track))
|
||||
.filter((track) => ['captions', 'subtitles'].includes(track.kind));
|
||||
},
|
||||
|
||||
// Match tracks based on languages and get the first
|
||||
findTrack(languages, force = false) {
|
||||
const tracks = captions.getTracks.call(this);
|
||||
const sortIsDefault = (track) => Number((this.captions.meta.get(track) || {}).default);
|
||||
const sorted = Array.from(tracks).sort((a, b) => sortIsDefault(b) - sortIsDefault(a));
|
||||
let track;
|
||||
|
||||
languages.every((language) => {
|
||||
track = sorted.find((t) => t.language === language);
|
||||
return !track; // Break iteration if there is a match
|
||||
});
|
||||
|
||||
// If no match is found but is required, get first
|
||||
return track || (force ? sorted[0] : undefined);
|
||||
},
|
||||
|
||||
// Get the current track
|
||||
getCurrentTrack() {
|
||||
return captions.getTracks.call(this)[this.currentTrack];
|
||||
},
|
||||
|
||||
// Get UI label for track
|
||||
getLabel(track) {
|
||||
let currentTrack = track;
|
||||
|
||||
if (!is.track(currentTrack) && support.textTracks && this.captions.toggled) {
|
||||
currentTrack = captions.getCurrentTrack.call(this);
|
||||
}
|
||||
|
||||
if (is.track(currentTrack)) {
|
||||
if (!is.empty(currentTrack.label)) {
|
||||
return currentTrack.label;
|
||||
}
|
||||
|
||||
if (!is.empty(currentTrack.language)) {
|
||||
return track.language.toUpperCase();
|
||||
}
|
||||
|
||||
return i18n.get('enabled', this.config);
|
||||
}
|
||||
|
||||
return i18n.get('disabled', this.config);
|
||||
},
|
||||
|
||||
// Update captions using current track's active cues
|
||||
// Also optional array argument in case there isn't any track (ex: vimeo)
|
||||
updateCues(input) {
|
||||
// Requires UI
|
||||
if (!this.supported.ui) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is.element(this.elements.captions)) {
|
||||
this.debug.warn('No captions element to render to');
|
||||
return;
|
||||
}
|
||||
|
||||
// Only accept array or empty input
|
||||
if (!is.nullOrUndefined(input) && !Array.isArray(input)) {
|
||||
this.debug.warn('updateCues: Invalid input', input);
|
||||
return;
|
||||
}
|
||||
|
||||
let cues = input;
|
||||
|
||||
// Get cues from track
|
||||
if (!cues) {
|
||||
const track = captions.getCurrentTrack.call(this);
|
||||
|
||||
cues = Array.from((track || {}).activeCues || [])
|
||||
.map((cue) => cue.getCueAsHTML())
|
||||
.map(getHTML);
|
||||
}
|
||||
|
||||
// Set new caption text
|
||||
const content = cues.map((cueText) => cueText.trim()).join('\n');
|
||||
const changed = content !== this.elements.captions.innerHTML;
|
||||
|
||||
if (changed) {
|
||||
// Empty the container and create a new child element
|
||||
emptyElement(this.elements.captions);
|
||||
const caption = createElement('span', getAttributesFromSelector(this.config.selectors.caption));
|
||||
caption.innerHTML = content;
|
||||
this.elements.captions.appendChild(caption);
|
||||
|
||||
// Trigger event
|
||||
triggerEvent.call(this, this.media, 'cuechange');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default captions;
|
458
src/js/config/defaults.js
Normal file
458
src/js/config/defaults.js
Normal file
@ -0,0 +1,458 @@
|
||||
// ==========================================================================
|
||||
// Plyr default config
|
||||
// ==========================================================================
|
||||
|
||||
const defaults = {
|
||||
// Disable
|
||||
enabled: true,
|
||||
|
||||
// Custom media title
|
||||
title: '',
|
||||
|
||||
// Logging to console
|
||||
debug: false,
|
||||
|
||||
// Auto play (if supported)
|
||||
autoplay: false,
|
||||
|
||||
// Only allow one media playing at once (vimeo only)
|
||||
autopause: true,
|
||||
|
||||
// Allow inline playback on iOS
|
||||
playsinline: true,
|
||||
|
||||
// Default time to skip when rewind/fast forward
|
||||
seekTime: 10,
|
||||
|
||||
// Default volume
|
||||
volume: 1,
|
||||
muted: false,
|
||||
|
||||
// Pass a custom duration
|
||||
duration: null,
|
||||
|
||||
// Display the media duration on load in the current time position
|
||||
// If you have opted to display both duration and currentTime, this is ignored
|
||||
displayDuration: true,
|
||||
|
||||
// Invert the current time to be a countdown
|
||||
invertTime: true,
|
||||
|
||||
// Clicking the currentTime inverts it's value to show time left rather than elapsed
|
||||
toggleInvert: true,
|
||||
|
||||
// Force an aspect ratio
|
||||
// The format must be `'w:h'` (e.g. `'16:9'`)
|
||||
ratio: null,
|
||||
|
||||
// Click video container to play/pause
|
||||
clickToPlay: true,
|
||||
|
||||
// Auto hide the controls
|
||||
hideControls: true,
|
||||
|
||||
// Reset to start when playback ended
|
||||
resetOnEnd: false,
|
||||
|
||||
// Disable the standard context menu
|
||||
disableContextMenu: true,
|
||||
|
||||
// Sprite (for icons)
|
||||
loadSprite: true,
|
||||
iconPrefix: 'plyr',
|
||||
iconUrl: 'https://cdn.plyr.io/3.7.8/plyr.svg',
|
||||
|
||||
// Blank video (used to prevent errors on source change)
|
||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||
|
||||
// Quality default
|
||||
quality: {
|
||||
default: 576,
|
||||
// The options to display in the UI, if available for the source media
|
||||
options: [4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240],
|
||||
forced: false,
|
||||
onChange: null,
|
||||
},
|
||||
|
||||
// Set loops
|
||||
loop: {
|
||||
active: false,
|
||||
// start: null,
|
||||
// end: null,
|
||||
},
|
||||
|
||||
// Speed default and options to display
|
||||
speed: {
|
||||
selected: 1,
|
||||
// The options to display in the UI, if available for the source media (e.g. Vimeo and YouTube only support 0.5x-4x)
|
||||
options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 4],
|
||||
},
|
||||
|
||||
// Keyboard shortcut settings
|
||||
keyboard: {
|
||||
focused: true,
|
||||
global: false,
|
||||
},
|
||||
|
||||
// Display tooltips
|
||||
tooltips: {
|
||||
controls: false,
|
||||
seek: true,
|
||||
},
|
||||
|
||||
// Captions settings
|
||||
captions: {
|
||||
active: false,
|
||||
language: 'auto',
|
||||
// Listen to new tracks added after Plyr is initialized.
|
||||
// This is needed for streaming captions, but may result in unselectable options
|
||||
update: false,
|
||||
},
|
||||
|
||||
// Fullscreen settings
|
||||
fullscreen: {
|
||||
enabled: true, // Allow fullscreen?
|
||||
fallback: true, // Fallback using full viewport/window
|
||||
iosNative: false, // Use the native fullscreen in iOS (disables custom controls)
|
||||
// Selector for the fullscreen container so contextual / non-player content can remain visible in fullscreen mode
|
||||
// Non-ancestors of the player element will be ignored
|
||||
// container: null, // defaults to the player element
|
||||
},
|
||||
|
||||
// Local storage
|
||||
storage: {
|
||||
enabled: true,
|
||||
key: 'plyr',
|
||||
},
|
||||
|
||||
// Default controls
|
||||
controls: [
|
||||
'play-large',
|
||||
// 'restart',
|
||||
// 'rewind',
|
||||
'play',
|
||||
// 'fast-forward',
|
||||
'progress',
|
||||
'current-time',
|
||||
// 'duration',
|
||||
'mute',
|
||||
'volume',
|
||||
'captions',
|
||||
'settings',
|
||||
'pip',
|
||||
'airplay',
|
||||
// 'download',
|
||||
'fullscreen',
|
||||
],
|
||||
settings: ['captions', 'quality', 'speed'],
|
||||
|
||||
// Localisation
|
||||
i18n: {
|
||||
restart: 'Restart',
|
||||
rewind: 'Rewind {seektime}s',
|
||||
play: 'Play',
|
||||
pause: 'Pause',
|
||||
fastForward: 'Forward {seektime}s',
|
||||
seek: 'Seek',
|
||||
seekLabel: '{currentTime} of {duration}',
|
||||
played: 'Played',
|
||||
buffered: 'Buffered',
|
||||
currentTime: 'Current time',
|
||||
duration: 'Duration',
|
||||
volume: 'Volume',
|
||||
mute: 'Mute',
|
||||
unmute: 'Unmute',
|
||||
enableCaptions: 'Enable captions',
|
||||
disableCaptions: 'Disable captions',
|
||||
download: 'Download',
|
||||
enterFullscreen: 'Enter fullscreen',
|
||||
exitFullscreen: 'Exit fullscreen',
|
||||
frameTitle: 'Player for {title}',
|
||||
captions: 'Captions',
|
||||
settings: 'Settings',
|
||||
pip: 'PIP',
|
||||
menuBack: 'Go back to previous menu',
|
||||
speed: 'Speed',
|
||||
normal: 'Normal',
|
||||
quality: 'Quality',
|
||||
loop: 'Loop',
|
||||
start: 'Start',
|
||||
end: 'End',
|
||||
all: 'All',
|
||||
reset: 'Reset',
|
||||
disabled: 'Disabled',
|
||||
enabled: 'Enabled',
|
||||
advertisement: 'Ad',
|
||||
qualityBadge: {
|
||||
2160: '4K',
|
||||
1440: 'HD',
|
||||
1080: 'HD',
|
||||
720: 'HD',
|
||||
576: 'SD',
|
||||
480: 'SD',
|
||||
},
|
||||
},
|
||||
|
||||
// URLs
|
||||
urls: {
|
||||
download: null,
|
||||
vimeo: {
|
||||
sdk: 'https://player.vimeo.com/api/player.js',
|
||||
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
||||
api: 'https://vimeo.com/api/oembed.json?url={0}',
|
||||
},
|
||||
youtube: {
|
||||
sdk: 'https://www.youtube.com/iframe_api',
|
||||
api: 'https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}',
|
||||
},
|
||||
googleIMA: {
|
||||
sdk: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js',
|
||||
},
|
||||
},
|
||||
|
||||
// Custom control listeners
|
||||
listeners: {
|
||||
seek: null,
|
||||
play: null,
|
||||
pause: null,
|
||||
restart: null,
|
||||
rewind: null,
|
||||
fastForward: null,
|
||||
mute: null,
|
||||
volume: null,
|
||||
captions: null,
|
||||
download: null,
|
||||
fullscreen: null,
|
||||
pip: null,
|
||||
airplay: null,
|
||||
speed: null,
|
||||
quality: null,
|
||||
loop: null,
|
||||
language: null,
|
||||
},
|
||||
|
||||
// Events to watch and bubble
|
||||
events: [
|
||||
// Events to watch on HTML5 media elements and bubble
|
||||
// https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events
|
||||
'ended',
|
||||
'progress',
|
||||
'stalled',
|
||||
'playing',
|
||||
'waiting',
|
||||
'canplay',
|
||||
'canplaythrough',
|
||||
'loadstart',
|
||||
'loadeddata',
|
||||
'loadedmetadata',
|
||||
'timeupdate',
|
||||
'volumechange',
|
||||
'play',
|
||||
'pause',
|
||||
'error',
|
||||
'seeking',
|
||||
'seeked',
|
||||
'emptied',
|
||||
'ratechange',
|
||||
'cuechange',
|
||||
|
||||
// Custom events
|
||||
'download',
|
||||
'enterfullscreen',
|
||||
'exitfullscreen',
|
||||
'captionsenabled',
|
||||
'captionsdisabled',
|
||||
'languagechange',
|
||||
'controlshidden',
|
||||
'controlsshown',
|
||||
'ready',
|
||||
|
||||
// YouTube
|
||||
'statechange',
|
||||
|
||||
// Quality
|
||||
'qualitychange',
|
||||
|
||||
// Ads
|
||||
'adsloaded',
|
||||
'adscontentpause',
|
||||
'adscontentresume',
|
||||
'adstarted',
|
||||
'adsmidpoint',
|
||||
'adscomplete',
|
||||
'adsallcomplete',
|
||||
'adsimpression',
|
||||
'adsclick',
|
||||
],
|
||||
|
||||
// Selectors
|
||||
// Change these to match your template if using custom HTML
|
||||
selectors: {
|
||||
editable: 'input, textarea, select, [contenteditable]',
|
||||
container: '.plyr',
|
||||
controls: {
|
||||
container: null,
|
||||
wrapper: '.plyr__controls',
|
||||
},
|
||||
labels: '[data-plyr]',
|
||||
buttons: {
|
||||
play: '[data-plyr="play"]',
|
||||
pause: '[data-plyr="pause"]',
|
||||
restart: '[data-plyr="restart"]',
|
||||
rewind: '[data-plyr="rewind"]',
|
||||
fastForward: '[data-plyr="fast-forward"]',
|
||||
mute: '[data-plyr="mute"]',
|
||||
captions: '[data-plyr="captions"]',
|
||||
download: '[data-plyr="download"]',
|
||||
fullscreen: '[data-plyr="fullscreen"]',
|
||||
pip: '[data-plyr="pip"]',
|
||||
airplay: '[data-plyr="airplay"]',
|
||||
settings: '[data-plyr="settings"]',
|
||||
loop: '[data-plyr="loop"]',
|
||||
},
|
||||
inputs: {
|
||||
seek: '[data-plyr="seek"]',
|
||||
volume: '[data-plyr="volume"]',
|
||||
speed: '[data-plyr="speed"]',
|
||||
language: '[data-plyr="language"]',
|
||||
quality: '[data-plyr="quality"]',
|
||||
},
|
||||
display: {
|
||||
currentTime: '.plyr__time--current',
|
||||
duration: '.plyr__time--duration',
|
||||
buffer: '.plyr__progress__buffer',
|
||||
loop: '.plyr__progress__loop', // Used later
|
||||
volume: '.plyr__volume--display',
|
||||
},
|
||||
progress: '.plyr__progress',
|
||||
captions: '.plyr__captions',
|
||||
caption: '.plyr__caption',
|
||||
},
|
||||
|
||||
// Class hooks added to the player in different states
|
||||
classNames: {
|
||||
type: 'plyr--{0}',
|
||||
provider: 'plyr--{0}',
|
||||
video: 'plyr__video-wrapper',
|
||||
embed: 'plyr__video-embed',
|
||||
videoFixedRatio: 'plyr__video-wrapper--fixed-ratio',
|
||||
embedContainer: 'plyr__video-embed__container',
|
||||
poster: 'plyr__poster',
|
||||
posterEnabled: 'plyr__poster-enabled',
|
||||
ads: 'plyr__ads',
|
||||
control: 'plyr__control',
|
||||
controlPressed: 'plyr__control--pressed',
|
||||
playing: 'plyr--playing',
|
||||
paused: 'plyr--paused',
|
||||
stopped: 'plyr--stopped',
|
||||
loading: 'plyr--loading',
|
||||
hover: 'plyr--hover',
|
||||
tooltip: 'plyr__tooltip',
|
||||
cues: 'plyr__cues',
|
||||
marker: 'plyr__progress__marker',
|
||||
hidden: 'plyr__sr-only',
|
||||
hideControls: 'plyr--hide-controls',
|
||||
isTouch: 'plyr--is-touch',
|
||||
uiSupported: 'plyr--full-ui',
|
||||
noTransition: 'plyr--no-transition',
|
||||
display: {
|
||||
time: 'plyr__time',
|
||||
},
|
||||
menu: {
|
||||
value: 'plyr__menu__value',
|
||||
badge: 'plyr__badge',
|
||||
open: 'plyr--menu-open',
|
||||
},
|
||||
captions: {
|
||||
enabled: 'plyr--captions-enabled',
|
||||
active: 'plyr--captions-active',
|
||||
},
|
||||
fullscreen: {
|
||||
enabled: 'plyr--fullscreen-enabled',
|
||||
fallback: 'plyr--fullscreen-fallback',
|
||||
},
|
||||
pip: {
|
||||
supported: 'plyr--pip-supported',
|
||||
active: 'plyr--pip-active',
|
||||
},
|
||||
airplay: {
|
||||
supported: 'plyr--airplay-supported',
|
||||
active: 'plyr--airplay-active',
|
||||
},
|
||||
previewThumbnails: {
|
||||
// Tooltip thumbs
|
||||
thumbContainer: 'plyr__preview-thumb',
|
||||
thumbContainerShown: 'plyr__preview-thumb--is-shown',
|
||||
imageContainer: 'plyr__preview-thumb__image-container',
|
||||
timeContainer: 'plyr__preview-thumb__time-container',
|
||||
// Scrubbing
|
||||
scrubbingContainer: 'plyr__preview-scrubbing',
|
||||
scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown',
|
||||
},
|
||||
},
|
||||
|
||||
// Embed attributes
|
||||
attributes: {
|
||||
embed: {
|
||||
provider: 'data-plyr-provider',
|
||||
id: 'data-plyr-embed-id',
|
||||
hash: 'data-plyr-embed-hash',
|
||||
},
|
||||
},
|
||||
|
||||
// Advertisements plugin
|
||||
// Register for an account here: http://vi.ai/publisher-video-monetization/?aid=plyrio
|
||||
ads: {
|
||||
enabled: false,
|
||||
publisherId: '',
|
||||
tagUrl: '',
|
||||
},
|
||||
|
||||
// Preview Thumbnails plugin
|
||||
previewThumbnails: {
|
||||
enabled: false,
|
||||
src: '',
|
||||
},
|
||||
|
||||
// Vimeo plugin
|
||||
vimeo: {
|
||||
byline: false,
|
||||
portrait: false,
|
||||
title: false,
|
||||
speed: true,
|
||||
transparent: false,
|
||||
// Custom settings from Plyr
|
||||
customControls: true,
|
||||
referrerPolicy: null, // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
||||
// Whether the owner of the video has a Pro or Business account
|
||||
// (which allows us to properly hide controls without CSS hacks, etc)
|
||||
premium: false,
|
||||
},
|
||||
|
||||
// YouTube plugin
|
||||
youtube: {
|
||||
rel: 0, // No related vids
|
||||
showinfo: 0, // Hide info
|
||||
iv_load_policy: 3, // Hide annotations
|
||||
modestbranding: 1, // Hide logos as much as possible (they still show one in the corner when paused)
|
||||
// Custom settings from Plyr
|
||||
customControls: true,
|
||||
noCookie: false, // Whether to use an alternative version of YouTube without cookies
|
||||
},
|
||||
|
||||
// Media Metadata
|
||||
mediaMetadata: {
|
||||
title: '',
|
||||
artist: '',
|
||||
album: '',
|
||||
artwork: [],
|
||||
},
|
||||
|
||||
// Markers
|
||||
markers: {
|
||||
enabled: false,
|
||||
points: [],
|
||||
},
|
||||
};
|
||||
|
||||
export default defaults;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user