Compare commits
922 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
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 = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
41
.eslintrc.json
Normal file
41
.eslintrc.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"extends": ["airbnb-base", "prettier"],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"globals": { "Plyr": false, "jQuery": false },
|
||||
"rules": {
|
||||
"no-const-assign": 1,
|
||||
"no-shadow": 0,
|
||||
"no-this-before-super": 1,
|
||||
"no-undef": 1,
|
||||
"no-unreachable": 1,
|
||||
"no-unused-vars": 1,
|
||||
"constructor-super": 1,
|
||||
"valid-typeof": 1,
|
||||
"indent": [2, 4, { "SwitchCase": 1 }],
|
||||
"quotes": [2, "single", "avoid-escape"],
|
||||
"semi": [2, "always"],
|
||||
"eqeqeq": [2, "always"],
|
||||
"one-var": [2, "never"],
|
||||
"comma-dangle": [2, "always-multiline"],
|
||||
"no-restricted-globals": [
|
||||
"error",
|
||||
{
|
||||
"name": "event",
|
||||
"message": "Use local parameter instead."
|
||||
},
|
||||
{
|
||||
"name": "error",
|
||||
"message": "Use local parameter instead."
|
||||
}
|
||||
],
|
||||
"array-bracket-newline": [2, { "minItems": 2 }],
|
||||
"array-element-newline": [2, { "minItems": 2 }]
|
||||
},
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
17
.github/issue_template.md
vendored
Normal file
17
.github/issue_template.md
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<!---
|
||||
Please use this issue template as it makes replicating and fixing the issue easier!
|
||||
--->
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Environment
|
||||
|
||||
- Browser:
|
||||
- Version:
|
||||
- Operating System:
|
||||
- Version:
|
||||
|
||||
### Steps to reproduce
|
||||
-
|
8
.github/pull_request_template.md
vendored
Normal file
8
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
### Link to related issue (if applicable)
|
||||
|
||||
### Sumary of proposed changes
|
||||
|
||||
### Task list
|
||||
|
||||
- [ ] Tested on [supported browsers](https://github.com/sampotts/plyr#browser-support)
|
||||
- [ ] Gulp build completed
|
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,7 +1,11 @@
|
||||
node_modules
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
.DS_Store
|
||||
aws.json
|
||||
docs/index.dev.html
|
||||
*.mp4
|
||||
*.mp4
|
||||
!dist/blank.mp4
|
||||
index-*.html
|
||||
npm-debug.log
|
||||
*.webm
|
||||
/package-lock.json
|
||||
.idea/
|
||||
|
||||
|
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
|
||||
}
|
4
.npmignore
Normal file
4
.npmignore
Normal file
@ -0,0 +1,4 @@
|
||||
demo
|
||||
.github
|
||||
.vscode
|
||||
*.code-workspace
|
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"useTabs": false,
|
||||
"tabWidth": 4,
|
||||
"printWidth": 160,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
24
.stylelintrc.json
Normal file
24
.stylelintrc.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"plugins": ["stylelint-selector-bem-pattern", "stylelint-scss"],
|
||||
"extends": ["stylelint-config-recommended", "stylelint-config-sass-guidelines", "stylelint-config-prettier"],
|
||||
"rules": {
|
||||
"selector-class-pattern": null,
|
||||
"selector-no-qualifying-type": [
|
||||
true,
|
||||
{
|
||||
"ignore": ["attribute", "class"]
|
||||
}
|
||||
],
|
||||
"indentation": 4,
|
||||
"string-quotes": "single",
|
||||
"max-nesting-depth": 2,
|
||||
"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": [
|
||||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
||||
"dbaeumer.vscode-eslint",
|
||||
"wix.vscode-import-cost",
|
||||
"esbenp.prettier-vscode",
|
||||
"shinnn.stylelint",
|
||||
"wayou.vscode-todo-highlight"
|
||||
]
|
||||
}
|
1
.vscode/settings.json
vendored
Normal file
1
.vscode/settings.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{}
|
12
bower.json
12
bower.json
@ -6,18 +6,18 @@
|
||||
"Audio",
|
||||
"Video",
|
||||
"HTML5 Audio",
|
||||
"HTml5 Video"
|
||||
"HTML5 Video"
|
||||
],
|
||||
"authors": [
|
||||
"Sam Potts <me@sampotts.me>"
|
||||
"Sam Potts <sam@potts.es>"
|
||||
],
|
||||
"dependencies": {},
|
||||
"main": [
|
||||
"dist/plyr.css",
|
||||
"dist/plyr.js",
|
||||
"dist/sprite.svg",
|
||||
"dist/plyr.svg",
|
||||
"src/less/plyr.less",
|
||||
"src/sass/plyr.scss",
|
||||
"src/scss/plyr.scss",
|
||||
"src/js/plyr.js"
|
||||
],
|
||||
"ignore": [
|
||||
@ -27,7 +27,7 @@
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/selz/plyr.git"
|
||||
"url": "git://github.com/sampotts/plyr.git"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
24
bundles.json
24
bundles.json
@ -1,26 +1,20 @@
|
||||
{
|
||||
"plyr": {
|
||||
"less": {
|
||||
"plyr.css": ["src/less/plyr.less"]
|
||||
},
|
||||
"sass": {
|
||||
"plyr.css": ["src/less/plyr.sass"]
|
||||
"plyr.css": "src/sass/plyr.scss"
|
||||
},
|
||||
"js": {
|
||||
"plyr.js": ["src/js/plyr.js"]
|
||||
"plyr.js": "src/js/plyr.js",
|
||||
"plyr.polyfilled.js": "src/js/plyr.polyfilled.js"
|
||||
}
|
||||
},
|
||||
"docs": {
|
||||
"less": {
|
||||
"docs.css": ["docs/src/less/docs.less"]
|
||||
"demo": {
|
||||
"sass": {
|
||||
"demo.css": "demo/src/sass/bundles/demo.scss",
|
||||
"error.css": "demo/src/sass/bundles/error.csss"
|
||||
},
|
||||
"js": {
|
||||
"docs.js": [
|
||||
"docs/src/js/lib/hogan-3.0.2.mustache.js",
|
||||
"docs/src/js/lib/classlist.js",
|
||||
"docs/dist/templates.js",
|
||||
"docs/src/js/docs.js"
|
||||
]
|
||||
"demo.js": "demo/src/js/demo.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
737
changelog.md
737
changelog.md
@ -1,188 +1,763 @@
|
||||
# Changelog
|
||||
# v3.0.3
|
||||
|
||||
* Vimeo offset tweak (fixes #826)
|
||||
* Fix for .stop() method (fixes #819)
|
||||
* Check for array for speed options (fixes #817)
|
||||
* Restore as float (fixes #828)
|
||||
* Fix for Firefox fullscreen oddness (Fixes #821)
|
||||
* Improve Sprite checking (fixes #827)
|
||||
* Fix fast-forward control (thanks @saadshahd)
|
||||
* Fix the options link in the readme (thanks @DanielRuf)
|
||||
|
||||
# v3.0.2
|
||||
|
||||
* Fix for Safari not firing error events when trying to load blocked scripts
|
||||
|
||||
# v3.0.1
|
||||
|
||||
* Fix for trying to accessing local storage when it's blocked
|
||||
|
||||
# v3.0.0
|
||||
|
||||
This is a massive release. A _mostly_ complete rewrite in ES6. What started out as a few changes quickly snowballed. There's many breaking changes so be careful upgrading.
|
||||
|
||||
### Big changes
|
||||
|
||||
* New settings menu complete with funky animations
|
||||
* Ability to adjust speed of playback
|
||||
* Ability to toggle caption language (HTML5 and Vimeo only)
|
||||
* Ability to set YouTube quality (HTML5 will follow)
|
||||
* Added support for Vimeo captions
|
||||
* Added Picture-in-Picture support (Safari only)
|
||||
* Added AirPlay support (again, Safari only)
|
||||
* Added `playsinline` support for iOS 10+
|
||||
* Soundcloud removed until I can work on a plugin framework
|
||||
* Embedded players are now progressively enhanced - no more empty `<div>`s!
|
||||
|
||||
### Other stuff
|
||||
|
||||
* Now using SASS exclusively. Sorry, LESS folk it just made sense to maintain one method as SASS is what the cool kids use. It may come back if we work out an automated way to convert the SASS
|
||||
* Moved to ES6. All the rage these days. You'll need to look at polyfills. The demo uses [polyfill.io](https://polyfill.io)
|
||||
* Added basic looping support
|
||||
* Added an aspect ratio option for those that can't leave the 90s and want 4:3
|
||||
* `controlshidden` and `controlsshown` events added for when the controls show or hide
|
||||
* `qualityrequested` and `qualitychange` events for YouTube quality control (HTML5 will follow)
|
||||
* Volume is now `0` to `1` as per HTML5 spec
|
||||
* No longer bodging a `<progress>` behind the `<input type="range">` to make up for WebKit's lack of lower fill styling
|
||||
* Captions now render with line breaks as intended
|
||||
* Captions now render without AJAX using the native events etc
|
||||
* Added a fallback for getting YouTube video data incase `.getVideoData()` disappears when one of their developers randomly deletes it again
|
||||
* Setup and building of the UI should be way "snappier"
|
||||
* Click to toggle inverted time (e.g. 0:01 or -2:59 for a 3 minute video at 1 seconds) - new `toggleInvert` and `invertTime` options
|
||||
* Added `autopause` option for Vimeo
|
||||
* Added `muted` option for you guessed it, muted playback
|
||||
* Restored the `.off()` API method
|
||||
* `.play()` will now return a promise to prevent that pesky uncaught promise issue in Chrome etc
|
||||
* Pressing and hold the seek bar no longer freezes all other updates of the UI
|
||||
|
||||
...plus loads of bug fixes.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
You gotta break eggs to make an omelette. Sadly, there's quite a few breaking changes:
|
||||
|
||||
* Setup now uses proper constructor, accepts a single selector/element/node and returns a single instance - much simpler than before
|
||||
* Much of the API is now using getters and setters rather than methods (where it makes sense) to match the HTML5 API - see the docs for more info
|
||||
* The data attributes for the embeds are now `data-plyr-provider` and `data-plyr-embed-id` to prevent compatibility issues. These can be changed under `config.attributes.embed` if required
|
||||
* `blankUrl` -> `blankVideo`
|
||||
* `volume` is now `0` to `1` as per HTML5 spec
|
||||
* `keyboardShorcuts` (typo) is now just `keyboard`
|
||||
* `loop` is now `loop.active` in preparation for loop enhancements later
|
||||
* `html` option for custom controls removed in favour of the `controls` option which now accepts an array (to use built in controls) or a string of HTML for custom controls.
|
||||
* `classes` -> `classNames`
|
||||
* `classes.videoWrapper` -> `classNames.video`
|
||||
* `classes.embedWrapper` -> `classNames.embed`
|
||||
* `classes.ready` removed
|
||||
* `classes.setup` removed
|
||||
* `classes.muted` removed
|
||||
* `classes.fullscreen.active` removed in favour of the `:fullscreen` selector
|
||||
* `selectors.html5` removed
|
||||
* `selectors.embed` removed
|
||||
* `selectors.buttons.seek` -> `selectors.inputs.seek`
|
||||
* `selectors.volume.input` -> `selectors.inputs.volume`
|
||||
* `selectors.volume.display` -> `selectors.display.volume`
|
||||
* `selectors.currentTime` -> `selectors.display.currentTime`
|
||||
* `selectors.duration` -> `selectors.display.duration`
|
||||
|
||||
### Polyfilling
|
||||
|
||||
Because we're using the fancy new ES6 syntax, you will need to polyfill for vintage browsers if you want to use Plyr and still support them. Luckily there's a decent service for this that makes it painless, [polyfill.io](https://polyfill.io). Alternatively, you can use the prebuilt polyfilled build but bear in mind this is 20kb larger. I'd suggest working our your own polyfill strategy.
|
||||
|
||||
## v2.0.18
|
||||
|
||||
* Fix for YouTube .getVideoData() issue (fixes #709)
|
||||
|
||||
## v2.0.17
|
||||
|
||||
* Vimeo controls fix (fixes #697)
|
||||
* SVG4everybody compatibility fix
|
||||
* Allow Plyr.setup event listeners to be set up as separate event listeners (https://github.com/sampotts/plyr/pull/703)
|
||||
* Added title to the layer html template (for custom controls) (https://github.com/sampotts/plyr/pull/649)
|
||||
* Target is null bug fix (https://github.com/sampotts/plyr/pull/617)
|
||||
* fix #684 memory leaks issues after destroy (https://github.com/sampotts/plyr/pull/700)
|
||||
|
||||
## v2.0.16
|
||||
|
||||
* Fullscreen bug fix (fixes #664)
|
||||
|
||||
## v2.0.15
|
||||
|
||||
* Demo fix
|
||||
|
||||
## v2.0.14
|
||||
|
||||
* CDN URL updates. Sorry, still working on V3 as hard as I can...
|
||||
|
||||
## v2.0.13
|
||||
|
||||
* Repo moved and Vimeo demo fix
|
||||
|
||||
## v2.0.12
|
||||
|
||||
* Ability to set custom `blankUrl` for source changes (https://github.com/sampotts/plyr/pull/504)
|
||||
* Ability to set caption button listener (https://github.com/sampotts/plyr/pull/468)
|
||||
|
||||
## v2.0.11
|
||||
|
||||
* Fix for `cleanUp` being called twice (thanks to @sebastiancarlsson)
|
||||
* Fix for YouTube controls on iPad (fixes #391)
|
||||
|
||||
## v2.0.10
|
||||
|
||||
* Added seek event fixes for Vimeo and YouTube (fixes #409)
|
||||
* Added support for embed URLs rather than ID only (fixes #345)
|
||||
|
||||
## v2.0.9
|
||||
|
||||
* Temporary patch for the YouTube API issues with `getDuration()` (relates to #374)
|
||||
|
||||
## v2.0.8
|
||||
|
||||
* Added `isPaused()` API method (thanks to @darrena092)
|
||||
* Allowed `.on()` API method to be chainable (thanks to @gurupras) (fixes #357)
|
||||
* Improved the "awful" rendering of captions on small screens in fullscreen mode (fixes #390)
|
||||
* Fix for Firefox VTT compatibility (thanks to @magourex)
|
||||
* Fix for Firefox Developer Edition blank video due to `-webkit-mask-image` issue (fixes #392)
|
||||
* Added Issue and PR templates with the aim of reducing duplicate or duff issues
|
||||
|
||||
## v2.0.7
|
||||
|
||||
* Fixed `getCurrentTime()` method (fixes #351)
|
||||
* Added `getVolume()` , `isMuted()` and `getDuration()` API methods (fixes #346)
|
||||
|
||||
## v2.0.6
|
||||
|
||||
* Fixed merge issue with `Updated define to work with AMD imports #326` PR
|
||||
* Code formatting
|
||||
|
||||
## v2.0.5
|
||||
|
||||
* Fix for Vimeo in IE9 & IE10
|
||||
* Fix for HTML5 elements not firing `ready` event
|
||||
|
||||
## v2.0.4
|
||||
|
||||
* Fix for Firefox full screen (fixes #343)
|
||||
|
||||
## v2.0.3
|
||||
|
||||
* Set 'global' keyboard shortcut option to false as default, added `<textarea>` to editable elements to be ignored
|
||||
|
||||
## v2.0.2
|
||||
|
||||
* Added 'global' keyboard shortcut option
|
||||
|
||||
## v2.0.1
|
||||
|
||||
* Version bump for NPM (sorry for folks who upgraded to the now deleted v1.9.0 through NPM)
|
||||
|
||||
# v2.0.0
|
||||
|
||||
This version contains several potential **_breaking changes_**:
|
||||
|
||||
* `setup()` has been reverted to pre v1.8.0 behaviour; meaning it will return the _instance_ rather than the _element_. This is because the reference to the instance is no longer added to the original element (see below).
|
||||
* The reference to the `plyr` instance is now added to the media element rather than original container. This is because if a container with multiple children was passed to `setup()` the references to all instances would have been added to the container, creating issues. I would recommend using the return value from `setup()` or the new `get()` method to access the instance.
|
||||
* Players will always be wrapped in their own div now - this makes `setup()` and `destroy()` cleaner. This _may_ break any custom styling based on DOM position.
|
||||
* Players no longer seek to 0 on 'ended' - this is to fix a bug with Microsoft Edge as it triggers 'ended' on media change for whatever reason. They'll never change ;-)
|
||||
|
||||
And some other changes and bug fixes:
|
||||
|
||||
* New `get()` method on the global plyr object to get all instances inside a container
|
||||
* New API methods: - `getOriginal()` to get the original, _unmodified_ element plyr was setup on (`<video>`, `<audio>` or empty `<div>` for YouTube and Vimeo) - `getContainer()` to get the players outer wrapper element - `getMedia()` to get the players media element (`<video>`, `<audio>` or empty `<div>` for YouTube and Vimeo) - `getEmbed()` to access the YouTube or Vimeo API directly - `getType()` to get the type of the player - `isReady()` to determine if an instance has completed setup and necessary APIs are loaded (for YouTube / Vimeo) - `on()` to provide an easy way to listen to events - `stop()` to, you guessed it, stop the player
|
||||
* `destroy()` now works correctly for YouTube and Vimeo (fixes #272)
|
||||
* New `destroyed` event when `destroy()` has completed (original element is passed as event.target)
|
||||
* Default volume is now 10 (max) rather than 5
|
||||
* Sprite is only loaded once (fixes #259)
|
||||
* Fixes for Vimeo post message bugs on source change or destroy (fixes #318)
|
||||
* Save caption state in storage (fixes #311)
|
||||
* Added keyboard shortcuts to the current focused player (with `keyboardShortcuts` boolean option to disable) (fixes #309)
|
||||
* Fix for captions bug (fixes #332)
|
||||
* Change to AMD (fixes #298)
|
||||
|
||||
## v1.8.12
|
||||
|
||||
* Vimeo keyboard focus fix (Fixes #317)
|
||||
* Fix for Vimeo on basic support devices
|
||||
|
||||
## v1.8.11
|
||||
|
||||
* Fix for keyboard navigation on Vimeo (Fixes #317)
|
||||
* Fix for bug introduced in v1.8.9 related to additional controls
|
||||
* Vimeo API upgrade
|
||||
* Fix for YouTube bug introduced in v1.8.9
|
||||
* Added support for passing array to .setup() (Fixes #319)
|
||||
|
||||
## v1.8.10
|
||||
|
||||
* Fix for seek issues introduced in v1.8.9
|
||||
|
||||
## v1.8.9
|
||||
|
||||
* Fix for fullscreen not being defined (Fixes #295)
|
||||
* Fix for multiline captions (Fixes #314)
|
||||
* Clean up of type checks and fix for `restart()` (Fixes #315)
|
||||
* Fix for `MEDIA_ERR_SRC_NOT_SUPPORTED` when calling `.source()` API method
|
||||
|
||||
## v1.8.8
|
||||
|
||||
* Added getCurrentTime API method (fixes #292)
|
||||
* Fix for !hideControls on touch devices (fixes #303)
|
||||
|
||||
## v1.8.7
|
||||
|
||||
* Line height fix
|
||||
|
||||
## v1.8.6
|
||||
|
||||
* Reverted font size change
|
||||
|
||||
## v1.8.5
|
||||
|
||||
* Fixed overflow issues (fixes #286)
|
||||
|
||||
## v1.8.4
|
||||
|
||||
* Fix for large play button on small videos
|
||||
|
||||
## v1.8.3
|
||||
|
||||
* Disabled iPad support for YouTube and Vimeo due to iOS limitations with iFrame playback
|
||||
* Fixed IE11 icon loading (fixes #269)
|
||||
* Updated screenshot (fixes #281)
|
||||
* Added WordPress plugin (fixes #239)
|
||||
* Added Neos plugin
|
||||
* Added HLS, Shaka and dash.js examples (see #235 for more)
|
||||
* Improvements for controls hiding and showing on touch devices
|
||||
|
||||
## v1.8.2
|
||||
|
||||
* Fixed event bubbling
|
||||
|
||||
## v1.8.1
|
||||
|
||||
* Fixed inaccurate log message
|
||||
|
||||
# v1.8.0
|
||||
|
||||
* **_(Important)_** `setup()` now returns the element Plyr was setup on rather than the `plyr` object. This means `var player = plyr.setup()[0];` would now be `var player = plyr.setup()[0].plyr;`. This improves support for React and other virtual dom frameworks as mentioned in #254
|
||||
* Fixed using a relative URL for `iconUrl` in IE (fixes #269)
|
||||
|
||||
# v1.7.0
|
||||
|
||||
* SASS cleanup (fixes #265)
|
||||
* Docs tidy up to help quick start (fixes #253)
|
||||
* Fix for issues with data attribute options passing (fixes #257)
|
||||
* **_(Important)_** Removed the requirement for a wrapper div to setup Plyr and removed the dependency on the `plyr` classname as a JS hook. By default it will now look for `<video>`, `<audio>` and `[data-type]` elements. If you are just calling `setup()` with a `<div class="plyr">` you may want to give it a good test after upgrading. You can probably remove the wrapper div. The reason behind this is to make setup easier for newcomers and prevent the styling being used on unsupported players (because the plyr classname was used as a CSS and JS hook - which isn't ideal)
|
||||
* Renamed the 'docs' folder to `demo` to avoid confusion - the readme is the docs after all
|
||||
|
||||
## v1.6.20
|
||||
|
||||
* Fix for multiple sprites being requested (fixes #259)
|
||||
|
||||
## v1.6.19
|
||||
|
||||
* Fix for scroll direction issues on volume control (fixes #258)
|
||||
|
||||
## v1.6.18
|
||||
|
||||
* Reduced rounding of seek value from 1 decimal point to 4 (fixes #242)
|
||||
|
||||
## v1.6.17
|
||||
|
||||
* Added `disableContextMenu` option to hide the right click context menu (fixes #248 and #225)
|
||||
|
||||
## v1.6.16
|
||||
|
||||
* Always hide standard controls (fixes #225)
|
||||
* Fix for Tooltips overflowing (fixes #230)
|
||||
|
||||
## v1.6.15
|
||||
|
||||
* Restore scroll position when exiting full screen (fixes #236)
|
||||
|
||||
## v1.6.14
|
||||
|
||||
* SVG sprite loading automatically for an easier setup
|
||||
* Touch devices now show controls on touch rather than pausing playback
|
||||
|
||||
## v1.6.13
|
||||
|
||||
* Decreased sensitivity and inverted scroll on volume slider (scroll up to increase, down to decrease)
|
||||
|
||||
## v1.6.12
|
||||
|
||||
* Fix for undefined buffer error
|
||||
* Add scroll listener on volume slider (PR #227 bty @igoradamenko)
|
||||
|
||||
## v1.6.11
|
||||
|
||||
* Fix for Vimeo fullscreen (fixes #214)
|
||||
|
||||
## v1.6.10
|
||||
|
||||
* Changed default icon prefix from 'icon' to 'plyr' to avoid clashes
|
||||
|
||||
## v1.6.9
|
||||
|
||||
* Added 'latest' CDN option
|
||||
* Renamed `sprite.svg` to `plyr.svg` to be inline with the other package files
|
||||
|
||||
## v1.6.8
|
||||
|
||||
* Fix for bug introduced in v1.6.7
|
||||
|
||||
## v1.6.7
|
||||
|
||||
* Fixes for using `source` API method on iOS
|
||||
|
||||
## v1.6.6
|
||||
|
||||
* Icons cleaned up
|
||||
* IE11 button fix for tooltips (fixes #210)
|
||||
|
||||
## v1.6.5
|
||||
|
||||
* IE UI bug fixes
|
||||
|
||||
## v1.6.4
|
||||
|
||||
* Bug fix for undefined progress bar
|
||||
|
||||
## v1.6.3
|
||||
|
||||
* Seek back to 0 for all media on ended
|
||||
* Check for HTML5 video on ended reload
|
||||
* Update to docs for `showPosterOnEnd` option
|
||||
|
||||
## v1.6.2
|
||||
|
||||
* Fix for tooltip displaying when duration is not set (fixes #177)
|
||||
* `showPosterOnEnd` option to show poster when HTML5 video ended (fixes #59)
|
||||
* Error handler for YouTube (fixes #189)
|
||||
* Initial SoundCloud support (fixes #194)
|
||||
* Other minor bug fixes
|
||||
|
||||
## v1.6.1
|
||||
|
||||
* Tooltip changes for accessibility
|
||||
|
||||
## v1.6.0
|
||||
|
||||
* New, cleaner, UI: - Controls are now overlaid, maintaining the video's ratio and making sizing easier - A large play button can now be overlaid over videos - Default number of control buttons reduced - New play, pause, rewind and fast forward icons - Flexbox all the things!
|
||||
* Tidied up the LESS (and SCSS) as part of the above, variables and mixins in seprate files amking customization and upgrades easier
|
||||
* Toggle mute bug fix; if a player was muted previously and the user refreshed, unmuting would have meant volume was still zero (effectively muted), now the config default value is used. Not ideal but good for now
|
||||
* New `iconUrl` option allowing specifying a same origin SVG sprite location. Loading this way means you don't need the AJAX sprite loading JavaScript
|
||||
* `click` option renamed to `clickToPlay` to make it a bit more self explanatory. Unfortunately cross origin SVG sprites is not supported in any browser yet :-(
|
||||
* `hideControls` is now a global option, rather than being exclusive to fullscreen. Controls are now hidden after 2 seconds of no mouse movement. Controls are always shown when media is paused or stopped. This is defaulted to true.
|
||||
* `sass` folder in `src` renamed from to `scss`
|
||||
|
||||
## v1.5.21
|
||||
|
||||
* Bug fix for embeds: `play` not being defined (fixes #185 and #186)
|
||||
|
||||
## v1.5.20
|
||||
|
||||
* Bug fix for autoplay option
|
||||
|
||||
## v1.5.19
|
||||
|
||||
* Fix for accessing `embed` property after `ready` event fired
|
||||
|
||||
## v1.5.18
|
||||
|
||||
* Added 'ready' event for initial setup complete or source change occurs
|
||||
* Fixed SASS stylesheet references to transparentize
|
||||
* Added default font stack to controls
|
||||
* Docs fixes inc controls HTML (fixes #180)
|
||||
|
||||
## v1.5.17
|
||||
|
||||
* Expose YouTube and Vimeo API (docs update required) (fixes #176)
|
||||
* Auto set title based on YouTube getVideoData() title property
|
||||
* Bug fix for Vimeo API change (Uncaught TypeError: Cannot read property 'value' of undefined) due to a change their end
|
||||
|
||||
## v1.5.16
|
||||
|
||||
* Cancel requests on source change (fixes #174)
|
||||
|
||||
## v1.5.15
|
||||
|
||||
* Fix for CustomEvent polyfill and related bug (see #172)
|
||||
|
||||
## v1.5.14
|
||||
|
||||
* Volume storage fix (fixes #171)
|
||||
|
||||
## v1.5.13
|
||||
|
||||
* Fix for manual caption rendering
|
||||
|
||||
## v1.5.12
|
||||
|
||||
* Added a duration option to pass the duration of the file
|
||||
* Added the ability to set options per element by setting a data-plyr attribute on the target elements (this might be useful for the duration option for example)
|
||||
* Fixes for Chrome and Safari caption rendering, they now use the default texttrack and cuechange events
|
||||
* Firefox bug fix for event not defined
|
||||
|
||||
## v1.5.11
|
||||
|
||||
* iOS embed bug fixes (fixes #166)
|
||||
* Hide IE/Edge <input type='range'> tooltip (since we have a styled one) (fixes #160)
|
||||
* SASS bug fix for default values (fixes #158)
|
||||
|
||||
## v1.5.9 + v1.5.10
|
||||
|
||||
* NPM bug fixes
|
||||
|
||||
## v1.5.8
|
||||
|
||||
* Fix for touch device seek tooltip
|
||||
* Seek improvements
|
||||
|
||||
## v1.5.7
|
||||
|
||||
* Fix for control tooltips always showing
|
||||
|
||||
## v1.5.6
|
||||
|
||||
* Seek tooltip (option for tooltips changed, please check docs)
|
||||
* SASS compile error fixes (fixes #148)
|
||||
* Fullscreen fixes for controls not always hiding/showing (fixes #149)
|
||||
* Screen reader icon fixes (title was being read twice due to the tooltip/hidden label)
|
||||
|
||||
## v1.5.5
|
||||
|
||||
* Fixed controls.md example
|
||||
* Bug fix for docs error page
|
||||
* Bug fix for controls tooltips
|
||||
|
||||
## v1.5.4
|
||||
|
||||
* Minor bug fix for clicking video to play/pause after source change
|
||||
|
||||
## v1.5.3
|
||||
|
||||
* Minor bug fix for occasional display of 0:00 as the media duration
|
||||
|
||||
## v1.5.2
|
||||
|
||||
* `handlers` option renamed to `listeners`
|
||||
* Added event listeners for all types to the plyr container (playback, fullscreen, captions etc - see docs)
|
||||
* Removed onSetup config option (use the 'setup' event instead, plyr element is event.plyr)
|
||||
* Style bug fixes
|
||||
* Vimeo seek bug fix (requires whole seconds when seeking)
|
||||
* Fix for fullscreen player (using class hook, not browser fullscreen)
|
||||
|
||||
## v1.5.1
|
||||
|
||||
* Fix for event listeners being duplicated on source change
|
||||
|
||||
# v1.5.0
|
||||
|
||||
* Vimeo support (fixes #8)
|
||||
* New options for initialization (you can now pass a selector, HTMLElement or NodeList) (fixes #118)
|
||||
* Switched to BEM methodology (you will need to change CSS and probably HTML)
|
||||
* Decoupled CSS and JS hooks (fixes #129)
|
||||
* Custom controls container (fixes #98)
|
||||
* Fix for private/incognito mode local storage bug (fixes #131)
|
||||
* UMD module setup (fixes #121)
|
||||
* Specify iframe title for Vimeo and YouTube (fixes #124)
|
||||
* Better handling of mission controls (fixes #132)
|
||||
* Retain classname on source change (fixes #120)
|
||||
* Increased thumb size on seek (partially fixes #130)
|
||||
* Passing no argument to `source` api method, now returns current source (by @gurupras)
|
||||
* Ability to add custom handlers to controls prior to Plyr bindings (by @gurupras)
|
||||
* Keyboard navigation improvements (focus on seek, focus trap in fullscreen) (fixes #135)
|
||||
|
||||
## v1.3.5
|
||||
|
||||
* Fixed bug with API use on basic supported browsers
|
||||
|
||||
## v1.3.4
|
||||
|
||||
* Code cleanup by @calvintam236
|
||||
|
||||
## v1.3.3
|
||||
|
||||
* Removed captions being read by screen readers
|
||||
|
||||
## v1.3.2
|
||||
|
||||
* Voiceover fix for captions
|
||||
|
||||
## v1.3.1
|
||||
|
||||
* ARIA improvements for captions being read
|
||||
|
||||
## v1.3.0
|
||||
|
||||
* Internationalization support (i18n) using default controls (required markup changes to controls)
|
||||
* ARIA enhancements for controls (required markup changes to controls)
|
||||
* Captions legibility improvements
|
||||
* YouTube bug fixes
|
||||
|
||||
## v1.2.6
|
||||
- SASS updates and fixes (cheers @ChristianPV)
|
||||
|
||||
* SASS updates and fixes (cheers @ChristianPV)
|
||||
|
||||
## v1.2.5
|
||||
- Fix for YouTube quality (let them decide quality)
|
||||
|
||||
* Fix for YouTube quality (let them decide quality)
|
||||
|
||||
## v1.2.4
|
||||
- Fix for omitted kind attribute on <track> (fixes #88)
|
||||
|
||||
* Fix for omitted kind attribute on <track> (fixes #88)
|
||||
|
||||
## v1.2.3
|
||||
- Fix for YouTube on iPhone or unsupported browsers (fallback to YouTube native)
|
||||
- Docs tidy up
|
||||
- Fullscreen for Safari fix (Fixes #96)
|
||||
|
||||
* Fix for YouTube on iPhone or unsupported browsers (fallback to YouTube native)
|
||||
* Docs tidy up
|
||||
* Fullscreen for Safari fix (fixes #96)
|
||||
|
||||
## v1.2.2
|
||||
- Fix for :focus keyboard vs mouse (Fixes #61)
|
||||
- Fix for caption positioning in full screen (Fixes #92)
|
||||
|
||||
* 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
|
||||
* Tooltip bug fix
|
||||
|
||||
# v1.2.0
|
||||
|
||||
* Added YouTube support
|
||||
|
||||
## v1.1.13
|
||||
- Added icon prefix option for when using default controls
|
||||
|
||||
* Added icon prefix option for when using default controls
|
||||
|
||||
## v1.1.13
|
||||
- Logic tweaks for hiding controls in fullscreen
|
||||
|
||||
* Logic tweaks for hiding controls in fullscreen
|
||||
|
||||
## v1.1.12
|
||||
- Bug fix for Chrome Canary
|
||||
|
||||
* Bug fix for Chrome Canary
|
||||
|
||||
## v1.1.11
|
||||
- Bug fix
|
||||
|
||||
* Bug fix
|
||||
|
||||
## v1.1.10
|
||||
- Bug fix
|
||||
|
||||
* Bug fix
|
||||
|
||||
## v1.1.9
|
||||
- Bug fix for 1.1.8
|
||||
|
||||
* Bug fix for 1.1.8
|
||||
|
||||
## v1.1.8
|
||||
- setVolume API method improvements (Fixes #83)
|
||||
|
||||
* setVolume API method improvements (fixes #83)
|
||||
|
||||
## v1.1.7
|
||||
- Restore classname on destroy()
|
||||
|
||||
* Restore classname on destroy()
|
||||
|
||||
## v1.1.6
|
||||
- New API methods (fixes #77), Fix for non strict mode (fixes #78)
|
||||
|
||||
* 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)
|
||||
|
||||
* Fix for incorrect `isFullscreen()` return value in Mozilla (fixes #38)
|
||||
|
||||
## v1.1.4
|
||||
- Minor bug fixes
|
||||
|
||||
* 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
|
||||
|
||||
* 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()`
|
||||
|
||||
* 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
|
||||
|
||||
* 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
|
||||
|
||||
* 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`
|
||||
|
||||
* Display duration on `metadataloaded`
|
||||
|
||||
## v1.0.30
|
||||
- Fixed bug with media longer than 60 minutes (Fixes #69)
|
||||
|
||||
* 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
|
||||
|
||||
* 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)
|
||||
|
||||
* 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)
|
||||
|
||||
* Keyboard accessibility improvements (fixes #66)
|
||||
|
||||
## v1.0.26
|
||||
- Fixes for SASS (cheers @brunowego)
|
||||
- Indentation reset to 4 spaces
|
||||
|
||||
* 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
|
||||
|
||||
* 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)
|
||||
|
||||
* Added tooltip option to display labels as tooltips (fixes #50)
|
||||
|
||||
## v1.0.23
|
||||
- Handling loading states in the UI (Fixes #36)
|
||||
|
||||
* 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
|
||||
|
||||
* 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)
|
||||
|
||||
* 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
|
||||
|
||||
* 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)
|
||||
|
||||
* Fixed firefox fullscreen issue (fixes #38)
|
||||
|
||||
## v1.0.18
|
||||
- Added CDN references
|
||||
|
||||
* 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)
|
||||
|
||||
* 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
|
||||
|
||||
* Aria label is now dynamic
|
||||
|
||||
## v1.0.15
|
||||
- Fix for seek time display in controls
|
||||
- More documentation for controls html
|
||||
|
||||
* Fix for seek time display in controls
|
||||
* More documentation for controls html
|
||||
|
||||
## v1.0.14
|
||||
- Minor change for bootstrap compatibility
|
||||
|
||||
* Minor change for bootstrap compatibility
|
||||
|
||||
## v1.0.13
|
||||
- Minor tweaks
|
||||
|
||||
* Minor tweaks
|
||||
|
||||
## v1.0.12
|
||||
- Handle native events (Issue #34)
|
||||
|
||||
* Handle native events (issue #34)
|
||||
|
||||
## v1.0.11
|
||||
- Bug fixes for fullscreen mode
|
||||
|
||||
* Bug fixes for fullscreen mode
|
||||
|
||||
## v1.0.10
|
||||
- Bower includes src files now
|
||||
- Folder re-arrangement
|
||||
|
||||
* 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
|
||||
|
||||
* 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
|
||||
|
||||
* Bug fix
|
||||
|
||||
## v1.0.7
|
||||
- Storing user selected volume in local storage
|
||||
|
||||
* Storing user selected volume in local storage
|
||||
|
||||
## v1.0.6
|
||||
- Fullscreen fallback for older browsers to use "full window"
|
||||
|
||||
* Fullscreen fallback for older browsers to use "full window"
|
||||
|
||||
## v1.0.5
|
||||
- More minor bug fixes and improvements
|
||||
|
||||
* More minor bug fixes and improvements
|
||||
|
||||
## v1.0.4
|
||||
- Fixed caption legibility issues
|
||||
|
||||
* Fixed caption legibility issues
|
||||
|
||||
## v1.0.3
|
||||
- Minor bug fixes
|
||||
|
||||
* Minor bug fixes
|
||||
|
||||
## v1.0.2
|
||||
- Added OGG to <audio> example for Firefox
|
||||
- Fixed IE11 fullscreen issues
|
||||
|
||||
* 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
|
||||
|
||||
* 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
|
||||
|
||||
* Initial release
|
||||
|
161
controls.md
161
controls.md
@ -1,86 +1,113 @@
|
||||
# Controls HTML
|
||||
# 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.
|
||||
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.
|
||||
## Internationalization using default controls
|
||||
|
||||
## Requirements
|
||||
You can provide an `i18n` object as one of your options when initialising the plugin which we be used when rendering the controls.
|
||||
|
||||
The classes and data attributes used in your template should match the `selectors` option.
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
i18n: {
|
||||
restart: "Restart",
|
||||
rewind: "Rewind {seektime} secs",
|
||||
play: "Play",
|
||||
pause: "Pause",
|
||||
forward: "Forward {seektime} secs",
|
||||
buffered: "buffered",
|
||||
currentTime: "Current time",
|
||||
duration: "Duration",
|
||||
volume: "Volume",
|
||||
toggleMute: "Toggle Mute",
|
||||
toggleCaptions: "Toggle Captions",
|
||||
toggleFullscreen: "Toggle Fullscreen"
|
||||
}
|
||||
```
|
||||
|
||||
Note: `{seektime}` will be replaced with your configured seek time or the default. For example "Forward {seektime} secs" would render as "Forward 10 secs".
|
||||
|
||||
## Using custom HTML
|
||||
|
||||
You can specify the HTML for the controls using the `html` option.
|
||||
|
||||
The classes and data attributes used in your template should match the `selectors` option.
|
||||
|
||||
You need to add several placeholders to your html template that are replaced when rendering:
|
||||
|
||||
- `{id}` - the dynamically generated ID for the player (for form controls)
|
||||
- `{seektime}` - the seek time specified in options for fast forward and rewind
|
||||
- `{title}` - the title of your media, if specified
|
||||
|
||||
You can include only the controls you need when specifying custom html.
|
||||
You can include only the controls you need when specifying custom html.
|
||||
|
||||
## Example
|
||||
### 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'>",
|
||||
var controls = ["<div class='plyr__controls'>",
|
||||
"<button type='button' data-plyr='restart'>",
|
||||
"<svg><use xlink:href='#plyr-restart'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Restart</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='rewind'>",
|
||||
"<svg><use xlink:href='#plyr-rewind'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Rewind {seektime} secs</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='play'>",
|
||||
"<svg><use xlink:href='#plyr-play'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Play</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='pause'>",
|
||||
"<svg><use xlink:href='#plyr-pause'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Pause</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='fast-forward'>",
|
||||
"<svg><use xlink:href='#plyr-fast-forward'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Forward {seektime} secs</span>",
|
||||
"</button>",
|
||||
"<span class='plyr__progress'>",
|
||||
"<label for='seek{id}' class='plyr__sr-only'>Seek</label>",
|
||||
"<input id='seek{id}' class='plyr__progress--seek' type='range' min='0' max='100' step='0.1' value='0' data-plyr='seek'>",
|
||||
"<progress class='plyr__progress--played' max='100' value='0' role='presentation'></progress>",
|
||||
"<progress class='plyr__progress--buffer' max='100' value='0'>",
|
||||
"<span>0</span>% buffered",
|
||||
"</progress>",
|
||||
"</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 class='plyr__tooltip'>00:00</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 class='plyr__time'>",
|
||||
"<span class='plyr__sr-only'>Current time</span>",
|
||||
"<span class='plyr__time--current'>00:00</span>",
|
||||
"</span>",
|
||||
"</div>"].join("\n");
|
||||
```
|
||||
"<span class='plyr__time'>",
|
||||
"<span class='plyr__sr-only'>Duration</span>",
|
||||
"<span class='plyr__time--duration'>00:00</span>",
|
||||
"</span>",
|
||||
"<button type='button' data-plyr='mute'>",
|
||||
"<svg class='icon--muted'><use xlink:href='#plyr-muted'></use></svg>",
|
||||
"<svg><use xlink:href='#plyr-volume'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Toggle Mute</span>",
|
||||
"</button>",
|
||||
"<span class='plyr__volume'>",
|
||||
"<label for='volume{id}' class='plyr__sr-only'>Volume</label>",
|
||||
"<input id='volume{id}' class='plyr__volume--input' type='range' min='0' max='10' value='5' data-plyr='volume'>",
|
||||
"<progress class='plyr__volume--display' max='10' value='0' role='presentation'></progress>",
|
||||
"</span>",
|
||||
"<button type='button' data-plyr='captions'>",
|
||||
"<svg class='icon--captions-on'><use xlink:href='#plyr-captions-on'></use></svg>",
|
||||
"<svg><use xlink:href='#plyr-captions-off'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Toggle Captions</span>",
|
||||
"</button>",
|
||||
"<button type='button' data-plyr='fullscreen'>",
|
||||
"<svg class='icon--exit-fullscreen'><use xlink:href='#plyr-exit-fullscreen'></use></svg>",
|
||||
"<svg><use xlink:href='#plyr-enter-fullscreen'></use></svg>",
|
||||
"<span class='plyr__sr-only'>Toggle Fullscreen</span>",
|
||||
"</button>",
|
||||
"</div>"].join("");
|
||||
|
||||
// Setup the player
|
||||
plyr.setup('.js-player', {
|
||||
html: controls
|
||||
});
|
||||
```
|
||||
|
1
demo/dist/demo.css
vendored
Normal file
1
demo/dist/demo.css
vendored
Normal file
File diff suppressed because one or more lines are too long
4033
demo/dist/demo.js
vendored
Normal file
4033
demo/dist/demo.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
demo/dist/demo.js.map
vendored
Normal file
1
demo/dist/demo.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
demo/dist/demo.min.js
vendored
Normal file
2
demo/dist/demo.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
demo/dist/demo.min.js.map
vendored
Normal file
1
demo/dist/demo.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
25
demo/error.html
Normal file
25
demo/error.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="error">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Doh. Looks like something went wrong.</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="dist/error.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">
|
||||
</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>
|
187
demo/index.html
Normal file
187
demo/index.html
Normal file
@ -0,0 +1,187 @@
|
||||
<!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">
|
||||
|
||||
<!-- Opengraph -->
|
||||
<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">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="grid">
|
||||
<header>
|
||||
<h1>Plyr</h1>
|
||||
<p>A simple, accessible and customisable media player for
|
||||
<button type="button" class="faux-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="faux-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="faux-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="faux-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>
|
||||
|
||||
<p>Premium video monitization from
|
||||
<a href="https://vi.ai/publisher-video-monetization/?aid=plyrio" target="_blank" class="no-border">
|
||||
<img src="https://cdn.plyr.io/static/vi-logo-24x24.svg" alt="ai.vi">
|
||||
<span class="sr-only">ai.vi</span>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div class="call-to-action">
|
||||
<span class="button--with-count">
|
||||
<a href="https://github.com/sampotts/plyr" target="_blank" class="button" data-shr-network="github">
|
||||
<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>
|
||||
</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<video controls crossorigin playsinline 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-HD.mp4" type="video/mp4">
|
||||
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.webm" type="video/webm">
|
||||
|
||||
<!-- Text track file -->
|
||||
<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-HD.mp4" download>Download</a>
|
||||
</video>
|
||||
|
||||
<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="http://viewfromabluemoon.com/" target="_blank">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">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/ondemand/viewfromabluemoon4k" target="_blank">View From A Blue Moon</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" data-shr-network="twitter">tweet it</a>
|
||||
</p>
|
||||
</aside>
|
||||
|
||||
<!-- Polyfills -->
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,Array.prototype.includes,CustomEvent" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Plyr core script -->
|
||||
<script src="../dist/plyr.js" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Sharing libary (https://shr.one) -->
|
||||
<script src="https://cdn.shr.one/1.0.1/shr.js" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
|
||||
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Docs script -->
|
||||
<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 |
276
demo/src/js/demo.js
Normal file
276
demo/src/js/demo.js
Normal file
@ -0,0 +1,276 @@
|
||||
// ==========================================================================
|
||||
// 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 Raven from 'raven-js';
|
||||
|
||||
(() => {
|
||||
const isLive = window.location.host === 'plyr.io';
|
||||
|
||||
// Raven / Sentry
|
||||
// For demo site (https://plyr.io) only
|
||||
if (isLive) {
|
||||
Raven.config('https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555').install();
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
Raven.context(() => {
|
||||
if (window.shr) {
|
||||
window.shr.setup({
|
||||
count: {
|
||||
classname: 'button__count',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Setup tab focus
|
||||
const tabClassName = 'tab-focus';
|
||||
|
||||
// Remove class on blur
|
||||
document.addEventListener('focusout', event => {
|
||||
event.target.classList.remove(tabClassName);
|
||||
});
|
||||
|
||||
// Add classname to tabbed elements
|
||||
document.addEventListener('keydown', event => {
|
||||
if (event.keyCode !== 9) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delay the adding of classname until the focus has changed
|
||||
// This event fires before the focusin event
|
||||
setTimeout(() => {
|
||||
document.activeElement.classList.add(tabClassName);
|
||||
}, 0);
|
||||
});
|
||||
|
||||
// Setup the player
|
||||
const player = new Plyr('#player', {
|
||||
debug: true,
|
||||
title: 'View From A Blue Moon',
|
||||
iconUrl: '../dist/plyr.svg',
|
||||
keyboard: {
|
||||
global: true,
|
||||
},
|
||||
tooltips: {
|
||||
controls: true,
|
||||
},
|
||||
/* controls: [
|
||||
'play-large',
|
||||
'restart',
|
||||
'rewind',
|
||||
'play',
|
||||
'fast-forward',
|
||||
'progress',
|
||||
'current-time',
|
||||
'mute',
|
||||
'volume',
|
||||
'captions',
|
||||
'settings',
|
||||
'pip',
|
||||
'airplay',
|
||||
'fullscreen',
|
||||
], */
|
||||
captions: {
|
||||
active: true,
|
||||
},
|
||||
keys: {
|
||||
google: 'AIzaSyDrNwtN3nLH_8rjCmu5Wq3ZCm4MNAVdc0c',
|
||||
},
|
||||
ads: {
|
||||
// enabled: true,
|
||||
publisherId: '918848828995742',
|
||||
},
|
||||
});
|
||||
|
||||
// Expose for tinkering in the console
|
||||
window.player = player;
|
||||
|
||||
// Setup type toggle
|
||||
const buttons = document.querySelectorAll('[data-source]');
|
||||
const types = {
|
||||
video: 'video',
|
||||
audio: 'audio',
|
||||
youtube: 'youtube',
|
||||
vimeo: 'vimeo',
|
||||
};
|
||||
let currentType = window.location.hash.replace('#', '');
|
||||
const historySupport = window.history && window.history.pushState;
|
||||
|
||||
// Toggle class on an element
|
||||
function toggleClass(element, className, state) {
|
||||
if (element) {
|
||||
element.classList[state ? 'add' : 'remove'](className);
|
||||
}
|
||||
}
|
||||
|
||||
// Set a new source
|
||||
function newSource(type, init) {
|
||||
// Bail if new type isn't known, it's the current type, or current type is empty (video is default) and new type is video
|
||||
if (!(type in types) || (!init && type === currentType) || (!currentType.length && type === types.video)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case types.video:
|
||||
player.source = {
|
||||
type: 'video',
|
||||
title: 'View From A Blue Moon',
|
||||
sources: [{
|
||||
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4',
|
||||
type: 'video/mp4',
|
||||
}],
|
||||
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',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case types.audio:
|
||||
player.source = {
|
||||
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',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case types.youtube:
|
||||
player.source = {
|
||||
type: 'video',
|
||||
title: 'View From A Blue Moon',
|
||||
sources: [{
|
||||
src: 'https://youtube.com/watch?v=bTqVqk7FSmY',
|
||||
provider: 'youtube',
|
||||
}],
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case types.vimeo:
|
||||
player.source = {
|
||||
type: 'video',
|
||||
sources: [{
|
||||
src: 'https://vimeo.com/76979871',
|
||||
provider: 'vimeo',
|
||||
}],
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Set the current type for next time
|
||||
currentType = type;
|
||||
|
||||
// Remove active classes
|
||||
Array.from(buttons).forEach(button => toggleClass(button.parentElement, 'active', false));
|
||||
|
||||
// Set active on parent
|
||||
toggleClass(document.querySelector(`[data-source="${type}"]`), 'active', true);
|
||||
|
||||
// Show cite
|
||||
Array.from(document.querySelectorAll('.plyr__cite')).forEach(cite => {
|
||||
cite.setAttribute('hidden', '');
|
||||
});
|
||||
document.querySelector(`.plyr__cite--${type}`).removeAttribute('hidden');
|
||||
}
|
||||
|
||||
// Bind to each button
|
||||
Array.from(buttons).forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
const type = button.getAttribute('data-source');
|
||||
|
||||
newSource(type);
|
||||
|
||||
if (historySupport) {
|
||||
window.history.pushState({ type }, '', `#${type}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// List for backwards/forwards
|
||||
window.addEventListener('popstate', event => {
|
||||
if (event.state && 'type' in event.state) {
|
||||
newSource(event.state.type);
|
||||
}
|
||||
});
|
||||
|
||||
// On load
|
||||
if (historySupport) {
|
||||
const video = !currentType.length;
|
||||
|
||||
// If there's no current type set, assume video
|
||||
if (video) {
|
||||
currentType = types.video;
|
||||
}
|
||||
|
||||
// Replace current history state
|
||||
if (currentType in types) {
|
||||
window.history.replaceState(
|
||||
{
|
||||
type: currentType,
|
||||
},
|
||||
'',
|
||||
video ? '' : `#${currentType}`,
|
||||
);
|
||||
}
|
||||
|
||||
// If it's not video, load the source
|
||||
if (currentType !== types.video) {
|
||||
newSource(currentType, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Google analytics
|
||||
// For demo site (https://plyr.io) only
|
||||
/* eslint-disable */
|
||||
if (isLive) {
|
||||
(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', 'https://www.google-analytics.com/analytics.js', 'ga');
|
||||
window.ga('create', 'UA-40881672-11', 'auto');
|
||||
window.ga('send', 'pageview');
|
||||
}
|
||||
/* eslint-enable */
|
||||
})();
|
46
demo/src/sass/bundles/demo.scss
Normal file
46
demo/src/sass/bundles/demo.scss
Normal file
@ -0,0 +1,46 @@
|
||||
// ==========================================================================
|
||||
// Plyr.io Demo Page
|
||||
// ==========================================================================
|
||||
@charset 'UTF-8';
|
||||
|
||||
// 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';
|
29
demo/src/sass/bundles/error.scss
Normal file
29
demo/src/sass/bundles/error.scss
Normal file
@ -0,0 +1,29 @@
|
||||
// ==========================================================================
|
||||
// Plyr.io Error Page
|
||||
// ==========================================================================
|
||||
@charset 'UTF-8';
|
||||
|
||||
// Libs
|
||||
@import '../lib/fontface';
|
||||
@import '../lib/mixins';
|
||||
@import '../lib/normalize';
|
||||
@import '../lib/reset';
|
||||
|
||||
// Settings
|
||||
@import '../settings/colors';
|
||||
@import '../settings/cosmetic';
|
||||
@import '../settings/icons';
|
||||
@import '../settings/layout';
|
||||
@import '../settings/spacing';
|
||||
@import '../settings/type';
|
||||
|
||||
// Layout
|
||||
@import '../layout/error';
|
||||
|
||||
// Type
|
||||
@import '../type/base';
|
||||
@import '../type/headings';
|
||||
|
||||
// Components
|
||||
@import '../components/buttons';
|
||||
@import '../components/links';
|
83
demo/src/sass/components/buttons.scss
Normal file
83
demo/src/sass/components/buttons.scss
Normal file
@ -0,0 +1,83 @@
|
||||
// ==========================================================================
|
||||
// Buttons
|
||||
// ==========================================================================
|
||||
|
||||
// Shared
|
||||
.button,
|
||||
.button__count {
|
||||
align-items: center;
|
||||
background: $color-button-background;
|
||||
border: 0;
|
||||
border-radius: $border-radius-base;
|
||||
box-shadow: 0 1px 1px rgba(#000, 0.1);
|
||||
color: $color-button-text;
|
||||
display: inline-flex;
|
||||
padding: ($spacing-base * 0.75);
|
||||
position: relative;
|
||||
text-shadow: none;
|
||||
user-select: none;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
.button {
|
||||
font-weight: $font-weight-bold;
|
||||
padding-left: $spacing-base;
|
||||
padding-right: $spacing-base;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: $gray-dark;
|
||||
|
||||
// Remove the underline/border
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 2px rgba(#000, 0.1);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
&.tab-focus {
|
||||
@include tab-focus();
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
}
|
||||
|
||||
// Button group
|
||||
.button--with-count {
|
||||
display: inline-flex;
|
||||
|
||||
.button .icon {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Count bubble
|
||||
.button__count {
|
||||
animation: fadein 0.2s ease;
|
||||
margin-left: ($spacing-base / 2);
|
||||
|
||||
&::before {
|
||||
border: $arrow-size solid transparent;
|
||||
border-left-width: 0;
|
||||
border-right-color: $color-button-background;
|
||||
content: '';
|
||||
height: 0;
|
||||
position: absolute;
|
||||
right: 100%;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 0;
|
||||
}
|
||||
}
|
19
demo/src/sass/components/header.scss
Normal file
19
demo/src/sass/components/header.scss
Normal file
@ -0,0 +1,19 @@
|
||||
// ==========================================================================
|
||||
// Header
|
||||
// ==========================================================================
|
||||
|
||||
header {
|
||||
padding-bottom: $spacing-base;
|
||||
text-align: center;
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
23
demo/src/sass/components/icons.scss
Normal file
23
demo/src/sass/components/icons.scss
Normal file
@ -0,0 +1,23 @@
|
||||
// ==========================================================================
|
||||
// Icons
|
||||
// ==========================================================================
|
||||
|
||||
// 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: floor($spacing-base / 3);
|
||||
}
|
49
demo/src/sass/components/links.scss
Normal file
49
demo/src/sass/components/links.scss
Normal file
@ -0,0 +1,49 @@
|
||||
// ==========================================================================
|
||||
// Links
|
||||
// ==========================================================================
|
||||
|
||||
// Make a <button> look like an <a>
|
||||
button.faux-link {
|
||||
@extend a; // stylelint-disable-line
|
||||
@include cancel-button-styles();
|
||||
}
|
||||
|
||||
// Links
|
||||
a {
|
||||
border-bottom: 1px dotted currentColor;
|
||||
color: $color-link;
|
||||
font-weight: $font-weight-bold;
|
||||
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%;
|
||||
}
|
||||
}
|
||||
|
||||
&.tab-focus {
|
||||
@include tab-focus();
|
||||
}
|
||||
|
||||
&.no-border::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
@ -1,13 +1,11 @@
|
||||
// ==========================================================================
|
||||
// Panels
|
||||
// Lists
|
||||
// ==========================================================================
|
||||
|
||||
// Panels
|
||||
.panel {
|
||||
display: none;
|
||||
|
||||
&.active {
|
||||
display: block;
|
||||
animation: fade-in .3s ease;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
49
demo/src/sass/components/players.scss
Normal file
49
demo/src/sass/components/players.scss
Normal file
@ -0,0 +1,49 @@
|
||||
// ==========================================================================
|
||||
// Examples
|
||||
// ==========================================================================
|
||||
|
||||
// For non supported browsers
|
||||
video {
|
||||
max-width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// Example players
|
||||
.plyr {
|
||||
border-radius: $border-radius-base;
|
||||
box-shadow: 0 2px 5px rgba(#000, 0.2);
|
||||
margin: $spacing-base auto;
|
||||
|
||||
&.plyr--audio {
|
||||
max-width: 480px;
|
||||
}
|
||||
}
|
||||
|
||||
.plyr__video-wrapper::after {
|
||||
border: 1px solid rgba(#000, 0.15);
|
||||
border-radius: inherit;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
// Style full supported player
|
||||
.plyr__cite {
|
||||
display: none;
|
||||
margin-top: $spacing-base;
|
||||
|
||||
.icon {
|
||||
margin-right: ceil($spacing-base / 6);
|
||||
}
|
||||
}
|
||||
|
||||
.plyr--video:not(.plyr--youtube):not(.plyr--vimeo) ~ ul .plyr__cite--video,
|
||||
.plyr--audio ~ ul .plyr__cite--audio,
|
||||
.plyr--youtube ~ ul .plyr__cite--youtube,
|
||||
.plyr--vimeo ~ ul .plyr__cite--vimeo {
|
||||
display: block;
|
||||
}
|
64
demo/src/sass/layout/core.scss
Normal file
64
demo/src/sass/layout/core.scss
Normal file
@ -0,0 +1,64 @@
|
||||
// ==========================================================================
|
||||
// Core
|
||||
// ==========================================================================
|
||||
|
||||
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;
|
||||
color: $gray;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
justify-content: center;
|
||||
padding: ($spacing-base * 0.75);
|
||||
position: relative;
|
||||
text-align: center;
|
||||
text-shadow: none;
|
||||
width: 100%;
|
||||
|
||||
.icon {
|
||||
fill: $color-twitter;
|
||||
margin-right: ($spacing-base / 2);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $color-twitter;
|
||||
|
||||
&.tab-focus {
|
||||
@include tab-focus($color-twitter);
|
||||
}
|
||||
}
|
||||
}
|
@ -7,13 +7,24 @@ html.error,
|
||||
.error body {
|
||||
height: 100%;
|
||||
}
|
||||
.error body {
|
||||
width: 100%;
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
|
||||
html.error {
|
||||
background: $page-background;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
.error main {
|
||||
display: table-cell;
|
||||
|
||||
.error body {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,11 @@
|
||||
// ==========================================================================
|
||||
|
||||
// Fade
|
||||
@keyframes fade-in {
|
||||
0% { opacity: 0 }
|
||||
100% { opacity: 1 }
|
||||
}
|
||||
@keyframes fadein {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
45
demo/src/sass/lib/fontface.scss
Normal file
45
demo/src/sass/lib/fontface.scss
Normal file
@ -0,0 +1,45 @@
|
||||
// ==========================================================================
|
||||
// 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');
|
||||
}
|
54
demo/src/sass/lib/mixins.scss
Normal file
54
demo/src/sass/lib/mixins.scss
Normal file
@ -0,0 +1,54 @@
|
||||
// ==========================================================================
|
||||
// Mixins
|
||||
// ==========================================================================
|
||||
|
||||
// Convert a <button> into an <a>
|
||||
// ---------------------------------------
|
||||
@mixin cancel-button-styles() {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
line-height: $line-height-base;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
text-align: inherit;
|
||||
text-shadow: inherit;
|
||||
-moz-user-select: text; // stylelint-disable-line
|
||||
vertical-align: baseline;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
// Nicer focus styles
|
||||
// ---------------------------------------
|
||||
@mixin tab-focus($color: $tab-focus-default-color) {
|
||||
box-shadow: 0 0 0 3px rgba($color, 0.35);
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
// Use rems for font sizing
|
||||
// Leave <body> at 100%/16px
|
||||
// ---------------------------------------
|
||||
@function calculate-rem($size) {
|
||||
$rem: $size / 16;
|
||||
@return #{$rem}rem;
|
||||
}
|
||||
|
||||
@mixin font-size($size: 16) {
|
||||
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;
|
||||
}
|
||||
}
|
450
demo/src/sass/lib/normalize.scss
vendored
Normal file
450
demo/src/sass/lib/normalize.scss
vendored
Normal file
@ -0,0 +1,450 @@
|
||||
/*! 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 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-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, 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 */
|
||||
-webkit-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: none; /* 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'] {
|
||||
-webkit-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'] {
|
||||
-webkit-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 {
|
||||
-webkit-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 {
|
||||
-webkit-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;
|
||||
}
|
11
demo/src/sass/lib/reset.scss
Normal file
11
demo/src/sass/lib/reset.scss
Normal file
@ -0,0 +1,11 @@
|
||||
// ==========================================================================
|
||||
// Resets
|
||||
// ==========================================================================
|
||||
|
||||
// BORDER-BOX ALL THE THINGS!
|
||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||
*,
|
||||
*::after,
|
||||
*::before {
|
||||
box-sizing: border-box;
|
||||
}
|
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;
|
32
demo/src/sass/settings/colors.scss
Normal file
32
demo/src/sass/settings/colors.scss
Normal file
@ -0,0 +1,32 @@
|
||||
// ==========================================================================
|
||||
// Colors
|
||||
// ==========================================================================
|
||||
|
||||
// Greyscale
|
||||
$gray-dark: #343f4a;
|
||||
$gray: #55646b;
|
||||
$gray-light: #cbd0d3;
|
||||
$gray-lighter: #dbe3e8;
|
||||
$off-white: #f2f5f7;
|
||||
|
||||
// Text
|
||||
$color-text: #fff;
|
||||
|
||||
// Plyr
|
||||
$color-brand-primary: #1aafff;
|
||||
|
||||
// Brands
|
||||
$color-twitter: #4baaf4;
|
||||
$color-youtube: #cc181e;
|
||||
$color-vimeo: #19b7ed;
|
||||
|
||||
// Elements
|
||||
$color-link: #fff;
|
||||
$color-background: $color-brand-primary;
|
||||
|
||||
// Buttons
|
||||
$color-button-background: #fff;
|
||||
$color-button-text: $gray;
|
||||
|
||||
// Focus
|
||||
$tab-focus-default-color: #fff;
|
12
demo/src/sass/settings/cosmetic.scss
Normal file
12
demo/src/sass/settings/cosmetic.scss
Normal file
@ -0,0 +1,12 @@
|
||||
// ==========================================================================
|
||||
// Misc cosmetic
|
||||
// ==========================================================================
|
||||
|
||||
// Button count arrow size
|
||||
$arrow-size: 5px;
|
||||
|
||||
// Radii
|
||||
$border-radius-base: 4px;
|
||||
|
||||
// Background
|
||||
$page-background: linear-gradient(to left top, lighten($color-background, 10%), darken($color-background, 20%));
|
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: 1280px;
|
18
demo/src/sass/settings/plyr.scss
Normal file
18
demo/src/sass/settings/plyr.scss
Normal file
@ -0,0 +1,18 @@
|
||||
// ==========================================================================
|
||||
// Plyr Settings
|
||||
// ==========================================================================
|
||||
|
||||
// Font
|
||||
$plyr-font-family: inherit;
|
||||
|
||||
// Sizes
|
||||
$plyr-font-size-base: 13px;
|
||||
$plyr-font-size-small: 12px;
|
||||
$plyr-font-size-time: 11px;
|
||||
$plyr-font-size-badges: 9px;
|
||||
|
||||
// Captions
|
||||
$plyr-font-size-captions-base: $plyr-font-size-base;
|
||||
$plyr-font-size-captions-small: $plyr-font-size-small;
|
||||
$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: 20px;
|
20
demo/src/sass/settings/type.scss
Normal file
20
demo/src/sass/settings/type.scss
Normal file
@ -0,0 +1,20 @@
|
||||
// ==========================================================================
|
||||
// Typography
|
||||
// ==========================================================================
|
||||
|
||||
$font-sans-serif: 'Gordita', 'Avenir', 'Helvetica Neue', sans-serif;
|
||||
|
||||
$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;
|
35
demo/src/sass/type/base.scss
Normal file
35
demo/src/sass/type/base.scss
Normal file
@ -0,0 +1,35 @@
|
||||
// ==========================================================================
|
||||
// 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;
|
||||
text-shadow: 0 1px 1px rgba(#000, 0.15);
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
p,
|
||||
small {
|
||||
margin: 0 0 $spacing-base;
|
||||
}
|
||||
|
||||
small {
|
||||
@include font-size($font-size-small);
|
||||
display: block;
|
||||
}
|
10
demo/src/sass/type/headings.scss
Normal file
10
demo/src/sass/type/headings.scss
Normal file
@ -0,0 +1,10 @@
|
||||
// ==========================================================================
|
||||
// Headings
|
||||
// ==========================================================================
|
||||
|
||||
h1 {
|
||||
@include font-size($font-size-h1);
|
||||
font-weight: $font-weight-bold;
|
||||
letter-spacing: $letter-spacing-headings;
|
||||
margin: 0 0 ($spacing-base / 2);
|
||||
}
|
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;
|
||||
}
|
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;
|
||||
}
|
BIN
dist/blank.mp4
vendored
Normal file
BIN
dist/blank.mp4
vendored
Normal file
Binary file not shown.
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
7730
dist/plyr.js
vendored
7730
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
1
dist/plyr.js.map
vendored
Normal file
1
dist/plyr.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/plyr.min.js
vendored
Normal file
2
dist/plyr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/plyr.min.js.map
vendored
Normal file
1
dist/plyr.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
12917
dist/plyr.polyfilled.js
vendored
Normal file
12917
dist/plyr.polyfilled.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
dist/plyr.polyfilled.js.map
vendored
Normal file
1
dist/plyr.polyfilled.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/plyr.polyfilled.min.js
vendored
Normal file
2
dist/plyr.polyfilled.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/plyr.polyfilled.min.js.map
vendored
Normal file
1
dist/plyr.polyfilled.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/plyr.svg
vendored
Normal file
1
dist/plyr.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="plyr-airplay" viewBox="0 0 18 18"><path d="M16 1H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3v-2H3V3h12v8h-2v2h3a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"/><path d="M4 17h10l-5-6z"/></symbol><symbol id="plyr-captions-off" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd" fill-opacity=".5"/></symbol><symbol id="plyr-captions-on" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd"/></symbol><symbol id="plyr-enter-fullscreen" viewBox="0 0 18 18"><path d="M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"/></symbol><symbol id="plyr-exit-fullscreen" viewBox="0 0 18 18"><path d="M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"/></symbol><symbol id="plyr-fast-forward" viewBox="0 0 18 18"><path d="M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"/></symbol><symbol id="plyr-muted" viewBox="0 0 18 18"><path d="M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol><symbol id="plyr-pause" viewBox="0 0 18 18"><path d="M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM12 1c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"/></symbol><symbol id="plyr-pip" viewBox="0 0 18 18"><path d="M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"/><path d="M13 15H3V5h5V3H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-6h-2v5z"/></symbol><symbol id="plyr-play" viewBox="0 0 18 18"><path d="M15.562 8.1L3.87.225C3.052-.337 2 .225 2 1.125v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"/></symbol><symbol id="plyr-restart" viewBox="0 0 18 18"><path d="M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"/></symbol><symbol id="plyr-rewind" viewBox="0 0 18 18"><path d="M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"/></symbol><symbol id="plyr-settings" viewBox="0 0 18 18"><path d="M16.135 7.784a2 2 0 0 1-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 0 1-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 0 1-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 0 1-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 0 1 1.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 0 1 2.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 0 1 2.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 0 1 1.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/></symbol><symbol id="plyr-volume" viewBox="0 0 18 18"><path d="M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"/><path d="M11.282 5.282a.909.909 0 0 0 0 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 0 0 0 1.316c.145.145.636.262 1.018.156a.725.725 0 0 0 .298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 0 0-1.316 0zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol></svg>
|
After Width: | Height: | Size: 4.9 KiB |
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.6/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.6/plyr.css?2">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="https://cdn.plyr.io/1.2.6/docs.css?1">
|
||||
</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.6/sprite.svg");
|
||||
</script>
|
||||
|
||||
<!-- Plyr core script -->
|
||||
<script src="https://cdn.plyr.io/1.2.6/plyr.js?1"></script>
|
||||
|
||||
<!-- Docs script -->
|
||||
<script src="https://cdn.plyr.io/1.2.6/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,237 +0,0 @@
|
||||
/*
|
||||
* classList.js: Cross-browser full element.classList implementation.
|
||||
* 1.1.20150312
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* License: Dedicated to the public domain.
|
||||
* See https://github.com/eligrey/classList.js/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
/*global self, document, DOMException */
|
||||
|
||||
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
|
||||
|
||||
if ("document" in self) {
|
||||
|
||||
// Full polyfill for browsers with no classList support
|
||||
if (!("classList" in document.createElement("_"))) {
|
||||
|
||||
(function (view) {
|
||||
|
||||
"use strict";
|
||||
|
||||
if (!('Element' in view)) return;
|
||||
|
||||
var
|
||||
classListProp = "classList"
|
||||
, protoProp = "prototype"
|
||||
, elemCtrProto = view.Element[protoProp]
|
||||
, objCtr = Object
|
||||
, strTrim = String[protoProp].trim || function () {
|
||||
return this.replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
, arrIndexOf = Array[protoProp].indexOf || function (item) {
|
||||
var
|
||||
i = 0
|
||||
, len = this.length
|
||||
;
|
||||
for (; i < len; i++) {
|
||||
if (i in this && this[i] === item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
// Vendors: please allow content code to instantiate DOMExceptions
|
||||
, DOMEx = function (type, message) {
|
||||
this.name = type;
|
||||
this.code = DOMException[type];
|
||||
this.message = message;
|
||||
}
|
||||
, checkTokenAndGetIndex = function (classList, token) {
|
||||
if (token === "") {
|
||||
throw new DOMEx(
|
||||
"SYNTAX_ERR"
|
||||
, "An invalid or illegal string was specified"
|
||||
);
|
||||
}
|
||||
if (/\s/.test(token)) {
|
||||
throw new DOMEx(
|
||||
"INVALID_CHARACTER_ERR"
|
||||
, "String contains an invalid character"
|
||||
);
|
||||
}
|
||||
return arrIndexOf.call(classList, token);
|
||||
}
|
||||
, ClassList = function (elem) {
|
||||
var
|
||||
trimmedClasses = strTrim.call(elem.getAttribute("class") || "")
|
||||
, classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
|
||||
, i = 0
|
||||
, len = classes.length
|
||||
;
|
||||
for (; i < len; i++) {
|
||||
this.push(classes[i]);
|
||||
}
|
||||
this._updateClassName = function () {
|
||||
elem.setAttribute("class", this.toString());
|
||||
};
|
||||
}
|
||||
, classListProto = ClassList[protoProp] = []
|
||||
, classListGetter = function () {
|
||||
return new ClassList(this);
|
||||
}
|
||||
;
|
||||
// Most DOMException implementations don't allow calling DOMException's toString()
|
||||
// on non-DOMExceptions. Error's toString() is sufficient here.
|
||||
DOMEx[protoProp] = Error[protoProp];
|
||||
classListProto.item = function (i) {
|
||||
return this[i] || null;
|
||||
};
|
||||
classListProto.contains = function (token) {
|
||||
token += "";
|
||||
return checkTokenAndGetIndex(this, token) !== -1;
|
||||
};
|
||||
classListProto.add = function () {
|
||||
var
|
||||
tokens = arguments
|
||||
, i = 0
|
||||
, l = tokens.length
|
||||
, token
|
||||
, updated = false
|
||||
;
|
||||
do {
|
||||
token = tokens[i] + "";
|
||||
if (checkTokenAndGetIndex(this, token) === -1) {
|
||||
this.push(token);
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
while (++i < l);
|
||||
|
||||
if (updated) {
|
||||
this._updateClassName();
|
||||
}
|
||||
};
|
||||
classListProto.remove = function () {
|
||||
var
|
||||
tokens = arguments
|
||||
, i = 0
|
||||
, l = tokens.length
|
||||
, token
|
||||
, updated = false
|
||||
, index
|
||||
;
|
||||
do {
|
||||
token = tokens[i] + "";
|
||||
index = checkTokenAndGetIndex(this, token);
|
||||
while (index !== -1) {
|
||||
this.splice(index, 1);
|
||||
updated = true;
|
||||
index = checkTokenAndGetIndex(this, token);
|
||||
}
|
||||
}
|
||||
while (++i < l);
|
||||
|
||||
if (updated) {
|
||||
this._updateClassName();
|
||||
}
|
||||
};
|
||||
classListProto.toggle = function (token, force) {
|
||||
token += "";
|
||||
|
||||
var
|
||||
result = this.contains(token)
|
||||
, method = result ?
|
||||
force !== true && "remove"
|
||||
:
|
||||
force !== false && "add"
|
||||
;
|
||||
|
||||
if (method) {
|
||||
this[method](token);
|
||||
}
|
||||
|
||||
if (force === true || force === false) {
|
||||
return force;
|
||||
} else {
|
||||
return !result;
|
||||
}
|
||||
};
|
||||
classListProto.toString = function () {
|
||||
return this.join(" ");
|
||||
};
|
||||
|
||||
if (objCtr.defineProperty) {
|
||||
var classListPropDesc = {
|
||||
get: classListGetter
|
||||
, enumerable: true
|
||||
, configurable: true
|
||||
};
|
||||
try {
|
||||
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||
} catch (ex) { // IE 8 doesn't support enumerable:true
|
||||
if (ex.number === -0x7FF5EC54) {
|
||||
classListPropDesc.enumerable = false;
|
||||
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||
}
|
||||
}
|
||||
} else if (objCtr[protoProp].__defineGetter__) {
|
||||
elemCtrProto.__defineGetter__(classListProp, classListGetter);
|
||||
}
|
||||
|
||||
}(self));
|
||||
|
||||
} else {
|
||||
// There is full or partial native classList support, so just check if we need
|
||||
// to normalize the add/remove and toggle APIs.
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var testElement = document.createElement("_");
|
||||
|
||||
testElement.classList.add("c1", "c2");
|
||||
|
||||
// Polyfill for IE 10/11 and Firefox <26, where classList.add and
|
||||
// classList.remove exist but support only one argument at a time.
|
||||
if (!testElement.classList.contains("c2")) {
|
||||
var createMethod = function(method) {
|
||||
var original = DOMTokenList.prototype[method];
|
||||
|
||||
DOMTokenList.prototype[method] = function(token) {
|
||||
var i, len = arguments.length;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
token = arguments[i];
|
||||
original.call(this, token);
|
||||
}
|
||||
};
|
||||
};
|
||||
createMethod('add');
|
||||
createMethod('remove');
|
||||
}
|
||||
|
||||
testElement.classList.toggle("c3", false);
|
||||
|
||||
// Polyfill for IE 10 and Firefox <24, where classList.toggle does not
|
||||
// support the second argument.
|
||||
if (testElement.classList.contains("c3")) {
|
||||
var _toggle = DOMTokenList.prototype.toggle;
|
||||
|
||||
DOMTokenList.prototype.toggle = function(token, force) {
|
||||
if (1 in arguments && !this.contains(token) === !force) {
|
||||
return force;
|
||||
} else {
|
||||
return _toggle.call(this, token);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
testElement = null;
|
||||
}());
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -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,52 +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);
|
||||
padding: 0 (@padding-base / 2);
|
||||
}
|
||||
|
||||
// Header
|
||||
header {
|
||||
padding: @padding-base;
|
||||
margin-bottom: @padding-base;
|
||||
|
||||
p {
|
||||
.font-size(18);
|
||||
}
|
||||
@media (min-width: @screen-sm) {
|
||||
padding-top: (@padding-base * 3);
|
||||
padding-bottom: (@padding-base * 3);
|
||||
}
|
||||
}
|
||||
|
||||
// Sections
|
||||
section {
|
||||
padding-bottom: @padding-base;
|
||||
|
||||
@media (min-width: @screen-sm) {
|
||||
padding-bottom: (@padding-base * 2);
|
||||
}
|
||||
}
|
@ -1,146 +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;
|
||||
white-space: nowrap;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
background: @gray-lighter;
|
||||
}
|
||||
|
||||
ul {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: inline-block;
|
||||
user-select: none;
|
||||
}
|
||||
li {
|
||||
margin: 0;
|
||||
|
||||
&:first-child .btn {
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
&:last-child .btn {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
& + li .btn {
|
||||
margin-left: -1px;
|
||||
}
|
||||
}
|
||||
.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-image: linear-gradient(@link-color, darken(@link-color, 3%));
|
||||
background-color: @link-color;
|
||||
border-color: darken(@link-color, 10%);
|
||||
box-shadow: 0 1px 1px rgba(0,0,0, .15);
|
||||
text-shadow: 0 1px 1px rgba(0,0,0, .1);
|
||||
color: #fff;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: #fff;
|
||||
border-color: darken(@link-color, 20%);
|
||||
}
|
||||
}
|
||||
.btn-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,61 +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;
|
||||
}
|
||||
}
|
||||
// Base styles
|
||||
.example-video .player {
|
||||
max-width: @example-width-video;
|
||||
|
||||
video,
|
||||
iframe {
|
||||
border-radius: @border-radius-base;
|
||||
}
|
||||
iframe {
|
||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
||||
}
|
||||
}
|
||||
|
||||
// Style full supported player
|
||||
.example-video .player-video,
|
||||
.example-video .player-youtube {
|
||||
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;
|
||||
|
||||
.player-controls,
|
||||
video,
|
||||
iframe {
|
||||
border-radius: 0;
|
||||
}
|
||||
iframe {
|
||||
-webkit-mask-image: 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>
|
572
gulpfile.js
572
gulpfile.js
@ -1,276 +1,412 @@
|
||||
// ==========================================================================
|
||||
// Gulp build script
|
||||
// ==========================================================================
|
||||
/*global require, __dirname*/
|
||||
/*jshint -W079 */
|
||||
/* global require, __dirname */
|
||||
/* eslint no-console: "off" */
|
||||
|
||||
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 del = require('del');
|
||||
const path = require('path');
|
||||
const gulp = require('gulp');
|
||||
const gutil = require('gulp-util');
|
||||
const concat = require('gulp-concat');
|
||||
const filter = require('gulp-filter');
|
||||
const sass = require('gulp-sass');
|
||||
const cleancss = require('gulp-clean-css');
|
||||
const run = require('run-sequence');
|
||||
const prefix = require('gulp-autoprefixer');
|
||||
const gitbranch = require('git-branch');
|
||||
const svgstore = require('gulp-svgstore');
|
||||
const svgmin = require('gulp-svgmin');
|
||||
const rename = require('gulp-rename');
|
||||
const s3 = require('gulp-s3');
|
||||
const replace = require('gulp-replace');
|
||||
const open = require('gulp-open');
|
||||
const size = require('gulp-size');
|
||||
const rollup = require('gulp-better-rollup');
|
||||
const babel = require('rollup-plugin-babel');
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
const uglify = require('gulp-uglify-es').default;
|
||||
const commonjs = require('rollup-plugin-commonjs');
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
|
||||
var root = __dirname,
|
||||
paths = {
|
||||
const bundles = require('./bundles.json');
|
||||
const pkg = require('./package.json');
|
||||
|
||||
// Get AWS config
|
||||
let aws = {};
|
||||
try {
|
||||
aws = require('./aws.json'); //eslint-disable-line
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
const minSuffix = '.min';
|
||||
|
||||
// Paths
|
||||
const root = __dirname;
|
||||
const 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")
|
||||
sass: path.join(root, 'src/sass/**/*.scss'),
|
||||
js: path.join(root, 'src/js/**/*'),
|
||||
sprite: path.join(root, 'src/sprite/*.svg'),
|
||||
},
|
||||
|
||||
// Output paths
|
||||
output: path.join(root, "dist/")
|
||||
output: path.join(root, 'dist/'),
|
||||
},
|
||||
docs: {
|
||||
demo: {
|
||||
// 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")
|
||||
sass: path.join(root, 'demo/src/sass/**/*.scss'),
|
||||
js: path.join(root, 'demo/src/js/**/*'),
|
||||
},
|
||||
|
||||
// Output paths
|
||||
output: path.join(root, "docs/dist/"),
|
||||
// Docs
|
||||
root: path.join(root, "docs/")
|
||||
output: path.join(root, 'demo/dist/'),
|
||||
|
||||
// Demo
|
||||
root: path.join(root, 'demo/'),
|
||||
},
|
||||
upload: [path.join(root, "dist/**"), path.join(root, "docs/dist/**")]
|
||||
},
|
||||
upload: [
|
||||
path.join(root, `dist/*${minSuffix}.*`),
|
||||
path.join(root, 'dist/*.css'),
|
||||
path.join(root, 'dist/*.svg'),
|
||||
path.join(root, `demo/dist/*${minSuffix}.*`),
|
||||
path.join(root, 'demo/dist/*.css'),
|
||||
],
|
||||
};
|
||||
|
||||
// Task arrays
|
||||
tasks = {
|
||||
less: [],
|
||||
sass: [],
|
||||
js: []
|
||||
},
|
||||
const tasks = {
|
||||
sass: [],
|
||||
js: [],
|
||||
sprite: [],
|
||||
clean: ['clean'],
|
||||
};
|
||||
|
||||
// Fetch bundles from JSON
|
||||
bundles = loadJSON(path.join(root, "bundles.json")),
|
||||
package = loadJSON(path.join(root, "package.json"));
|
||||
// Size plugin
|
||||
const sizeOptions = { showFiles: true, gzip: true };
|
||||
|
||||
// Load json
|
||||
function loadJSON(path) {
|
||||
return JSON.parse(fs.readFileSync(path));
|
||||
}
|
||||
// Browserlist
|
||||
const browsers = ['> 1%'];
|
||||
|
||||
var build = {
|
||||
js: function (files, bundle) {
|
||||
for (var key in files) {
|
||||
(function(key) {
|
||||
var name = "js-" + key;
|
||||
tasks.js.push(name);
|
||||
// Babel config
|
||||
const babelrc = {
|
||||
presets: [[
|
||||
'env',
|
||||
{
|
||||
targets: {
|
||||
browsers,
|
||||
},
|
||||
useBuiltIns: true,
|
||||
modules: false,
|
||||
},
|
||||
]],
|
||||
plugins: ['external-helpers'],
|
||||
babelrc: false,
|
||||
exclude: 'node_modules/**',
|
||||
};
|
||||
|
||||
gulp.task(name, function () {
|
||||
return gulp
|
||||
.src(bundles[bundle].js[key])
|
||||
.pipe(concat(key))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest(paths[bundle].output));
|
||||
});
|
||||
})(key);
|
||||
}
|
||||
// Clean out /dist
|
||||
gulp.task('clean', () => {
|
||||
const dirs = [
|
||||
paths.plyr.output,
|
||||
paths.demo.output,
|
||||
].map(dir => path.join(dir, '**/*'));
|
||||
|
||||
// Don't delete the mp4
|
||||
dirs.push(`!${path.join(paths.plyr.output, '**/*.mp4')}`);
|
||||
|
||||
del(dirs);
|
||||
});
|
||||
|
||||
const build = {
|
||||
js(files, bundle, options) {
|
||||
Object.keys(files).forEach(key => {
|
||||
const name = `js:${key}`;
|
||||
tasks.js.push(name);
|
||||
const { output } = paths[bundle];
|
||||
|
||||
gulp.task(name, () =>
|
||||
gulp
|
||||
.src(bundles[bundle].js[key])
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(concat(key))
|
||||
.pipe(
|
||||
rollup(
|
||||
{
|
||||
plugins: [
|
||||
resolve(),
|
||||
commonjs(),
|
||||
babel(babelrc),
|
||||
],
|
||||
},
|
||||
options,
|
||||
),
|
||||
)
|
||||
.pipe(sourcemaps.write(''))
|
||||
.pipe(gulp.dest(output))
|
||||
.pipe(filter('**/*.js'))
|
||||
.pipe(uglify())
|
||||
.pipe(size(sizeOptions))
|
||||
.pipe(rename({ suffix: minSuffix }))
|
||||
.pipe(sourcemaps.write(''))
|
||||
.pipe(gulp.dest(output)),
|
||||
);
|
||||
});
|
||||
},
|
||||
less: function(files, bundle) {
|
||||
for (var key in files) {
|
||||
(function (key) {
|
||||
var name = "less-" + key;
|
||||
tasks.less.push(name);
|
||||
sass(files, bundle) {
|
||||
Object.keys(files).forEach(key => {
|
||||
const name = `sass:${key}`;
|
||||
tasks.sass.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);
|
||||
}
|
||||
gulp.task(name, () =>
|
||||
gulp
|
||||
.src(bundles[bundle].sass[key])
|
||||
.pipe(sass())
|
||||
.on('error', gutil.log)
|
||||
.pipe(concat(key))
|
||||
.pipe(prefix(browsers, { cascade: false }))
|
||||
.pipe(cleancss())
|
||||
.pipe(size(sizeOptions))
|
||||
.pipe(gulp.dest(paths[bundle].output)),
|
||||
);
|
||||
});
|
||||
},
|
||||
sass: function(files, bundle) {
|
||||
for (var key in files) {
|
||||
(function (key) {
|
||||
var name = "sass-" + key;
|
||||
tasks.sass.push(name);
|
||||
sprite(bundle) {
|
||||
const name = `svg:sprite:${bundle}`;
|
||||
tasks.sprite.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
|
||||
}]
|
||||
}))
|
||||
gulp.task(name, () =>
|
||||
gulp
|
||||
.src(paths[bundle].src.sprite)
|
||||
.pipe(
|
||||
svgmin({
|
||||
plugins: [{
|
||||
removeDesc: true,
|
||||
}],
|
||||
}),
|
||||
)
|
||||
.pipe(svgstore())
|
||||
.pipe(gulp.dest(paths.plyr.output));
|
||||
});
|
||||
.pipe(rename({ basename: bundle }))
|
||||
.pipe(size(sizeOptions))
|
||||
.pipe(gulp.dest(paths[bundle].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();
|
||||
build.js(bundles.plyr.js, 'plyr', { name: 'Plyr', format: 'umd' });
|
||||
build.sass(bundles.plyr.sass, 'plyr');
|
||||
build.sprite('plyr');
|
||||
|
||||
// Docs files
|
||||
build.templates();
|
||||
build.less(bundles.docs.less, "docs");
|
||||
build.js(bundles.docs.js, "docs");
|
||||
// Demo files
|
||||
build.sass(bundles.demo.sass, 'demo');
|
||||
build.js(bundles.demo.js, 'demo', { format: 'iife' });
|
||||
|
||||
// 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);
|
||||
// Build all JS
|
||||
gulp.task('js', () => {
|
||||
run(tasks.js);
|
||||
});
|
||||
|
||||
// Watch for file changes
|
||||
gulp.task("watch", function () {
|
||||
gulp.task('watch', () => {
|
||||
// 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"]);
|
||||
gulp.watch(paths.plyr.src.sass, tasks.sass);
|
||||
gulp.watch(paths.plyr.src.sprite, tasks.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"]);
|
||||
// Demo
|
||||
gulp.watch(paths.demo.src.js, tasks.js);
|
||||
gulp.watch(paths.demo.src.sass, tasks.sass);
|
||||
});
|
||||
|
||||
// Default gulp task
|
||||
gulp.task("default", function(){
|
||||
run("templates", tasks.js, tasks.less, "sprite", "watch");
|
||||
gulp.task('default', () => {
|
||||
run(tasks.clean, tasks.js, tasks.sass, tasks.sprite, 'watch');
|
||||
});
|
||||
|
||||
// Publish a version to CDN and docs
|
||||
// Publish a version to CDN and demo
|
||||
// --------------------------------------------
|
||||
// If aws is setup
|
||||
if (Object.keys(aws).includes('cdn') && Object.keys(aws).includes('demo')) {
|
||||
const { version } = pkg;
|
||||
|
||||
// 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"
|
||||
// Get branch info
|
||||
const branch = {
|
||||
current: gitbranch.sync(),
|
||||
master: 'master',
|
||||
beta: 'beta',
|
||||
};
|
||||
const allowed = [
|
||||
branch.master,
|
||||
branch.beta,
|
||||
];
|
||||
|
||||
const maxAge = 31536000; // 1 year
|
||||
const options = {
|
||||
cdn: {
|
||||
headers: {
|
||||
'Cache-Control': `max-age=${maxAge}`,
|
||||
Vary: 'Accept-Encoding',
|
||||
},
|
||||
},
|
||||
gzippedOnly: true
|
||||
},
|
||||
docs: {
|
||||
headers: {
|
||||
"Cache-Control": "public, must-revalidate, proxy-revalidate, max-age=0",
|
||||
"Vary": "Accept-Encoding"
|
||||
demo: {
|
||||
uploadPath: branch.current === branch.beta ? 'beta/' : null,
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0',
|
||||
Vary: 'Accept-Encoding',
|
||||
},
|
||||
},
|
||||
gzippedOnly: true
|
||||
}
|
||||
},
|
||||
cdnpath = new RegExp(aws.cdn.bucket + "\/(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)","gi");
|
||||
symlinks(ver, filename) {
|
||||
return {
|
||||
headers: {
|
||||
// http://stackoverflow.com/questions/2272835/amazon-s3-object-redirect
|
||||
'x-amz-website-redirect-location': `/${ver}/${filename}`,
|
||||
'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0',
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
// Publish version to CDN bucket
|
||||
gulp.task("cdn", function () {
|
||||
console.log("Uploading " + version + " to " + aws.cdn.bucket);
|
||||
const regex = '(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*).(?:0|[1-9][0-9]*)(?:-[\\da-z\\-]+(?:.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:.[\\da-z\\-]+)*)?';
|
||||
const semver = new RegExp(`v${regex}`, 'gi');
|
||||
const localPath = new RegExp('(../)?dist', 'gi');
|
||||
const versionPath = `https://${aws.cdn.domain}/${version}`;
|
||||
const cdnpath = new RegExp(`${aws.cdn.domain}/${regex}/`, 'gi');
|
||||
|
||||
// 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));
|
||||
});
|
||||
gulp.task('version', () => {
|
||||
console.log(`Updating versions to '${version}'...`);
|
||||
|
||||
// Publish to Docs bucket
|
||||
gulp.task("docs", function () {
|
||||
console.log("Uploading " + version + " docs to " + aws.docs.bucket);
|
||||
// Replace versioned URLs in source
|
||||
const files = [
|
||||
'plyr.js',
|
||||
'plyr.polyfilled.js',
|
||||
'defaults.js',
|
||||
];
|
||||
gulp
|
||||
.src(files.map(file => path.join(root, `src/js/${file}`)))
|
||||
.pipe(replace(semver, `v${version}`))
|
||||
.pipe(replace(cdnpath, `${aws.cdn.domain}/${version}/`))
|
||||
.pipe(gulp.dest(path.join(root, 'src/js/')));
|
||||
});
|
||||
|
||||
// Replace versioned files in readme.md
|
||||
gulp.src([root + "/readme.md"])
|
||||
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
||||
.pipe(gulp.dest(root));
|
||||
// Publish version to CDN bucket
|
||||
gulp.task('cdn', () => {
|
||||
if (!allowed.includes(branch.current)) {
|
||||
console.error(`Must be on ${allowed.join(', ')} to publish! (current: ${branch.current})`);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 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));
|
||||
console.log(`Uploading '${version}' to ${aws.cdn.domain}...`);
|
||||
|
||||
// Upload error.html to cdn using docs options
|
||||
gulp.src([paths.docs.root + "error.html"])
|
||||
.pipe(gzip())
|
||||
.pipe(s3(aws.cdn, options.docs));
|
||||
});
|
||||
// Upload to CDN
|
||||
return (
|
||||
gulp
|
||||
.src(paths.upload)
|
||||
.pipe(
|
||||
rename(p => {
|
||||
p.basename = p.basename.replace(minSuffix, ''); // eslint-disable-line
|
||||
p.dirname = p.dirname.replace('.', version); // eslint-disable-line
|
||||
}),
|
||||
)
|
||||
// Remove min suffix from source map URL
|
||||
.pipe(replace(/sourceMappingURL=([\w-?.]+)/, (match, p1) => `sourceMappingURL=${p1.replace(minSuffix, '')}`))
|
||||
.pipe(
|
||||
size({
|
||||
showFiles: true,
|
||||
gzip: true,
|
||||
}),
|
||||
)
|
||||
.pipe(replace(localPath, versionPath))
|
||||
.pipe(s3(aws.cdn, options.cdn))
|
||||
);
|
||||
});
|
||||
|
||||
// Open the docs site to check it's sweet
|
||||
gulp.task("open", function () {
|
||||
console.log("Opening " + aws.docs.bucket + "...");
|
||||
// Publish to demo bucket
|
||||
gulp.task('demo', () => {
|
||||
if (!allowed.includes(branch.current)) {
|
||||
console.error(`Must be on ${allowed.join(', ')} to publish! (current: ${branch.current})`);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 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
|
||||
}));
|
||||
});
|
||||
console.log(`Uploading '${version}' demo to ${aws.demo.domain}...`);
|
||||
|
||||
// Do everything
|
||||
gulp.task("publish", function () {
|
||||
run("templates", tasks.js, tasks.less, "sprite", "cdn", "docs");
|
||||
});
|
||||
// Replace versioned files in readme.md
|
||||
gulp
|
||||
.src([`${root}/readme.md`])
|
||||
.pipe(replace(cdnpath, `${aws.cdn.domain}/${version}/`))
|
||||
.pipe(gulp.dest(root));
|
||||
|
||||
// Replace local file paths with remote paths in demo HTML
|
||||
// e.g. "../dist/plyr.js" to "https://cdn.plyr.io/x.x.x/plyr.js"
|
||||
const index = `${paths.demo.root}index.html`;
|
||||
const error = `${paths.demo.root}error.html`;
|
||||
const pages = [index];
|
||||
|
||||
if (branch.current === branch.master) {
|
||||
pages.push(error);
|
||||
}
|
||||
|
||||
gulp
|
||||
.src(pages)
|
||||
.pipe(replace(localPath, versionPath))
|
||||
.pipe(s3(aws.demo, options.demo));
|
||||
|
||||
// Only update CDN for master (prod)
|
||||
if (branch.current !== branch.master) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Upload error.html to cdn (as well as demo site)
|
||||
return gulp
|
||||
.src([error])
|
||||
.pipe(replace(localPath, versionPath))
|
||||
.pipe(s3(aws.cdn, options.demo));
|
||||
});
|
||||
|
||||
// Update symlinks for latest
|
||||
/* gulp.task("symlinks", function () {
|
||||
console.log("Updating symlinks...");
|
||||
|
||||
return gulp.src(paths.upload)
|
||||
.pipe(through.obj(function (chunk, enc, callback) {
|
||||
if (chunk.stat.isFile()) {
|
||||
// Get the filename
|
||||
var filename = chunk.path.split("/").reverse()[0];
|
||||
|
||||
// Create the 0 byte redirect files to upload
|
||||
createFile(filename, "")
|
||||
.pipe(rename(function (path) {
|
||||
path.dirname = path.dirname.replace(".", "latest");
|
||||
}))
|
||||
// Upload to S3 with correct headers
|
||||
.pipe(s3(aws.cdn, options.symlinks(version, filename)));
|
||||
}
|
||||
|
||||
callback(null, chunk);
|
||||
}));
|
||||
}); */
|
||||
|
||||
// Open the demo site to check it's sweet
|
||||
gulp.task('open', () => {
|
||||
console.log(`Opening ${aws.demo.domain}...`);
|
||||
|
||||
// A file must be specified or gulp will skip the task
|
||||
// Doesn't matter which file since we set the URL above
|
||||
// Weird, I know...
|
||||
return gulp.src([`${paths.demo.root}index.html`]).pipe(
|
||||
open('', {
|
||||
url: `http://${aws.demo.domain}`,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
// Do everything
|
||||
gulp.task('publish', () => {
|
||||
run('version', tasks.clean, tasks.js, tasks.sass, tasks.sprite, 'cdn', 'demo');
|
||||
});
|
||||
}
|
||||
|
@ -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
|
||||
|
114
package.json
114
package.json
@ -1,44 +1,74 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"version": "1.2.6",
|
||||
"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"
|
||||
},
|
||||
"keywords": [
|
||||
"HTML5 Video",
|
||||
"HTML5 Audio",
|
||||
"Media Player"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/selz/plyr.git"
|
||||
},
|
||||
"authors": [
|
||||
"Sam Potts <me@sampotts.me>"
|
||||
],
|
||||
"license": "MIT"
|
||||
"name": "plyr",
|
||||
"version": "3.0.5",
|
||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||
"homepage": "https://plyr.io",
|
||||
"main": "./dist/plyr.js",
|
||||
"browser": "./dist/plyr.min.js",
|
||||
"sass": "./src/sass/plyr.scss",
|
||||
"style": "./dist/plyr.css",
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-eslint": "^8.2.2",
|
||||
"babel-plugin-external-helpers": "^6.22.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"del": "^3.0.0",
|
||||
"eslint": "^4.19.0",
|
||||
"eslint-config-airbnb-base": "^12.1.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-import": "^2.9.0",
|
||||
"git-branch": "^2.0.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-autoprefixer": "^5.0.0",
|
||||
"gulp-better-rollup": "^3.0.0",
|
||||
"gulp-clean-css": "^3.9.3",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-filter": "^5.1.0",
|
||||
"gulp-open": "^3.0.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^0.6.1",
|
||||
"gulp-s3": "^0.11.0",
|
||||
"gulp-sass": "^3.1.0",
|
||||
"gulp-size": "^3.0.0",
|
||||
"gulp-sourcemaps": "^2.6.4",
|
||||
"gulp-svgmin": "^1.2.4",
|
||||
"gulp-svgstore": "^6.1.1",
|
||||
"gulp-uglify-es": "^1.0.1",
|
||||
"gulp-util": "^3.0.8",
|
||||
"prettier-eslint": "^8.8.1",
|
||||
"prettier-stylelint": "^0.4.2",
|
||||
"rollup-plugin-babel": "^3.0.3",
|
||||
"rollup-plugin-commonjs": "^8.4.1",
|
||||
"rollup-plugin-node-resolve": "^3.2.0",
|
||||
"run-sequence": "^2.2.1",
|
||||
"stylelint": "^9.1.3",
|
||||
"stylelint-config-prettier": "^3.0.4",
|
||||
"stylelint-config-recommended": "^2.1.0",
|
||||
"stylelint-config-sass-guidelines": "^5.0.0",
|
||||
"stylelint-order": "^0.8.1",
|
||||
"stylelint-scss": "^2.5.0",
|
||||
"stylelint-selector-bem-pattern": "^2.0.0"
|
||||
},
|
||||
"keywords": ["HTML5 Video", "HTML5 Audio", "Media Player", "DASH", "Shaka", "WordPress", "HLS"],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/sampotts/plyr.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/sampotts/plyr/issues"
|
||||
},
|
||||
"directories": {
|
||||
"doc": "readme.md"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Sam Potts <sam@potts.es>",
|
||||
"dependencies": {
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"custom-event-polyfill": "^0.3.0",
|
||||
"loadjs": "^3.5.2",
|
||||
"raven-js": "^3.23.3"
|
||||
}
|
||||
}
|
||||
|
31
plyr.code-workspace
Normal file
31
plyr.code-workspace
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
// Exclude from the editor
|
||||
"files.exclude": {
|
||||
"**/node_modules": true
|
||||
},
|
||||
// Exclude from search
|
||||
"search.exclude": {
|
||||
"dist/": true
|
||||
},
|
||||
// Linting
|
||||
"stylelint.enable": true,
|
||||
"css.validate": false,
|
||||
"scss.validate": false,
|
||||
"javascript.validate.enable": false,
|
||||
// Prettier
|
||||
"prettier.eslintIntegration": true,
|
||||
"prettier.stylelintIntegration": true,
|
||||
// Formatting
|
||||
"editor.tabSize": 4,
|
||||
"editor.insertSpaces": true,
|
||||
"editor.formatOnSave": true,
|
||||
// Trim on save
|
||||
"files.trimTrailingWhitespace": true
|
||||
}
|
||||
}
|
231
src/js/captions.js
Normal file
231
src/js/captions.js
Normal file
@ -0,0 +1,231 @@
|
||||
// ==========================================================================
|
||||
// Plyr Captions
|
||||
// TODO: Create as class
|
||||
// ==========================================================================
|
||||
|
||||
import support from './support';
|
||||
import utils from './utils';
|
||||
import controls from './controls';
|
||||
|
||||
const captions = {
|
||||
// Setup captions
|
||||
setup() {
|
||||
// Requires UI support
|
||||
if (!this.supported.ui) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set default language if not set
|
||||
const stored = this.storage.get('language');
|
||||
|
||||
if (!utils.is.empty(stored)) {
|
||||
this.captions.language = stored;
|
||||
}
|
||||
|
||||
if (utils.is.empty(this.captions.language)) {
|
||||
this.captions.language = this.config.captions.language.toLowerCase();
|
||||
}
|
||||
|
||||
// Set captions enabled state if not set
|
||||
if (!utils.is.boolean(this.captions.active)) {
|
||||
const active = this.storage.get('captions');
|
||||
|
||||
if (utils.is.boolean(active)) {
|
||||
this.captions.active = active;
|
||||
} else {
|
||||
this.captions.active = this.config.captions.active;
|
||||
}
|
||||
}
|
||||
|
||||
// Only Vimeo and HTML5 video supported at this point
|
||||
if (!this.isVideo || this.isYouTube || (this.isHTML5 && !support.textTracks)) {
|
||||
// Clear menu and hide
|
||||
if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) {
|
||||
controls.setCaptionsMenu.call(this);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// Inject the container
|
||||
if (!utils.is.element(this.elements.captions)) {
|
||||
this.elements.captions = utils.createElement('div', utils.getAttributesFromSelector(this.config.selectors.captions));
|
||||
|
||||
utils.insertAfter(this.elements.captions, this.elements.wrapper);
|
||||
}
|
||||
|
||||
// Set the class hook
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.captions.enabled, !utils.is.empty(captions.getTracks.call(this)));
|
||||
|
||||
// Get tracks
|
||||
const tracks = captions.getTracks.call(this);
|
||||
|
||||
// If no caption file exists, hide container for caption text
|
||||
if (utils.is.empty(tracks)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get browser info
|
||||
const browser = utils.getBrowser();
|
||||
|
||||
// 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 href = utils.parseUrl(src);
|
||||
|
||||
if (href.hostname !== window.location.href.hostname && [
|
||||
'http:',
|
||||
'https:',
|
||||
].includes(href.protocol)) {
|
||||
utils
|
||||
.fetch(src, 'blob')
|
||||
.then(blob => {
|
||||
track.setAttribute('src', window.URL.createObjectURL(blob));
|
||||
})
|
||||
.catch(() => {
|
||||
utils.removeElement(track);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Set language
|
||||
captions.setLanguage.call(this);
|
||||
|
||||
// Enable UI
|
||||
captions.show.call(this);
|
||||
|
||||
// Set available languages in list
|
||||
if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) {
|
||||
controls.setCaptionsMenu.call(this);
|
||||
}
|
||||
},
|
||||
|
||||
// Set the captions language
|
||||
setLanguage() {
|
||||
// Setup HTML5 track rendering
|
||||
if (this.isHTML5 && this.isVideo) {
|
||||
captions.getTracks.call(this).forEach(track => {
|
||||
// Show track
|
||||
utils.on(track, 'cuechange', event => captions.setCue.call(this, event));
|
||||
|
||||
// Turn off native caption rendering to avoid double captions
|
||||
// eslint-disable-next-line
|
||||
track.mode = 'hidden';
|
||||
});
|
||||
|
||||
// Get current track
|
||||
const currentTrack = captions.getCurrentTrack.call(this);
|
||||
|
||||
// Check if suported kind
|
||||
if (utils.is.track(currentTrack)) {
|
||||
// If we change the active track while a cue is already displayed we need to update it
|
||||
if (Array.from(currentTrack.activeCues || []).length) {
|
||||
captions.setCue.call(this, currentTrack);
|
||||
}
|
||||
}
|
||||
} else if (this.isVimeo && this.captions.active) {
|
||||
this.embed.enableTextTrack(this.language);
|
||||
}
|
||||
},
|
||||
|
||||
// Get the tracks
|
||||
getTracks() {
|
||||
// Return empty array at least
|
||||
if (utils.is.nullOrUndefined(this.media)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Only get accepted kinds
|
||||
return Array.from(this.media.textTracks || []).filter(track => [
|
||||
'captions',
|
||||
'subtitles',
|
||||
].includes(track.kind));
|
||||
},
|
||||
|
||||
// Get the current track for the current language
|
||||
getCurrentTrack() {
|
||||
return captions.getTracks.call(this).find(track => track.language.toLowerCase() === this.language);
|
||||
},
|
||||
|
||||
// Display active caption if it contains text
|
||||
setCue(input) {
|
||||
// Get the track from the event if needed
|
||||
const track = utils.is.event(input) ? input.target : input;
|
||||
const { activeCues } = track;
|
||||
const active = activeCues.length && activeCues[0];
|
||||
const currentTrack = captions.getCurrentTrack.call(this);
|
||||
|
||||
// Only display current track
|
||||
if (track !== currentTrack) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Display a cue, if there is one
|
||||
if (utils.is.cue(active)) {
|
||||
captions.setText.call(this, active.getCueAsHTML());
|
||||
} else {
|
||||
captions.setText.call(this, null);
|
||||
}
|
||||
|
||||
utils.dispatchEvent.call(this, this.media, 'cuechange');
|
||||
},
|
||||
|
||||
// Set the current caption
|
||||
setText(input) {
|
||||
// Requires UI
|
||||
if (!this.supported.ui) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (utils.is.element(this.elements.captions)) {
|
||||
const content = utils.createElement('span');
|
||||
|
||||
// Empty the container
|
||||
utils.emptyElement(this.elements.captions);
|
||||
|
||||
// Default to empty
|
||||
const caption = !utils.is.nullOrUndefined(input) ? input : '';
|
||||
|
||||
// Set the span content
|
||||
if (utils.is.string(caption)) {
|
||||
content.textContent = caption.trim();
|
||||
} else {
|
||||
content.appendChild(caption);
|
||||
}
|
||||
|
||||
// Set new caption text
|
||||
this.elements.captions.appendChild(content);
|
||||
} else {
|
||||
this.debug.warn('No captions element to render to');
|
||||
}
|
||||
},
|
||||
|
||||
// Display captions container and button (for initialization)
|
||||
show() {
|
||||
// If there's no caption toggle, bail
|
||||
if (!utils.is.element(this.elements.buttons.captions)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to load the value from storage
|
||||
let active = this.storage.get('captions');
|
||||
|
||||
// Otherwise fall back to the default config
|
||||
if (!utils.is.boolean(active)) {
|
||||
({ active } = this.config.captions);
|
||||
} else {
|
||||
this.captions.active = active;
|
||||
}
|
||||
|
||||
if (active) {
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.captions.active, true);
|
||||
utils.toggleState(this.elements.buttons.captions, true);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default captions;
|
28
src/js/console.js
Normal file
28
src/js/console.js
Normal file
@ -0,0 +1,28 @@
|
||||
// ==========================================================================
|
||||
// Console wrapper
|
||||
// ==========================================================================
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
export default class Console {
|
||||
constructor(enabled = false) {
|
||||
this.enabled = window.console && enabled;
|
||||
|
||||
if (this.enabled) {
|
||||
this.log('Debugging enabled');
|
||||
}
|
||||
}
|
||||
|
||||
get log() {
|
||||
// eslint-disable-next-line no-console
|
||||
return this.enabled ? Function.prototype.bind.call(console.log, console) : noop;
|
||||
}
|
||||
get warn() {
|
||||
// eslint-disable-next-line no-console
|
||||
return this.enabled ? Function.prototype.bind.call(console.warn, console) : noop;
|
||||
}
|
||||
get error() {
|
||||
// eslint-disable-next-line no-console
|
||||
return this.enabled ? Function.prototype.bind.call(console.error, console) : noop;
|
||||
}
|
||||
}
|
1264
src/js/controls.js
vendored
Normal file
1264
src/js/controls.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
385
src/js/defaults.js
Normal file
385
src/js/defaults.js
Normal file
@ -0,0 +1,385 @@
|
||||
// ==========================================================================
|
||||
// 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,
|
||||
|
||||
// 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,
|
||||
|
||||
// Aspect ratio (for embeds)
|
||||
ratio: '16:9',
|
||||
|
||||
// Click video container to play/pause
|
||||
clickToPlay: true,
|
||||
|
||||
// Auto hide the controls
|
||||
hideControls: true,
|
||||
|
||||
// Revert to poster on finish (HTML5 - will cause reload)
|
||||
showPosterOnEnd: false,
|
||||
|
||||
// Disable the standard context menu
|
||||
disableContextMenu: true,
|
||||
|
||||
// Sprite (for icons)
|
||||
loadSprite: true,
|
||||
iconPrefix: 'plyr',
|
||||
iconUrl: 'https://cdn.plyr.io/3.0.5/plyr.svg',
|
||||
|
||||
// Blank video (used to prevent errors on source change)
|
||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||
|
||||
// Quality default
|
||||
quality: {
|
||||
default: 'default',
|
||||
options: [
|
||||
'hd2160',
|
||||
'hd1440',
|
||||
'hd1080',
|
||||
'hd720',
|
||||
'large',
|
||||
'medium',
|
||||
'small',
|
||||
'tiny',
|
||||
'default',
|
||||
],
|
||||
},
|
||||
|
||||
// Set loops
|
||||
loop: {
|
||||
active: false,
|
||||
// start: null,
|
||||
// end: null,
|
||||
},
|
||||
|
||||
// Speed default and options to display
|
||||
speed: {
|
||||
selected: 1,
|
||||
options: [
|
||||
0.5,
|
||||
0.75,
|
||||
1,
|
||||
1.25,
|
||||
1.5,
|
||||
1.75,
|
||||
2,
|
||||
],
|
||||
},
|
||||
|
||||
// Keyboard shortcut settings
|
||||
keyboard: {
|
||||
focused: true,
|
||||
global: false,
|
||||
},
|
||||
|
||||
// Display tooltips
|
||||
tooltips: {
|
||||
controls: false,
|
||||
seek: true,
|
||||
},
|
||||
|
||||
// Captions settings
|
||||
captions: {
|
||||
active: false,
|
||||
language: window.navigator.language.split('-')[0],
|
||||
},
|
||||
|
||||
// Fullscreen settings
|
||||
fullscreen: {
|
||||
enabled: true, // Allow fullscreen?
|
||||
fallback: true, // Fallback for vintage browsers
|
||||
iosNative: false, // Use the native fullscreen in iOS (disables custom controls)
|
||||
},
|
||||
|
||||
// Local storage
|
||||
storage: {
|
||||
enabled: true,
|
||||
key: 'plyr',
|
||||
},
|
||||
|
||||
// Default controls
|
||||
controls: [
|
||||
'play-large',
|
||||
// 'restart',
|
||||
// 'rewind',
|
||||
'play',
|
||||
// 'fast-forward',
|
||||
'progress',
|
||||
'current-time',
|
||||
'mute',
|
||||
'volume',
|
||||
'captions',
|
||||
'settings',
|
||||
'pip',
|
||||
'airplay',
|
||||
'fullscreen',
|
||||
],
|
||||
settings: [
|
||||
'captions',
|
||||
'quality',
|
||||
'speed',
|
||||
],
|
||||
|
||||
// Localisation
|
||||
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',
|
||||
quality: 'Quality',
|
||||
loop: 'Loop',
|
||||
start: 'Start',
|
||||
end: 'End',
|
||||
all: 'All',
|
||||
reset: 'Reset',
|
||||
disabled: 'Disabled',
|
||||
advertisement: 'Ad',
|
||||
},
|
||||
|
||||
// URLs
|
||||
urls: {
|
||||
vimeo: {
|
||||
api: 'https://player.vimeo.com/api/player.js',
|
||||
},
|
||||
youtube: {
|
||||
api: 'https://www.youtube.com/iframe_api',
|
||||
},
|
||||
googleIMA: {
|
||||
api: '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,
|
||||
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
|
||||
'enterfullscreen',
|
||||
'exitfullscreen',
|
||||
'captionsenabled',
|
||||
'captionsdisabled',
|
||||
'languagechange',
|
||||
'controlshidden',
|
||||
'controlsshown',
|
||||
'ready',
|
||||
|
||||
// YouTube
|
||||
'statechange',
|
||||
'qualitychange',
|
||||
'qualityrequested',
|
||||
|
||||
// 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"]',
|
||||
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',
|
||||
played: '.plyr__progress--played',
|
||||
loop: '.plyr__progress--loop',
|
||||
volume: '.plyr__volume--display',
|
||||
},
|
||||
progress: '.plyr__progress',
|
||||
captions: '.plyr__captions',
|
||||
menu: {
|
||||
quality: '.js-plyr__menu__list--quality',
|
||||
},
|
||||
},
|
||||
|
||||
// Class hooks added to the player in different states
|
||||
classNames: {
|
||||
video: 'plyr__video-wrapper',
|
||||
embed: 'plyr__video-embed',
|
||||
ads: 'plyr__ads',
|
||||
control: 'plyr__control',
|
||||
type: 'plyr--{0}',
|
||||
provider: 'plyr--{0}',
|
||||
stopped: 'plyr--stopped',
|
||||
playing: 'plyr--playing',
|
||||
loading: 'plyr--loading',
|
||||
error: 'plyr--has-error',
|
||||
hover: 'plyr--hover',
|
||||
tooltip: 'plyr__tooltip',
|
||||
cues: 'plyr__cues',
|
||||
hidden: 'plyr__sr-only',
|
||||
hideControls: 'plyr--hide-controls',
|
||||
isIos: 'plyr--is-ios',
|
||||
isTouch: 'plyr--is-touch',
|
||||
uiSupported: 'plyr--full-ui',
|
||||
noTransition: 'plyr--no-transition',
|
||||
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',
|
||||
},
|
||||
tabFocus: 'plyr__tab-focus',
|
||||
},
|
||||
|
||||
// Embed attributes
|
||||
attributes: {
|
||||
embed: {
|
||||
provider: 'data-plyr-provider',
|
||||
id: 'data-plyr-embed-id',
|
||||
},
|
||||
},
|
||||
|
||||
// API keys
|
||||
keys: {
|
||||
google: null,
|
||||
},
|
||||
|
||||
// Advertisements plugin
|
||||
// Register for an account here: http://vi.ai/publisher-video-monetization/?aid=plyrio
|
||||
ads: {
|
||||
enabled: false,
|
||||
publisherId: '',
|
||||
},
|
||||
};
|
||||
|
||||
export default defaults;
|
211
src/js/fullscreen.js
Normal file
211
src/js/fullscreen.js
Normal file
@ -0,0 +1,211 @@
|
||||
// ==========================================================================
|
||||
// Fullscreen wrapper
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API#prefixing
|
||||
// ==========================================================================
|
||||
|
||||
import utils from './utils';
|
||||
|
||||
const browser = utils.getBrowser();
|
||||
|
||||
function onChange() {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update toggle button
|
||||
const button = this.player.elements.buttons.fullscreen;
|
||||
if (utils.is.element(button)) {
|
||||
utils.toggleState(button, this.active);
|
||||
}
|
||||
|
||||
// Trigger an event
|
||||
utils.dispatchEvent(this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
|
||||
// Trap focus in container
|
||||
if (!browser.isIos) {
|
||||
utils.trapFocus.call(this.player, this.target, this.active);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleFallback(toggle = false) {
|
||||
// Store or restore scroll position
|
||||
if (toggle) {
|
||||
this.scrollPosition = {
|
||||
x: window.scrollX || 0,
|
||||
y: window.scrollY || 0,
|
||||
};
|
||||
} else {
|
||||
window.scrollTo(this.scrollPosition.x, this.scrollPosition.y);
|
||||
}
|
||||
|
||||
// Toggle scroll
|
||||
document.body.style.overflow = toggle ? 'hidden' : '';
|
||||
|
||||
// Toggle class hook
|
||||
utils.toggleClass(this.target, this.player.config.classNames.fullscreen.fallback, toggle);
|
||||
|
||||
// Toggle button and fire events
|
||||
onChange.call(this);
|
||||
}
|
||||
|
||||
class Fullscreen {
|
||||
constructor(player) {
|
||||
// Keep reference to parent
|
||||
this.player = player;
|
||||
|
||||
// Get prefix
|
||||
this.prefix = Fullscreen.prefix;
|
||||
this.name = Fullscreen.name;
|
||||
|
||||
// Scroll position
|
||||
this.scrollPosition = { x: 0, y: 0 };
|
||||
|
||||
// Register event listeners
|
||||
// Handle event (incase user presses escape etc)
|
||||
utils.on(document, this.prefix === 'ms' ? 'MSFullscreenChange' : `${this.prefix}fullscreenchange`, () => {
|
||||
// TODO: Filter for target??
|
||||
onChange.call(this);
|
||||
});
|
||||
|
||||
// Fullscreen toggle on double click
|
||||
utils.on(this.player.elements.container, 'dblclick', () => {
|
||||
this.toggle();
|
||||
});
|
||||
|
||||
// Prevent double click on controls bubbling up
|
||||
utils.on(this.player.elements.controls, 'dblclick', event => event.stopPropagation());
|
||||
|
||||
// Update the UI
|
||||
this.update();
|
||||
}
|
||||
|
||||
// Determine if native supported
|
||||
static get native() {
|
||||
return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
|
||||
}
|
||||
|
||||
// Get the prefix for handlers
|
||||
static get prefix() {
|
||||
// No prefix
|
||||
if (utils.is.function(document.exitFullscreen)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check for fullscreen support by vendor prefix
|
||||
let value = '';
|
||||
const prefixes = [
|
||||
'webkit',
|
||||
'moz',
|
||||
'ms',
|
||||
];
|
||||
|
||||
prefixes.some(pre => {
|
||||
if (utils.is.function(document[`${pre}ExitFullscreen`]) || utils.is.function(document[`${pre}CancelFullScreen`])) {
|
||||
value = pre;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static get name() {
|
||||
return this.prefix === 'moz' ? 'FullScreen' : 'Fullscreen';
|
||||
}
|
||||
|
||||
// Determine if fullscreen is enabled
|
||||
get enabled() {
|
||||
return (
|
||||
(Fullscreen.native || this.player.config.fullscreen.fallback) &&
|
||||
this.player.config.fullscreen.enabled &&
|
||||
this.player.supported.ui &&
|
||||
this.player.isVideo
|
||||
);
|
||||
}
|
||||
|
||||
// Get active state
|
||||
get active() {
|
||||
if (!this.enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Fallback using classname
|
||||
if (!Fullscreen.native) {
|
||||
return utils.hasClass(this.target, this.player.config.classNames.fullscreen.fallback);
|
||||
}
|
||||
|
||||
const element = !this.prefix ? document.fullscreenElement : document[`${this.prefix}${this.name}Element`];
|
||||
|
||||
return element === this.target;
|
||||
}
|
||||
|
||||
// Get target element
|
||||
get target() {
|
||||
return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.container;
|
||||
}
|
||||
|
||||
// Update UI
|
||||
update() {
|
||||
if (this.enabled) {
|
||||
this.player.debug.log(`${Fullscreen.native ? 'Native' : 'Fallback'} fullscreen enabled`);
|
||||
} else {
|
||||
this.player.debug.log('Fullscreen not supported and fallback disabled');
|
||||
}
|
||||
|
||||
// Add styling hook to show button
|
||||
utils.toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);
|
||||
}
|
||||
|
||||
// Make an element fullscreen
|
||||
enter() {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// iOS native fullscreen doesn't need the request step
|
||||
if (browser.isIos && this.player.config.fullscreen.iosNative) {
|
||||
if (this.player.playing) {
|
||||
this.target.webkitEnterFullscreen();
|
||||
}
|
||||
} else if (!Fullscreen.native) {
|
||||
toggleFallback.call(this, true);
|
||||
} else if (!this.prefix) {
|
||||
this.target.requestFullscreen();
|
||||
} else if (!utils.is.empty(this.prefix)) {
|
||||
this.target[`${this.prefix}Request${this.name}`]();
|
||||
}
|
||||
}
|
||||
|
||||
// Bail from fullscreen
|
||||
exit() {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// iOS native fullscreen
|
||||
if (browser.isIos && this.player.config.fullscreen.iosNative) {
|
||||
this.target.webkitExitFullscreen();
|
||||
this.player.play();
|
||||
} else if (!Fullscreen.native) {
|
||||
toggleFallback.call(this, false);
|
||||
} else if (!this.prefix) {
|
||||
document.cancelFullScreen();
|
||||
} else if (!utils.is.empty(this.prefix)) {
|
||||
const action = this.prefix === 'moz' ? 'Cancel' : 'Exit';
|
||||
document[`${this.prefix}${action}${this.name}`]();
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle state
|
||||
toggle() {
|
||||
if (!this.active) {
|
||||
this.enter();
|
||||
} else {
|
||||
this.exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Fullscreen;
|
31
src/js/i18n.js
Normal file
31
src/js/i18n.js
Normal file
@ -0,0 +1,31 @@
|
||||
// ==========================================================================
|
||||
// Plyr internationalization
|
||||
// ==========================================================================
|
||||
|
||||
import utils from './utils';
|
||||
|
||||
const i18n = {
|
||||
get(key = '', config = {}) {
|
||||
if (utils.is.empty(key) || utils.is.empty(config) || !Object.keys(config.i18n).includes(key)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
let string = config.i18n[key];
|
||||
|
||||
const replace = {
|
||||
'{seektime}': config.seekTime,
|
||||
'{title}': config.title,
|
||||
};
|
||||
|
||||
Object.entries(replace).forEach(([
|
||||
key,
|
||||
value,
|
||||
]) => {
|
||||
string = utils.replaceAll(string, key, value);
|
||||
});
|
||||
|
||||
return string;
|
||||
},
|
||||
};
|
||||
|
||||
export default i18n;
|
622
src/js/listeners.js
Normal file
622
src/js/listeners.js
Normal file
@ -0,0 +1,622 @@
|
||||
// ==========================================================================
|
||||
// Plyr Event Listeners
|
||||
// ==========================================================================
|
||||
|
||||
import support from './support';
|
||||
import utils from './utils';
|
||||
import controls from './controls';
|
||||
import ui from './ui';
|
||||
|
||||
// Sniff out the browser
|
||||
const browser = utils.getBrowser();
|
||||
|
||||
class Listeners {
|
||||
constructor(player) {
|
||||
this.player = player;
|
||||
this.lastKey = null;
|
||||
|
||||
this.handleKey = this.handleKey.bind(this);
|
||||
this.toggleMenu = this.toggleMenu.bind(this);
|
||||
this.firstTouch = this.firstTouch.bind(this);
|
||||
}
|
||||
|
||||
// Handle key presses
|
||||
handleKey(event) {
|
||||
const code = event.keyCode ? event.keyCode : event.which;
|
||||
const pressed = event.type === 'keydown';
|
||||
const repeat = pressed && code === this.lastKey;
|
||||
|
||||
// Bail if a modifier key is set
|
||||
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the event is bubbled from the media element
|
||||
// Firefox doesn't get the keycode for whatever reason
|
||||
if (!utils.is.number(code)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Seek by the number keys
|
||||
const seekByKey = () => {
|
||||
// Divide the max duration into 10th's and times by the number value
|
||||
this.player.currentTime = this.player.duration / 10 * (code - 48);
|
||||
};
|
||||
|
||||
// Handle the key on keydown
|
||||
// Reset on keyup
|
||||
if (pressed) {
|
||||
// Which keycodes should we prevent default
|
||||
const preventDefault = [
|
||||
48,
|
||||
49,
|
||||
50,
|
||||
51,
|
||||
52,
|
||||
53,
|
||||
54,
|
||||
56,
|
||||
57,
|
||||
32,
|
||||
75,
|
||||
38,
|
||||
40,
|
||||
77,
|
||||
39,
|
||||
37,
|
||||
70,
|
||||
67,
|
||||
73,
|
||||
76,
|
||||
79,
|
||||
];
|
||||
|
||||
// Check focused element
|
||||
// and if the focused element is not editable (e.g. text input)
|
||||
// and any that accept key input http://webaim.org/techniques/keyboard/
|
||||
const focused = utils.getFocusElement();
|
||||
if (utils.is.element(focused) && utils.matches(focused, this.player.config.selectors.editable)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the code is found prevent default (e.g. prevent scrolling for arrows)
|
||||
if (preventDefault.includes(code)) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
switch (code) {
|
||||
case 48:
|
||||
case 49:
|
||||
case 50:
|
||||
case 51:
|
||||
case 52:
|
||||
case 53:
|
||||
case 54:
|
||||
case 55:
|
||||
case 56:
|
||||
case 57:
|
||||
// 0-9
|
||||
if (!repeat) {
|
||||
seekByKey();
|
||||
}
|
||||
break;
|
||||
|
||||
case 32:
|
||||
case 75:
|
||||
// Space and K key
|
||||
if (!repeat) {
|
||||
this.player.togglePlay();
|
||||
}
|
||||
break;
|
||||
|
||||
case 38:
|
||||
// Arrow up
|
||||
this.player.increaseVolume(0.1);
|
||||
break;
|
||||
|
||||
case 40:
|
||||
// Arrow down
|
||||
this.player.decreaseVolume(0.1);
|
||||
break;
|
||||
|
||||
case 77:
|
||||
// M key
|
||||
if (!repeat) {
|
||||
this.player.muted = !this.player.muted;
|
||||
}
|
||||
break;
|
||||
|
||||
case 39:
|
||||
// Arrow forward
|
||||
this.player.fastForward();
|
||||
break;
|
||||
|
||||
case 37:
|
||||
// Arrow back
|
||||
this.player.rewind();
|
||||
break;
|
||||
|
||||
case 70:
|
||||
// F key
|
||||
this.player.fullscreen.toggle();
|
||||
break;
|
||||
|
||||
case 67:
|
||||
// C key
|
||||
if (!repeat) {
|
||||
this.player.toggleCaptions();
|
||||
}
|
||||
break;
|
||||
|
||||
case 76:
|
||||
// L key
|
||||
this.player.loop = !this.player.loop;
|
||||
break;
|
||||
|
||||
/* case 73:
|
||||
this.setLoop('start');
|
||||
break;
|
||||
|
||||
case 76:
|
||||
this.setLoop();
|
||||
break;
|
||||
|
||||
case 79:
|
||||
this.setLoop('end');
|
||||
break; */
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Escape is handle natively when in full screen
|
||||
// So we only need to worry about non native
|
||||
if (!this.player.fullscreen.enabled && this.player.fullscreen.active && code === 27) {
|
||||
this.player.fullscreen.toggle();
|
||||
}
|
||||
|
||||
// Store last code for next cycle
|
||||
this.lastKey = code;
|
||||
} else {
|
||||
this.lastKey = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle menu
|
||||
toggleMenu(event) {
|
||||
controls.toggleMenu.call(this.player, event);
|
||||
}
|
||||
|
||||
// Device is touch enabled
|
||||
firstTouch() {
|
||||
this.player.touch = true;
|
||||
|
||||
// Add touch class
|
||||
utils.toggleClass(this.player.elements.container, this.player.config.classNames.isTouch, true);
|
||||
|
||||
// Clean up
|
||||
utils.off(document.body, 'touchstart', this.firstTouch);
|
||||
}
|
||||
|
||||
// Global window & document listeners
|
||||
global(toggle = true) {
|
||||
// Keyboard shortcuts
|
||||
if (this.player.config.keyboard.global) {
|
||||
utils.toggleListener(window, 'keydown keyup', this.handleKey, toggle, false);
|
||||
}
|
||||
|
||||
// Click anywhere closes menu
|
||||
utils.toggleListener(document.body, 'click', this.toggleMenu, toggle);
|
||||
|
||||
// Detect touch by events
|
||||
utils.on(document.body, 'touchstart', this.firstTouch);
|
||||
}
|
||||
|
||||
// Container listeners
|
||||
container() {
|
||||
// Keyboard shortcuts
|
||||
if (!this.player.config.keyboard.global && this.player.config.keyboard.focused) {
|
||||
utils.on(this.player.elements.container, 'keydown keyup', this.handleKey, false);
|
||||
}
|
||||
|
||||
// Detect tab focus
|
||||
// Remove class on blur/focusout
|
||||
utils.on(this.player.elements.container, 'focusout', event => {
|
||||
utils.toggleClass(event.target, this.player.config.classNames.tabFocus, false);
|
||||
});
|
||||
|
||||
// Add classname to tabbed elements
|
||||
utils.on(this.player.elements.container, 'keydown', event => {
|
||||
if (event.keyCode !== 9) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delay the adding of classname until the focus has changed
|
||||
// This event fires before the focusin event
|
||||
setTimeout(() => {
|
||||
utils.toggleClass(utils.getFocusElement(), this.player.config.classNames.tabFocus, true);
|
||||
}, 0);
|
||||
});
|
||||
|
||||
// Toggle controls visibility based on mouse movement
|
||||
if (this.player.config.hideControls) {
|
||||
// Toggle controls on mouse events and entering fullscreen
|
||||
utils.on(this.player.elements.container, 'mouseenter mouseleave mousemove touchstart touchend touchmove enterfullscreen exitfullscreen', event => {
|
||||
this.player.toggleControls(event);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Listen for media events
|
||||
media() {
|
||||
// Time change on media
|
||||
utils.on(this.player.media, 'timeupdate seeking', event => ui.timeUpdate.call(this.player, event));
|
||||
|
||||
// Display duration
|
||||
utils.on(this.player.media, 'durationchange loadedmetadata', event => ui.durationUpdate.call(this.player, event));
|
||||
|
||||
// Check for audio tracks on load
|
||||
// We can't use `loadedmetadata` as it doesn't seem to have audio tracks at that point
|
||||
utils.on(this.player.media, 'loadeddata', () => {
|
||||
utils.toggleHidden(this.player.elements.volume, !this.player.hasAudio);
|
||||
utils.toggleHidden(this.player.elements.buttons.mute, !this.player.hasAudio);
|
||||
});
|
||||
|
||||
// Handle the media finishing
|
||||
utils.on(this.player.media, 'ended', () => {
|
||||
// Show poster on end
|
||||
if (this.player.isHTML5 && this.player.isVideo && this.player.config.showPosterOnEnd) {
|
||||
// Restart
|
||||
this.player.restart();
|
||||
|
||||
// Re-load media
|
||||
this.player.media.load();
|
||||
}
|
||||
});
|
||||
|
||||
// Check for buffer progress
|
||||
utils.on(this.player.media, 'progress playing', event => ui.updateProgress.call(this.player, event));
|
||||
|
||||
// Handle native mute
|
||||
utils.on(this.player.media, 'volumechange', event => ui.updateVolume.call(this.player, event));
|
||||
|
||||
// Handle native play/pause
|
||||
utils.on(this.player.media, 'playing play pause ended emptied', event => ui.checkPlaying.call(this.player, event));
|
||||
|
||||
// Loading
|
||||
utils.on(this.player.media, 'waiting canplay seeked playing', event => ui.checkLoading.call(this.player, event));
|
||||
|
||||
// Check if media failed to load
|
||||
// utils.on(this.player.media, 'play', event => ui.checkFailed.call(this.player, event));
|
||||
|
||||
// Click video
|
||||
if (this.player.supported.ui && this.player.config.clickToPlay && !this.player.isAudio) {
|
||||
// Re-fetch the wrapper
|
||||
const wrapper = utils.getElement.call(this.player, `.${this.player.config.classNames.video}`);
|
||||
|
||||
// Bail if there's no wrapper (this should never happen)
|
||||
if (!utils.is.element(wrapper)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// On click play, pause ore restart
|
||||
utils.on(wrapper, 'click', () => {
|
||||
// Touch devices will just show controls (if we're hiding controls)
|
||||
if (this.player.config.hideControls && this.player.touch && !this.player.paused) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.player.paused) {
|
||||
this.player.play();
|
||||
} else if (this.player.ended) {
|
||||
this.player.restart();
|
||||
this.player.play();
|
||||
} else {
|
||||
this.player.pause();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Disable right click
|
||||
if (this.player.supported.ui && this.player.config.disableContextMenu) {
|
||||
utils.on(
|
||||
this.player.media,
|
||||
'contextmenu',
|
||||
event => {
|
||||
event.preventDefault();
|
||||
},
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
// Volume change
|
||||
utils.on(this.player.media, 'volumechange', () => {
|
||||
// Save to storage
|
||||
this.player.storage.set({ volume: this.player.volume, muted: this.player.muted });
|
||||
});
|
||||
|
||||
// Speed change
|
||||
utils.on(this.player.media, 'ratechange', () => {
|
||||
// Update UI
|
||||
controls.updateSetting.call(this.player, 'speed');
|
||||
|
||||
// Save to storage
|
||||
this.player.storage.set({ speed: this.player.speed });
|
||||
});
|
||||
|
||||
// Quality change
|
||||
utils.on(this.player.media, 'qualitychange', () => {
|
||||
// Update UI
|
||||
controls.updateSetting.call(this.player, 'quality');
|
||||
|
||||
// Save to storage
|
||||
this.player.storage.set({ quality: this.player.quality });
|
||||
});
|
||||
|
||||
// Caption language change
|
||||
utils.on(this.player.media, 'languagechange', () => {
|
||||
// Update UI
|
||||
controls.updateSetting.call(this.player, 'captions');
|
||||
|
||||
// Save to storage
|
||||
this.player.storage.set({ language: this.player.language });
|
||||
});
|
||||
|
||||
// Captions toggle
|
||||
utils.on(this.player.media, 'captionsenabled captionsdisabled', () => {
|
||||
// Update UI
|
||||
controls.updateSetting.call(this.player, 'captions');
|
||||
|
||||
// Save to storage
|
||||
this.player.storage.set({ captions: this.player.captions.active });
|
||||
});
|
||||
|
||||
// Proxy events to container
|
||||
// Bubble up key events for Edge
|
||||
utils.on(this.player.media, this.player.config.events.concat([
|
||||
'keyup',
|
||||
'keydown',
|
||||
]).join(' '), event => {
|
||||
let detail = {};
|
||||
|
||||
// Get error details from media
|
||||
if (event.type === 'error') {
|
||||
detail = this.player.media.error;
|
||||
}
|
||||
|
||||
utils.dispatchEvent.call(this.player, this.player.elements.container, event.type, true, detail);
|
||||
});
|
||||
}
|
||||
|
||||
// Listen for control events
|
||||
controls() {
|
||||
// IE doesn't support input event, so we fallback to change
|
||||
const inputEvent = browser.isIE ? 'change' : 'input';
|
||||
|
||||
// Run default and custom handlers
|
||||
const proxy = (event, defaultHandler, customHandlerKey) => {
|
||||
const customHandler = this.player.config.listeners[customHandlerKey];
|
||||
const hasCustomHandler = utils.is.function(customHandler);
|
||||
|
||||
// Execute custom handler
|
||||
if (hasCustomHandler) {
|
||||
customHandler.call(this.player, event);
|
||||
}
|
||||
|
||||
// Only call default handler if not prevented in custom handler
|
||||
if (!event.defaultPrevented && utils.is.function(defaultHandler)) {
|
||||
defaultHandler.call(this.player, event);
|
||||
}
|
||||
};
|
||||
|
||||
// Trigger custom and default handlers
|
||||
const on = (element, type, defaultHandler, customHandlerKey, passive = true) => {
|
||||
const customHandler = this.player.config.listeners[customHandlerKey];
|
||||
const hasCustomHandler = utils.is.function(customHandler);
|
||||
|
||||
utils.on(element, type, event => proxy(event, defaultHandler, customHandlerKey), passive && !hasCustomHandler);
|
||||
};
|
||||
|
||||
// Play/pause toggle
|
||||
on(this.player.elements.buttons.play, 'click', this.player.togglePlay, 'play');
|
||||
|
||||
// Pause
|
||||
on(this.player.elements.buttons.restart, 'click', this.player.restart, 'restart');
|
||||
|
||||
// Rewind
|
||||
on(this.player.elements.buttons.rewind, 'click', this.player.rewind, 'rewind');
|
||||
|
||||
// Rewind
|
||||
on(this.player.elements.buttons.fastForward, 'click', this.player.forward, 'fastForward');
|
||||
|
||||
// Mute toggle
|
||||
on(
|
||||
this.player.elements.buttons.mute,
|
||||
'click',
|
||||
() => {
|
||||
this.player.muted = !this.player.muted;
|
||||
},
|
||||
'mute',
|
||||
);
|
||||
|
||||
// Captions toggle
|
||||
on(this.player.elements.buttons.captions, 'click', this.player.toggleCaptions);
|
||||
|
||||
// Fullscreen toggle
|
||||
on(
|
||||
this.player.elements.buttons.fullscreen,
|
||||
'click',
|
||||
() => {
|
||||
this.player.fullscreen.toggle();
|
||||
},
|
||||
'fullscreen',
|
||||
);
|
||||
|
||||
// Picture-in-Picture
|
||||
on(
|
||||
this.player.elements.buttons.pip,
|
||||
'click',
|
||||
() => {
|
||||
this.player.pip = 'toggle';
|
||||
},
|
||||
'pip',
|
||||
);
|
||||
|
||||
// Airplay
|
||||
on(this.player.elements.buttons.airplay, 'click', this.player.airplay, 'airplay');
|
||||
|
||||
// Settings menu
|
||||
on(this.player.elements.buttons.settings, 'click', event => {
|
||||
controls.toggleMenu.call(this.player, event);
|
||||
});
|
||||
|
||||
// Settings menu
|
||||
on(this.player.elements.settings.form, 'click', event => {
|
||||
event.stopPropagation();
|
||||
|
||||
// Settings menu items - use event delegation as items are added/removed
|
||||
if (utils.matches(event.target, this.player.config.selectors.inputs.language)) {
|
||||
proxy(
|
||||
event,
|
||||
() => {
|
||||
this.player.language = event.target.value;
|
||||
},
|
||||
'language',
|
||||
);
|
||||
} else if (utils.matches(event.target, this.player.config.selectors.inputs.quality)) {
|
||||
proxy(
|
||||
event,
|
||||
() => {
|
||||
this.player.quality = event.target.value;
|
||||
},
|
||||
'quality',
|
||||
);
|
||||
} else if (utils.matches(event.target, this.player.config.selectors.inputs.speed)) {
|
||||
proxy(
|
||||
event,
|
||||
() => {
|
||||
this.player.speed = parseFloat(event.target.value);
|
||||
},
|
||||
'speed',
|
||||
);
|
||||
} else {
|
||||
controls.showTab.call(this.player, event);
|
||||
}
|
||||
});
|
||||
|
||||
// Seek
|
||||
on(
|
||||
this.player.elements.inputs.seek,
|
||||
inputEvent,
|
||||
event => {
|
||||
this.player.currentTime = event.target.value / event.target.max * this.player.duration;
|
||||
},
|
||||
'seek',
|
||||
);
|
||||
|
||||
// Current time invert
|
||||
// Only if one time element is used for both currentTime and duration
|
||||
if (this.player.config.toggleInvert && !utils.is.element(this.player.elements.display.duration)) {
|
||||
on(this.player.elements.display.currentTime, 'click', () => {
|
||||
// Do nothing if we're at the start
|
||||
if (this.player.currentTime === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.player.config.invertTime = !this.player.config.invertTime;
|
||||
ui.timeUpdate.call(this.player);
|
||||
});
|
||||
}
|
||||
|
||||
// Volume
|
||||
on(
|
||||
this.player.elements.inputs.volume,
|
||||
inputEvent,
|
||||
event => {
|
||||
this.player.volume = event.target.value;
|
||||
},
|
||||
'volume',
|
||||
);
|
||||
|
||||
// Polyfill for lower fill in <input type="range"> for webkit
|
||||
if (browser.isWebkit) {
|
||||
on(utils.getElements.call(this.player, 'input[type="range"]'), 'input', event => {
|
||||
controls.updateRangeFill.call(this.player, event.target);
|
||||
});
|
||||
}
|
||||
|
||||
// Seek tooltip
|
||||
on(this.player.elements.progress, 'mouseenter mouseleave mousemove', event => controls.updateSeekTooltip.call(this.player, event));
|
||||
|
||||
// Toggle controls visibility based on mouse movement
|
||||
if (this.player.config.hideControls) {
|
||||
// Watch for cursor over controls so they don't hide when trying to interact
|
||||
on(this.player.elements.controls, 'mouseenter mouseleave', event => {
|
||||
this.player.elements.controls.hover = !this.player.touch && event.type === 'mouseenter';
|
||||
});
|
||||
|
||||
// Watch for cursor over controls so they don't hide when trying to interact
|
||||
on(this.player.elements.controls, 'mousedown mouseup touchstart touchend touchcancel', event => {
|
||||
this.player.elements.controls.pressed = [
|
||||
'mousedown',
|
||||
'touchstart',
|
||||
].includes(event.type);
|
||||
});
|
||||
|
||||
// Focus in/out on controls
|
||||
on(this.player.elements.controls, 'focusin focusout', event => {
|
||||
this.player.toggleControls(event);
|
||||
});
|
||||
}
|
||||
|
||||
// Mouse wheel for volume
|
||||
on(
|
||||
this.player.elements.inputs.volume,
|
||||
'wheel',
|
||||
event => {
|
||||
// Detect "natural" scroll - suppored on OS X Safari only
|
||||
// Other browsers on OS X will be inverted until support improves
|
||||
const inverted = event.webkitDirectionInvertedFromDevice;
|
||||
const step = 1 / 50;
|
||||
let direction = 0;
|
||||
|
||||
// Scroll down (or up on natural) to decrease
|
||||
if (event.deltaY < 0 || event.deltaX > 0) {
|
||||
if (inverted) {
|
||||
this.player.decreaseVolume(step);
|
||||
direction = -1;
|
||||
} else {
|
||||
this.player.increaseVolume(step);
|
||||
direction = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Scroll up (or down on natural) to increase
|
||||
if (event.deltaY > 0 || event.deltaX < 0) {
|
||||
if (inverted) {
|
||||
this.player.increaseVolume(step);
|
||||
direction = 1;
|
||||
} else {
|
||||
this.player.decreaseVolume(step);
|
||||
direction = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't break page scrolling at max and min
|
||||
if ((direction === 1 && this.player.media.volume < 1) || (direction === -1 && this.player.media.volume > 0)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
'volume',
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
// Reset on destroy
|
||||
clear() {
|
||||
this.global(false);
|
||||
}
|
||||
}
|
||||
|
||||
export default Listeners;
|
106
src/js/media.js
Normal file
106
src/js/media.js
Normal file
@ -0,0 +1,106 @@
|
||||
// ==========================================================================
|
||||
// Plyr Media
|
||||
// ==========================================================================
|
||||
|
||||
import support from './support';
|
||||
import utils from './utils';
|
||||
import youtube from './plugins/youtube';
|
||||
import vimeo from './plugins/vimeo';
|
||||
import ui from './ui';
|
||||
|
||||
// Sniff out the browser
|
||||
const browser = utils.getBrowser();
|
||||
|
||||
const media = {
|
||||
// Setup media
|
||||
setup() {
|
||||
// If there's no media, bail
|
||||
if (!this.media) {
|
||||
this.debug.warn('No media element found!');
|
||||
return;
|
||||
}
|
||||
|
||||
// Add type class
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.type.replace('{0}', this.type), true);
|
||||
|
||||
// Add provider class
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.provider.replace('{0}', this.provider), true);
|
||||
|
||||
// Add video class for embeds
|
||||
// This will require changes if audio embeds are added
|
||||
if (this.isEmbed) {
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.type.replace('{0}', 'video'), true);
|
||||
}
|
||||
|
||||
if (this.supported.ui) {
|
||||
// Check for picture-in-picture support
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.pip.supported, support.pip && this.isHTML5 && this.isVideo);
|
||||
|
||||
// Check for airplay support
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.airplay.supported, support.airplay && this.isHTML5);
|
||||
|
||||
// If there's no autoplay attribute, assume the video is stopped and add state class
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.config.autoplay);
|
||||
|
||||
// Add iOS class
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.isIos, browser.isIos);
|
||||
|
||||
// Add touch class
|
||||
utils.toggleClass(this.elements.container, this.config.classNames.isTouch, this.touch);
|
||||
}
|
||||
|
||||
// Inject the player wrapper
|
||||
if (this.isVideo) {
|
||||
// Create the wrapper div
|
||||
this.elements.wrapper = utils.createElement('div', {
|
||||
class: this.config.classNames.video,
|
||||
});
|
||||
|
||||
// Wrap the video in a container
|
||||
utils.wrap(this.media, this.elements.wrapper);
|
||||
}
|
||||
|
||||
if (this.isEmbed) {
|
||||
switch (this.provider) {
|
||||
case 'youtube':
|
||||
youtube.setup.call(this);
|
||||
break;
|
||||
|
||||
case 'vimeo':
|
||||
vimeo.setup.call(this);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (this.isHTML5) {
|
||||
ui.setTitle.call(this);
|
||||
}
|
||||
},
|
||||
|
||||
// Cancel current network requests
|
||||
// See https://github.com/sampotts/plyr/issues/174
|
||||
cancelRequests() {
|
||||
if (!this.isHTML5) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove child sources
|
||||
utils.removeElement(this.media.querySelectorAll('source'));
|
||||
|
||||
// Set blank video src attribute
|
||||
// This is to prevent a MEDIA_ERR_SRC_NOT_SUPPORTED error
|
||||
// Info: http://stackoverflow.com/questions/32231579/how-to-properly-dispose-of-an-html5-video-and-close-socket-or-connection
|
||||
this.media.setAttribute('src', this.config.blankVideo);
|
||||
|
||||
// Load the new empty source
|
||||
// This will cancel existing requests
|
||||
// See https://github.com/sampotts/plyr/issues/174
|
||||
this.media.load();
|
||||
|
||||
// Debugging
|
||||
this.debug.log('Cancelled network requests');
|
||||
},
|
||||
};
|
||||
|
||||
export default media;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user