Comparar commits
1333 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| bf0b538e23 | |||
| 809d6d881b | |||
| ca210e987a | |||
| 7173228f6e | |||
| 9a2415a9a4 | |||
| fa3172b245 | |||
| a11e657ccd | |||
| bd578596ed | |||
| 905329b10b | |||
| 7f67a01d8a | |||
| e8511a5799 | |||
| 69577790eb | |||
| b1de506b43 | |||
| 6738f765da | |||
| 8ec61bbb20 | |||
| 85a34d1b49 | |||
| 4658c7bad6 | |||
| 8878acc040 | |||
| 20f7fe991f | |||
| f0d9c240fe | |||
| 445eb26722 | |||
| 5ca0992cf1 | |||
| ac58dbf13a | |||
| 1ac8065ea6 | |||
| f51d36b053 | |||
| fa6f884409 | |||
| 335bcded98 | |||
| d8ea23e0c9 | |||
| 9d249bb23b | |||
| 7929677f6f | |||
| 6cd785ab7f | |||
| edde614822 | |||
| 9f969300d7 | |||
| 006fb3b705 | |||
| 5e23048370 | |||
| 95c4ae0404 | |||
| 9588602d48 | |||
| 6e2a302af8 | |||
| fe63992bd1 | |||
| 7b251d0d35 | |||
| 09ace0c625 | |||
| 3e63bf3d17 | |||
| d7f7e05b5c | |||
| 8c21f0afe0 | |||
| f6f9998299 | |||
| d668c4976b | |||
| a6b8425f6b | |||
| 1f3375e485 | |||
| 19ebc0dda5 | |||
| db55bbd3ec | |||
| 6233d14091 | |||
| 0c337b3d67 | |||
| cd2f5106ca | |||
| 998c0042cb | |||
| ee014e2e04 | |||
| fe95a7720a | |||
| 7c80e1300a | |||
| abb5d67eb2 | |||
| bbd92ab813 | |||
| d889b660ac | |||
| 07594bcf59 | |||
| 14ae1e9658 | |||
| b1ac2e0249 | |||
| 269e504d26 | |||
| 971f633c73 | |||
| 03fd402ea9 | |||
| 3a600d0eea | |||
| 1e80e59614 | |||
| 7579fc1800 | |||
| 4f43616160 | |||
| 687aae50ff | |||
| 6986dbb851 | |||
| 39ff0f4fb6 | |||
| 82c8b80548 | |||
| f5cc165cad | |||
| b4dc4f85b0 | |||
| b63666379d | |||
| 77ba3d13d9 | |||
| 7f7ea70cb7 | |||
| e0824c8294 | |||
| cc6e82442f | |||
| 97021554cd | |||
| c4bbe5d120 | |||
| 66a0d23e05 | |||
| 4bce4a2954 | |||
| f87b12c3af | |||
| 9329e3ef8e | |||
| 546bef5321 | |||
| c31836c30c | |||
| a5a68e819a | |||
| 98160700e5 | |||
| e5e1c7f269 | |||
| 0c16c5f3cf | |||
| d57f09f7cf | |||
| 2a26c7f87b | |||
| eade52e174 | |||
| 188ead1c81 | |||
| 8f67b4fc54 | |||
| cb6005eca4 | |||
| 8d80a5846e | |||
| 35df35143f | |||
| 3087830ed7 | |||
| 483e5a2ca5 | |||
| 3dcfa9568a | |||
| b5c60f339b | |||
| 03bab83dde | |||
| f773c473f9 | |||
| ae423df4f5 | |||
| 0a19cf0d6a | |||
| da1d8613d7 | |||
| da0f1ee681 | |||
| cff2e503ef | |||
| 561d5ddf76 | |||
| d6e56e9222 | |||
| 7490a499ce | |||
| 1ea00419c9 | |||
| 230743ecb1 | |||
| 39fd73f781 | |||
| 92e5d9fb5a | |||
| 083f643e63 | |||
| 02721c7c03 | |||
| c20ca5cc97 | |||
| d9d7278282 | |||
| c7fd68d4ae | |||
| e98c65d7a6 | |||
| 29d733d0d1 | |||
| 0908d914ac | |||
| 9274457e4c | |||
| 0d19a05972 | |||
| dc37cb24f2 | |||
| 6d876ee6ef | |||
| 46dd0aac11 | |||
| 16c1e0adc0 | |||
| 7d12c9ea85 | |||
| 312b10ca44 | |||
| 022305706c | |||
| f2b5a057fe | |||
| dbfba28a10 | |||
| 61e20786a9 | |||
| 0fd7aad850 | |||
| d79b8a7013 | |||
| 41be5dca4e | |||
| 424fa51c28 | |||
| 90030d5e99 | |||
| af1c6e374c | |||
| c829fcff5f | |||
| 23823556d4 | |||
| ddde644c78 | |||
| cb890a965c | |||
| 1770f00018 | |||
| 05e64948c5 | |||
| bf787bd5cc | |||
| 67634cf216 | |||
| 88ee6af431 | |||
| c611f9f358 | |||
| 2ee133f6f8 | |||
| 5ffe1cd49e | |||
| d9ec7bc1ba | |||
| e5af0a5e21 | |||
| db901c54d9 | |||
| 74eb5d4772 | |||
| f95815bcd0 | |||
| 61d427c7ee | |||
| a9f8fcb2a2 | |||
| 5265624410 | |||
| fb88ae2bfc | |||
| a2b1a33606 | |||
| 9ef2d07b41 | |||
| 139567738f | |||
| d5a619d10e | |||
| dc9ed1cf5f | |||
| 326398d312 | |||
| 0f57341e38 | |||
| dacf0ca133 | |||
| 3bbf0199e6 | |||
| 6874fa2824 | |||
| 715f5847da | |||
| 96a387f723 | |||
| f558648f44 | |||
| 8c1302ee34 | |||
| 4388beae91 | |||
| 576ac19214 | |||
| db0112053f | |||
| 1f7a842348 | |||
| 0d0dea4da8 | |||
| 181a19f5fd | |||
| 1cb0a97b0b | |||
| 127cd7827e | |||
| 405b29b8f1 | |||
| e1b48042dd | |||
| a04f387a72 | |||
| 0da93249d3 | |||
| caff93fbf0 | |||
| 65dc81a4e1 | |||
| 55408683fb | |||
| dc4c1eb88b | |||
| 3c1108c5dc | |||
| c3b1d689f6 | |||
| 17143fd9fe | |||
| 7ab52d1a59 | |||
| 2433915c64 | |||
| 0ac126935a | |||
| eddc1d71a3 | |||
| 1b1ba04271 | |||
| 6208e4bc72 | |||
| 3aa79ae9b1 | |||
| 6541467ad8 | |||
| 0fc2c1c7a4 | |||
| be27f2aa6e | |||
| 5748c360af | |||
| e176b56843 | |||
| 70d2eb10cf | |||
| 516c9f9362 | |||
| 4f79e1e299 | |||
| 60bcc99302 | |||
| da2a1e07f4 | |||
| 04f23c1a62 | |||
| 29c6141de9 | |||
| a8f2e43274 | |||
| fcb5aa8383 | |||
| 2da4e76ef0 | |||
| 6ad1e5c97b | |||
| 49496195ed | |||
| 24d2e7ba33 | |||
| 5bde16a1bc | |||
| cb42fcfb02 | |||
| 5b8b41e546 | |||
| f87ada1ee0 | |||
| 19b429bddc | |||
| c8f5e3a3fc | |||
| 22aade1b61 | |||
| e34335b012 | |||
| 866a3f37d8 | |||
| 37a6811fb6 | |||
| 03529163b6 | |||
| 2e2ac6f870 | |||
| 4979ea78d5 | |||
| 3585af0fe2 | |||
| d7d7cfeb9f | |||
| 4c3b60c3b6 | |||
| c2545ddb6d | |||
| 05b39fe281 | |||
| 7b0d738e8f | |||
| 8e7d8cc959 | |||
| 8888e2b5b5 | |||
| 1463e50f7b | |||
| a0ba8e2360 | |||
| 924fb279ee | |||
| e642295468 | |||
| de3945db15 | |||
| 58f2349302 | |||
| e3424f6a4d | |||
| 34aab3f357 | |||
| b387437aed | |||
| 524f868e31 | |||
| 1ba1f5aabd | |||
| 49bed07039 | |||
| 7bafcc2a55 | |||
| 2037e18235 | |||
| 8d1653aebc | |||
| 8f07f5d57c | |||
| 0bba3196d8 | |||
| 091bdf9261 | |||
| 29ffbfbc87 | |||
| 57af15ce8b | |||
| ce6acc832a | |||
| 8622b2648e | |||
| 73b6316f3b | |||
| 844e4f0107 | |||
| b07143d276 | |||
| e12bedbb45 | |||
| c340dbcccd | |||
| 20141202c1 | |||
| 5377ffc176 | |||
| f8aed4dc32 | |||
| 6578ed98ac | |||
| bb9b710d95 | |||
| 305e5ea192 | |||
| 94fd5c12c8 | |||
| 2ceed0a4eb | |||
| bbe82530aa | |||
| d290db1765 | |||
| f35de1c98d | |||
| 02da69741a | |||
| 0ce7cd4fe3 | |||
| d120ea29b7 | |||
| c239bd5c5a | |||
| b5472145bf | |||
| 9ec55879a1 | |||
| 83d453b498 | |||
| e5a240a631 | |||
| 9c74116578 | |||
| b914c76247 | |||
| 26d4e7b0bf | |||
| ac0b03f2f7 | |||
| b7c384eb5b | |||
| 4fd902229f | |||
| 42507f8c11 | |||
| e92db4f407 | |||
| 22cf3dd935 | |||
| eb389c57c0 | |||
| 26789e7470 | |||
| 642ad4b5cf | |||
| 0493f54d6f | |||
| d20e9ce128 | |||
| 74530d8b3a | |||
| a7ffa34b7b | |||
| 3f724f9349 | |||
| 559297a376 | |||
| 87cd26d958 | |||
| 98b80df0d0 | |||
| 83cbeec424 | |||
| 7985c63541 | |||
| 214e01c885 | |||
| 5ec46b0372 | |||
| 014c6b89e6 | |||
| 766580af2b | |||
| 881cfcb346 | |||
| bed19be9cd | |||
| bfcb9e2fb5 | |||
| 761b877626 | |||
| 8f16de2778 | |||
| 54ff1f97b8 | |||
| 1d5562d656 | |||
| c9022795fd | |||
| ba3cf1724f | |||
| 15ce37e45d | |||
| eb2093e16e | |||
| cfc3ed7f0f | |||
| 1a0b2812ce | |||
| d24fe409e8 | |||
| b4ebd9ba00 | |||
| 9b9f89e5b3 | |||
| d69551ac80 | |||
| c5d1152456 | |||
| 41bd855e19 | |||
| de25d751b9 | |||
| 406c203f17 | |||
| eb5e78bb88 | |||
| 430be94e7f | |||
| 72fcb6c659 | |||
| 252bcee959 | |||
| 6b477bb737 | |||
| 23f0fa05cb | |||
| 2a05633159 | |||
| 3fc9b83958 | |||
| 50f8ad214c | |||
| f05a9271b8 | |||
| 996507744f | |||
| b6d521f472 | |||
| 4859bb9e3d | |||
| 45ffa810fb | |||
| e9e5b5f782 | |||
| 8d51235b30 | |||
| 77357b1cd2 | |||
| 11a096d60f | |||
| 5f42130b82 | |||
| 6889e925b4 | |||
| b2c5b2a412 | |||
| fb74c71ba6 | |||
| 74cddcad73 | |||
| 2e720afb65 | |||
| 8f7eb121bb | |||
| d11fd50a63 | |||
| 726367abc5 | |||
| 9702618c02 | |||
| 685404d018 | |||
| 202da2d468 | |||
| 028559ccb0 | |||
| de1b363470 | |||
| 9d77268f76 | |||
| ed59531f78 | |||
| 2988f6ae53 | |||
| f599ef4c51 | |||
| 254683b5cd | |||
| 9e20386a94 | |||
| fe760a44d7 | |||
| 49e29bac85 | |||
| ac0329f875 | |||
| 7b9574bb19 | |||
| c51f22680f | |||
| 66922a818e | |||
| 16c855931b | |||
| 8845bd36c1 | |||
| e932061024 | |||
| 44ec0e4e75 | |||
| d6e49a4095 | |||
| d4e89d2adc | |||
| 920c54a65c | |||
| 7d85f27a8e | |||
| ae3e27788d | |||
| e479f8c34c | |||
| 6878c21c68 | |||
| dd2aff00a8 | |||
| c545acdaea | |||
| 54e3db5d34 | |||
| 2032b17943 | |||
| ca022981e0 | |||
| 816291e7b5 | |||
| 4063f96bb5 | |||
| 280ecd49d7 | |||
| eb0efd499c | |||
| 08c7f4e1d4 | |||
| 86f0830502 | |||
| 5fdcd4602b | |||
| 5f95e413e3 | |||
| 057588f6c7 | |||
| 7cf2de30ac | |||
| d520d29fd6 | |||
| 3a927523c3 | |||
| ecc95331a7 | |||
| 282bda7e34 | |||
| 3a859f97d0 | |||
| 0d0ff90ca1 | |||
| b4265a8468 | |||
| fac52046f3 | |||
| a17de688f3 | |||
| fdd8550307 | |||
| 83b372c0d4 | |||
| daab267736 | |||
| 8beab2791a | |||
| 2d9d6b9e46 | |||
| 94f22bb995 | |||
| 0b10b69775 | |||
| f37383784d | |||
| eff1cf34db | |||
| a2167a6b95 | |||
| af6beb21c3 | |||
| ebf7718f1b | |||
| 80851ea7ca | |||
| c154518df4 | |||
| 1d2d08584e | |||
| 46d713589b | |||
| 23d1fcd882 | |||
| b56ed61523 | |||
| b90f04fc3b | |||
| 141ecf221b | |||
| c859d8e104 | |||
| f787cbad18 | |||
| 46058ddb0f | |||
| 955185379f | |||
| d58be409a6 | |||
| 13d16c1d76 | |||
| 773b5ab1c1 | |||
| 5178c122a5 | |||
| db0e821f38 | |||
| fa1c6430f4 | |||
| bf2eabf82d | |||
| 2f5a0ca48b | |||
| 2c84f45ff3 | |||
| 6385d1d429 | |||
| 4ae370c1a2 | |||
| 72c44daaf3 | |||
| b3e4e95f9c | |||
| ab82bf0008 | |||
| 1bb40b8d14 | |||
| f2a21d4aa2 | |||
| c15d64adf5 | |||
| b9d811c2e2 | |||
| a0e9318862 | |||
| 876d1128a6 | |||
| 14d36a47ee | |||
| ae788be15f | |||
| 56fc3356dc | |||
| 1e1636e1f0 | |||
| 2e46c516f6 | |||
| c306e4f7f3 | |||
| f3f979ae49 | |||
| f947ed7791 | |||
| 1ff9f381a2 | |||
| d86d4b2222 | |||
| 052c2ce1a9 | |||
| 4f6cb03add | |||
| 485524882e | |||
| 945711855a | |||
| 272d5eed83 | |||
| 86068a5b45 | |||
| e85c1c0391 | |||
| c89b75699e | |||
| fc72fb90e7 | |||
| 34a78b8989 | |||
| 8dd01467f3 | |||
| 3e9c53f84f | |||
| b270f58bc8 | |||
| 5b15feb5af | |||
| 4b4954ef4d | |||
| b557695e5a | |||
| 238c752aee | |||
| 58604795f8 | |||
| 20b53206a5 | |||
| ec42a1cfd7 | |||
| 5883c9236e | |||
| 7ae2c885a7 | |||
| c51c19ae88 | |||
| 13d349b0da | |||
| e2bfe09c7b | |||
| e7ca49e668 | |||
| f36da276e3 | |||
| 9f37a64146 | |||
| c51c180b3c | |||
| 68c7ab4748 | |||
| a84623dc9c | |||
| e541af30dc | |||
| a63eb1241d | |||
| 382d5aadbe | |||
| 6620f2d7be | |||
| 2a76453cdd | |||
| 43551797c3 | |||
| b6da0a7f70 | |||
| 7f6ce63ad9 | |||
| 9de215fa4c | |||
| 0808f843eb | |||
| 819b787f5f | |||
| 165a499271 | |||
| 7da89f51a6 | |||
| b7fdf21a05 | |||
| 546138e433 | |||
| 4e0325013e | |||
| 8d5a1b1193 | |||
| 40cf2730b9 | |||
| 11d379cbce | |||
| 101f471829 | |||
| b9e3e55384 | |||
| b981f254de | |||
| fa8fc80b83 | |||
| 17f856849d | |||
| 06fdbaf73d | |||
| aa2b8e82ff | |||
| cf5d64dd49 | |||
| ed39b68f13 | |||
| b1e7bfd8f8 | |||
| a11f66ff4f | |||
| 82d396a1fb | |||
| ed3249818e | |||
| 68c4d248d9 | |||
| 6e8ab67a48 | |||
| 7c94ac42cc | |||
| 971dbaecc4 | |||
| 3aff03be84 | |||
| 9a59aee304 | |||
| 4156307792 | |||
| 249532ad45 | |||
| 6296ca8538 | |||
| 2e2dbde4b4 | |||
| 18cdf08c0e | |||
| b931b6bde9 | |||
| aa94e0be07 | |||
| ae4617d74c | |||
| cfb9621884 | |||
| e7d31d3f9e | |||
| 264e53fb5b | |||
| 048dad4cf3 | |||
| a347c1d0fa | |||
| d3b368ccce | |||
| ff83aa6573 | |||
| 6b5040c04c | |||
| fdd4d25bad | |||
| 5cafd387ea | |||
| 55c101de0c | |||
| f4ee2767eb | |||
| a53ef7d1b8 | |||
| 834b94385c | |||
| f606f9df50 | |||
| 48ec1fb3ee | |||
| b254fb71be | |||
| fa27cc7dbf | |||
| e183194224 | |||
| 75116d4249 | |||
| 002b739930 | |||
| 0f40f3f155 | |||
| 41f8e7b855 | |||
| 4849374f23 | |||
| 4e45d21836 | |||
| 471529b805 | |||
| 68bb36e3eb | |||
| 6e579ba4da | |||
| 46374f5b57 | |||
| 0d2d8f58dd | |||
| ba7ec0bf57 | |||
| dc3fc686e7 | |||
| 5261f8204f | |||
| f8a5cdc319 | |||
| 3a800186b3 | |||
| a22c7f2a4d | |||
| a74b92643d | |||
| b2d0e10dbd | |||
| 096c36f8ed | |||
| 4cf2cc72b5 | |||
| b91018952e | |||
| 31b2f9d489 | |||
| 3070e738f1 | |||
| 4663d0ed01 | |||
| ac3771a329 | |||
| 1c730cb21f | |||
| 6845cbedc3 | |||
| 6eba133963 | |||
| d4c1af60ac | |||
| bf95bb21cc | |||
| 4e75ce1e9e | |||
| 9f38a08399 | |||
| 41bc481597 | |||
| 66a2c05510 | |||
| db189b73d7 | |||
| dbdc411dc2 | |||
| 94e899f810 | |||
| e2c8c125a2 | |||
| 0b26d83e99 | |||
| 8cc633edc4 | |||
| 3367b007a2 | |||
| feb7e26211 | |||
| 5a5b42f2a7 | |||
| f82a3d148f | |||
| 21051534f3 | |||
| f4bc3c12b5 | |||
| c1112b74fe | |||
| f77bcc95d0 | |||
| cb3d709237 | |||
| d9a0a4503c | |||
| 3ef88f8b80 | |||
| 80c6c16a2f | |||
| e12ca69306 | |||
| d8ba649549 | |||
| 0490728321 | |||
| dd1f2b5c25 | |||
| 47a307b773 | |||
| 050f23d913 | |||
| b027603a6a | |||
| a2f5430a5d | |||
| acd775f551 | |||
| 084bcf692c | |||
| fc7a166705 | |||
| 341c9c7700 | |||
| 5245335147 | |||
| 171ec1a274 | |||
| 29f66acb98 | |||
| d9cad36ade | |||
| 99b34e9691 | |||
| 2f0b9ee8ca | |||
| c8646aa02b | |||
| 58f76136e5 | |||
| 47f639fb41 | |||
| bb606cdcbd | |||
| 876e48547c | |||
| df02e7a709 | |||
| 9cdfb75187 | |||
| 8a17313a3b | |||
| 6317395e0c | |||
| b9f251650b | |||
| 0ffb27abb0 | |||
| e05931dd19 | |||
| 16f0179c07 | |||
| 81caccd154 | |||
| d448acd224 | |||
| c901fcee6b | |||
| 6977b0e3fe | |||
| b48797bf17 | |||
| dcf2a300ef | |||
| 088f47af2e | |||
| 984085a048 | |||
| 67840aabbe | |||
| 93f2f83723 | |||
| 867fec910f | |||
| aa4700b098 | |||
| b84be556a6 | |||
| 0f219b1f1d | |||
| 49cc73f980 | |||
| 8ad286a768 | |||
| 5f239d7cf1 | |||
| 35203f613f | |||
| 692608270e | |||
| d99ce79954 | |||
| 01a7e7509e | |||
| 09f182db60 | |||
| 7838fe2ec3 | |||
| 45d43ec904 | |||
| c61e9e49ab | |||
| 4cb14eb420 | |||
| 1d88ef066d | |||
| 16f2e4113a | |||
| 4424a06a3d | |||
| 08f03c160c | |||
| 565dba8671 | |||
| a528e44d9b | |||
| 996822ba68 | |||
| 359df7148b | |||
| c6bf2b847a | |||
| 44edb12700 | |||
| 5bb1a76c4e | |||
| 8f2bc92412 | |||
| e78e26b8a4 | |||
| 9e3a7b6159 | |||
| 0b7a2e41b3 | |||
| f225d4e68a | |||
| a601fbb83f | |||
| 69b89e51f4 | |||
| 8acd28c15a | |||
| b188781fa9 | |||
| 5ed0dc8adb | |||
| 72f77d77c9 | |||
| 7171ea8d42 | |||
| 3e19c91828 | |||
| 5f9095079e | |||
| 552d8cbda3 | |||
| 8d0de0fa51 | |||
| c4dbd2488b | |||
| c0d5f471bc | |||
| 3a40b10fa6 | |||
| 7dff83b2a4 | |||
| 6bbd6f1a65 | |||
| d9b5fbc60d | |||
| 385266338a | |||
| 0e1c424e48 | |||
| d1316a39ab | |||
| 210caea7f0 | |||
| 0da23c1d8d | |||
| 2627e86db5 | |||
| ea2e274a30 | |||
| f2fa8f8687 | |||
| cd800b02ea | |||
| 89d860fb84 | |||
| ed5ed0ded4 | |||
| 977eedda79 | |||
| 4e395b6b02 | |||
| a25c4c98f3 | |||
| b1e863677f | |||
| 98f241d614 | |||
| 5d754c911d | |||
| fa2f08ad66 | |||
| 0b32893612 | |||
| d0efd16b49 | |||
| c24a3a8173 | |||
| e6f5d6b585 | |||
| 42e33ca537 | |||
| 655e14a733 | |||
| 871dac9c3a | |||
| 6e25aef060 | |||
| 5f5357d535 | |||
| 86f23d39fd | |||
| 51f1863adc | |||
| ab88bcdde3 | |||
| 589cab7fa7 | |||
| c85b526a1c | |||
| 4598b38291 | |||
| 93e079718e | |||
| 34742e09a5 | |||
| 702fbe4d68 | |||
| d036f25681 | |||
| e98bc42500 | |||
| d47a8ab2dc | |||
| c89f645600 | |||
| 6f3826a7ef | |||
| d9524d4d35 | |||
| 1834d39c2f | |||
| 49698d2a8c | |||
| 9c28857247 | |||
| 40b6ad3050 | |||
| e58c2266de | |||
| 0832b89970 | |||
| 7ce59efa7d | |||
| 8c101e2b35 | |||
| aab9246253 | |||
| da09a44eda | |||
| 6beb0eb299 | |||
| a56781945a | |||
| 872459837b | |||
| 6354329a1b | |||
| cd6c568a03 | |||
| e225fbffc2 | |||
| a5dad5ade2 | |||
| 1d79c4a9e2 | |||
| c5321f4cbf | |||
| 60c86465f8 | |||
| 1f618d7b00 | |||
| 2de28927d7 | |||
| 8d9695b6ad | |||
| ad0820cfa3 | |||
| 992e5e63f5 | |||
| f6dca78c5e | |||
| 0b7cf586c2 | |||
| 1234faaf71 | |||
| f5b80c8ea9 | |||
| 2c10c7f310 | |||
| 81806d5725 | |||
| 9788112e76 | |||
| 42468e19be | |||
| ba6018d4ea | |||
| e121428565 | |||
| 2be7263ac3 | |||
| 3f8be868bd | |||
| 8fbe0a947f | |||
| 1f06f23ded | |||
| d072d9b371 | |||
| 61a00db7cb | |||
| a0b4293b82 | |||
| 24ad9841ac | |||
| ccedad44ef | |||
| 81000369ec | |||
| 651a33a145 | |||
| 51bae4d7cf | |||
| 968bd7432d | |||
| 24cdbdefff | |||
| 0c416bd286 | |||
| 4cb76873f4 | |||
| 99376bf396 | |||
| f7466af956 | |||
| 50bb4540a1 | |||
| f10d8d0cb3 | |||
| a3bfa8a73c | |||
| 63451a7526 | |||
| 4f250e8fc2 | |||
| 85b825a0dd | |||
| 517489513f | |||
| c9974657a9 | |||
| 313d18106b | |||
| 32aa9ed7e4 | |||
| 4d6c737a21 | |||
| 2e1d051144 | |||
| 2c74d9e355 | |||
| 849b85bb83 | |||
| 1503bf1268 | |||
| 4dadd01cf5 | |||
| 0bd7538fbc | |||
| 1b745e7b11 | |||
| a355f900b9 | |||
| 0341ec12ad | |||
| 0b5f41c466 | |||
| f7702f8f38 | |||
| 9179bdbdf6 | |||
| 1b057dfe85 | |||
| 658adb27ec | |||
| 4b58fad8bd | |||
| 3abc5c66df | |||
| 1f5a83dc23 | |||
| ccb6b35291 | |||
| 5624adb75d | |||
| 63e21bdadd | |||
| 4582e8a003 | |||
| 65b5a6e298 | |||
| 3fb786e271 | |||
| 0f6abfd210 | |||
| 608dad1299 | |||
| f151c3b67e | |||
| f492450a01 | |||
| b40865ad2b | |||
| 4d97dd4d29 | |||
| a584104b78 | |||
| 2e8b306578 | |||
| ea467b31b8 | |||
| e95e3e76b2 | |||
| 6a26358da2 | |||
| b35c8774b8 | |||
| fca885a62f | |||
| 336be2f8b7 | |||
| 98315b0e52 | |||
| 547e82d8e8 | |||
| 90c6890567 | |||
| c38778c296 | |||
| 473861ba38 | |||
| b27bbf16b1 | |||
| de39cfc5ab | |||
| 75e65c6585 | |||
| e10a2f4b03 | |||
| dfe751d8d2 | |||
| bfbd065e42 | |||
| f7d1289593 | |||
| 44fa9af226 | |||
| f3b5075bcd | |||
| 0fe811df2c | |||
| a02f0befbc | |||
| ceba633edb | |||
| 976ee6e30b | |||
| eca378c388 | |||
| 904bf0cabf | |||
| 3228821926 | |||
| 33de0085ae | |||
| d0e2ede27a | |||
| c4ed1451e0 | |||
| 395780a1b6 | |||
| b1055dce01 | |||
| cc6369c524 | |||
| ecca3a1b58 | |||
| 55143b261d | |||
| 76b5ffc7b5 | |||
| 70d9bbd145 | |||
| 79e58884de | |||
| 06f16d993e | |||
| 863f31546d | |||
| 51f92181e8 | |||
| 3a889ea4b5 | |||
| ac97de0bd4 | |||
| 20b2a78287 | |||
| 39ef157994 | |||
| 4ec82d647d | |||
| 293c9875d8 | |||
| fa58f51fd1 | |||
| 4a4e85912e | |||
| 8b97163250 | |||
| fecf3a0f8a | |||
| 4fd59c89db | |||
| e4f2f3bd96 | |||
| f1a8421ea7 | |||
| b41b12e0ab | |||
| cbbae8fabd | |||
| cd3f96978f | |||
| 564da36339 | |||
| c03e26c575 | |||
| 70fec0bc50 | |||
| ed790fdc38 | |||
| 589a0f86ee | |||
| c0673d2852 | |||
| 67c0d999cc | |||
| 1bf64890c0 | |||
| b528473655 | |||
| a02e3609ab | |||
| 9ed5be570d | |||
| 8c6c7d6e27 | |||
| 6905d0b005 | |||
| f80de2b1ac | |||
| 1f8e0cc48a | |||
| abca8913e1 | |||
| f97e84a41e | |||
| 2dfd315ac1 | |||
| 7d335e0989 | |||
| 1d0ae800b8 | |||
| cb6465e9d2 | |||
| 746f07a0ec | |||
| 4979d765f8 | |||
| d3d1a7fed7 | |||
| b2db8b9fb6 | |||
| fe65ffae65 | |||
| 8418a316d6 | |||
| 3bf415e522 | |||
| 5c4681506b | |||
| 8aa61d3b1a | |||
| aa8601f22f | |||
| a76b42d50c | |||
| 06bff98ca6 | |||
| 6a9e2e01d0 | |||
| 63392f25a7 | |||
| e330e7b978 | |||
| 57152ae62f | |||
| e5a8c835e1 | |||
| dd6ed45f8e | |||
| d11add5dc2 | |||
| 152e1ad808 | |||
| 39d9989589 | |||
| 75af988c86 | |||
| dd0752e6b0 | |||
| e0b1008225 | |||
| 3cabc75b83 | |||
| 456ee4e84f | |||
| 01ea3d1ae3 | |||
| 69dde46aa2 | |||
| 8be7810049 | |||
| b097016215 | |||
| 843a57765d | |||
| 4ad45ef9a8 | |||
| 4056c5f75c | |||
| d3d5d032fc | |||
| 52bbd468d5 | |||
| 1102452ca3 | |||
| dd9930b6c6 | |||
| a18768b938 | |||
| c98f775267 | |||
| 07f0483780 | |||
| 1eb416deef | |||
| d3655f79a1 | |||
| dbad385157 | |||
| ca5103befe | |||
| fa08d77766 | |||
| e5d4757e36 | |||
| 69348f4e0d | |||
| 8cc967e022 | |||
| d2de00cae1 | |||
| 3842890900 | |||
| 3e35935182 | |||
| dfd481037e | |||
| 3268d71577 | |||
| 7bcc2ba8f7 | |||
| 9de463e35c | |||
| 5bcf3b40e3 | |||
| d5061d7691 | |||
| 70d82a03db | |||
| f53f3dc36f | |||
| 590e731db4 | |||
| ccd6ed44b8 | |||
| f9316fcda0 | |||
| 440dfe92f8 | |||
| ba4ab80455 | |||
| db3e58b653 | |||
| 77a96bea6f | |||
| f73f69c66c | |||
| 3479a545aa | |||
| 46c79e2b19 | |||
| c2820e9e38 | |||
| c43863edbd | |||
| 004b1e8f7b | |||
| 2b79dacdbc | |||
| 5fc794f4e7 | |||
| 56be47b80a | |||
| 34822537f4 | |||
| 49fbea6f4c | |||
| b77e3c9ade | |||
| 99032bb2a7 | |||
| 8d33388899 | |||
| 26a78627f1 | |||
| b93dea70b8 | |||
| 0f1c5f22f0 | |||
| 56d4861bb0 | |||
| 1404121fee | |||
| dfd8408ac5 | |||
| 1bc8efc218 | |||
| 463ba4ea44 | |||
| d5605be8f5 | |||
| e4ddb4f769 | |||
| 20b46b9fb9 | |||
| 05b6bb2ae4 | |||
| ffe7c32899 | |||
| ee22d4ad5b | |||
| 0be74e51ff | |||
| 3857d78261 | |||
| 14c8705530 | |||
| 00cc335d64 | |||
| 20748ba7f7 | |||
| b3a2583e9e | |||
| 362821801e | |||
| 34df8767a2 | |||
| 5bf28c9e3d | |||
| 4803ac2674 | |||
| 86a11a01ab | |||
| fa6ad4929e | |||
| 6410105190 | |||
| 02cfee72d8 | |||
| 7eff3aca48 | |||
| 55a391b54a | |||
| 3a0f14728e | |||
| 040410122f | |||
| 42f00f2bfc | |||
| 56a9ef7571 | |||
| dac91a7b7b | |||
| 1c35bfafc2 | |||
| f03a91909e | |||
| f056a5b2e6 | |||
| 9df41f6562 | |||
| 965af8113f | |||
| d729547cbf | |||
| a6a4a0fd24 | |||
| 2e7821a467 | |||
| 9c33bd72c7 | |||
| c3c4046317 | |||
| 2af3047467 | |||
| 2bda7aabcd | |||
| 6ad6d17efb | |||
| 7ea3566a8c | |||
| 8d768ef0ab | |||
| 3bf01d9a41 | |||
| a88e311214 | |||
| fb5d0ce6ad | |||
| 7c169d417c | |||
| fdd133906c | |||
| a5758019e5 | |||
| 1ff361a825 | |||
| 27ee448e1f | |||
| 0ad43fd576 | |||
| 21edde8702 | |||
| 6b2dca32fc | |||
| 4007add5e5 | |||
| 7c5206eaf9 | |||
| 1bfe0b4fed | |||
| 5d550ffada | |||
| caf725a3d4 | |||
| 11d9d9afe8 | |||
| 69a4884880 | |||
| fbdf7ef041 | |||
| c4717ebed9 | |||
| b2311c7664 | |||
| 1ffb13a799 | |||
| dc083f8cf4 | |||
| a8ff970d4a | |||
| 2bf0be72f3 | |||
| 349ff89541 | |||
| 2fc8968002 | |||
| 652a44026f | |||
| ec53eda738 | |||
| 6128305cc3 | |||
| 0e63261db6 | |||
| c740115821 | |||
| d8e7d13fd0 | |||
| fbdb3f1ce2 | |||
| 4a62ebb042 | |||
| b87fb3ce32 | |||
| fd50bd0921 | |||
| db05a1b90d | |||
| e1c0f9fc35 | |||
| 7bbbf992a9 | |||
| 36956e20df | |||
| c5f5ea419e | |||
| b65bad8f20 | |||
| e5595b1e38 | |||
| de843affb7 | |||
| 9c99def186 | |||
| 793da0979a | |||
| 540258181c | |||
| 1480018cfb | |||
| 9b71d6b7d8 | |||
| 102c6fb197 | |||
| aa7f7709b1 | |||
| fd7b997ecd | |||
| 90b2f5d6ac | |||
| 87b8f8ec77 | |||
| 43a14291fa | |||
| 75aa65ebae | |||
| a392d6c933 | |||
| a6f4fb8ca7 | |||
| 90702a4f3e | |||
| 0b8bcbfba4 | |||
| d05967c561 | |||
| 3e1b76c9fb | |||
| b72f651a59 | |||
| f84632e057 | |||
| cc6c3daaed | |||
| cba2c54fb6 | |||
| ebf0aa1a06 | |||
| 915a6b90f2 | |||
| c7265e3d9d | |||
| 476b8a4cf8 | |||
| a131a00c4c | |||
| 54519da32c | |||
| b5968f13e2 | |||
| f7b1492332 | |||
| 9e953a2681 | |||
| f21f840afb | |||
| a40b0049ed | |||
| dcb24ce744 | |||
| bb9fde0f82 | |||
| 4fa6a942d9 | |||
| 013d59db76 | |||
| 8e84adb612 | |||
| e234375168 | |||
| 258687fee4 | |||
| 1eae8697e6 | |||
| 4cdca881d4 | |||
| cf25d3a857 | |||
| b4fbdc24d5 | |||
| ae0eec312c | |||
| 69738a86dc | |||
| f19d13b9bb | |||
| 94f33c8d43 | |||
| 4ac762cf48 | |||
| c62aa10637 | |||
| 232daaed54 | |||
| 4f52a47d7e | |||
| 493f4d5df4 | |||
| 621108ec03 | |||
| 65dddf7a0b | |||
| e1e69941a1 | |||
| a02ee27802 | |||
| 7f70f09621 | |||
| 6e29bccd01 | |||
| f3036dd528 | |||
| 44953cf99b | |||
| dfa791581f | |||
| 6e5fc8d687 | |||
| 0c9d53321f | |||
| f298d18023 | |||
| 2e689f85e5 | |||
| c9b53c5cfe | |||
| 3fd1a58357 | |||
| 7a9c4cc3be | |||
| ed76c5b709 | |||
| 6cc1b5191b | |||
| 634d8c39f2 | |||
| 4805e41ee0 | |||
| f69a229224 | |||
| 213c23d097 | |||
| 4296a7da2d | |||
| 12df63d7e7 | |||
| 6786b70da1 | |||
| bccea74d23 | |||
| cda6386e01 | |||
| 6b2e056ba6 | |||
| a0ce20c511 | |||
| 89c7b868f6 | |||
| 9dea6bed33 | |||
| 93ea3cee1c | |||
| cd48d03945 | |||
| 855e0ccedb | |||
| 0020ba15b9 | |||
| 9009593297 | |||
| 5b944877ae | |||
| 999dd60ff4 | |||
| ab84de6960 | |||
| 52e85e65fd | |||
| 20a4184ea7 | |||
| 3fdef79b9b | |||
| 06b8541fdb | |||
| 4003a4730d | |||
| ed8ccf599b | |||
| 972c8bd744 | |||
| 6e6c9fe885 | |||
| bbad7207a2 | |||
| 2a1f9f357f | |||
| 0b392fa9f5 | |||
| 2c6570a1a5 | |||
| 725fddbd66 | |||
| 550d44332b | |||
| 8e372d7ffd | |||
| 14c94561a9 | |||
| 8b0966c1b4 | |||
| 7bcb1d218c | |||
| 82f897b4fd | |||
| 9b0c6c66ea | |||
| bcf164fd99 | |||
| 5bd0338d2e | |||
| fbca5eae51 | |||
| dd24d17372 | |||
| 5bae2d88c3 | |||
| b14c2f73b3 | |||
| f27df10920 | |||
| f96803a806 | |||
| b2fe4c6292 | |||
| eb597d3660 | |||
| 52e6768526 | |||
| 4e5c28cc56 | |||
| 5c59849f30 | |||
| 4e9974165d | |||
| 3459381c2a | |||
| 1036338134 | |||
| 265ed0eca2 | |||
| 5e371b4625 | |||
| 3742afe607 | |||
| fd24c5c7a3 | |||
| fbb2197dfa | |||
| 19058302bd | |||
| 789c72945a | |||
| f980cdb1fb | |||
| 42fbd4c799 | |||
| b0a589a800 | |||
| e5ca608fc0 | |||
| cb0f93c27d | |||
| d5bbd80db9 | |||
| 1a11a8f256 | |||
| ec88f32702 | |||
| 2489cc1c10 | |||
| aac97d287a | |||
| 3c83fd364d | |||
| c8781cf51b | |||
| 8777b7f7a9 | |||
| 4bde5c8928 | |||
| fb3758dcab | |||
| 78e95e14b8 | |||
| 67c4eed937 | |||
| 300eeb759c | |||
| 2805bb0ad3 | |||
| 4e2b4a215c | |||
| b51d83090b | |||
| 0f4b19b94c | |||
| e8030ea88f | |||
| 1c17a67f39 | |||
| e8235c9022 | |||
| a3b12d9d03 | |||
| a8d1ef114a | |||
| 2ea2421e18 | |||
| 67e2c0ff76 | |||
| b2c3e2d759 | |||
| c939ab86ca | |||
| a96978b194 | |||
| fff41a9066 | |||
| 3780f8dbce | |||
| 24dff158fa | |||
| 9c1e410660 | |||
| 8cf9f19c11 | |||
| f0d500a633 | |||
| fc0730db98 | |||
| a67201f913 | |||
| a048468100 | |||
| 881be6f77d | |||
| c6d51faba3 | |||
| 169b4984e5 | |||
| 45b3601465 | |||
| e2c5462395 | |||
| 5545fc33e1 | |||
| 16d945c7ab | |||
| 716fc2dc2b | |||
| ad3e430cc6 | |||
| d7f2924fdc | |||
| bb5582abd3 | |||
| 9307844f79 | |||
| 9141a6256f | |||
| 2683c74c69 | |||
| c3139dcc1d | |||
| a859575e62 | |||
| aeecca728e | |||
| daa66b9183 | |||
| 3d16a4378c | |||
| d37e5c903f | |||
| 0469c5063c | |||
| dd9b4df727 | |||
| 0960a6108b | |||
| 68f32226db | |||
| c2e0c89d4c | |||
| c111d30b45 | |||
| 1f6c5179d8 | |||
| ea7bf36588 | |||
| 76e662a756 | |||
| 8a019ee046 | |||
| 2de84da25f | |||
| 899bc3cb76 | |||
| eaf8a8348f | |||
| 157dcbe9dd | |||
| 33e6630712 | |||
| 2e71201e23 | |||
| 1211e6f99d | |||
| 7642691296 | |||
| d6cf3c0d84 | |||
| caf44a4ad3 | |||
| fd2b9a7f38 | |||
| fc7cebe155 | |||
| bd6a9ff08c | |||
| 540152051f | |||
| 889ad338cc | |||
| 0c2dad9ef3 | |||
| 0919b77f31 | |||
| 758b9fda55 | |||
| 957687d449 | |||
| 768e40b169 | |||
| 5d859a92b5 | |||
| 1325722447 | |||
| 48a0049350 | |||
| 7432648e38 | |||
| f420c5bd5f | |||
| 423939857f | |||
| bcbe4f175a |
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"presets": [
|
||||
"es3",
|
||||
["es2015", {
|
||||
"loose": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
## Description
|
||||
Briefly describe the issue.
|
||||
Include a [reduced test case](https://css-tricks.com/reduced-test-cases/), we have a [starter template](http://jsbin.com/axedog/edit?html,output) on JSBin you can use.
|
||||
|
||||
## Steps to reproduce
|
||||
Explain in detail the exact steps necessary to reproduce the issue.
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
## Results
|
||||
### Expected
|
||||
Please describe what you expected to see.
|
||||
|
||||
### Actual
|
||||
Please describe what actually happened.
|
||||
|
||||
### Error output
|
||||
If there are any errors at all, please include them here.
|
||||
|
||||
## Additional Information
|
||||
Please include any additional information necessary here. Including the following:
|
||||
### versions
|
||||
#### videojs
|
||||
what version of videojs does this occur with?
|
||||
#### browsers
|
||||
what browser are affected?
|
||||
#### OSes
|
||||
what platforms (operating systems and devices) are affected?
|
||||
### plugins
|
||||
are any videojs plugins being used on the page? If so, please list them below.
|
||||
@@ -0,0 +1,16 @@
|
||||
## Description
|
||||
Please describe the change as necessary.
|
||||
If it's a feature or enhancement please be as detailed as possible.
|
||||
If it's a bug fix, please link the issue that it fixes or describe the bug in as much detail.
|
||||
|
||||
## Specific Changes proposed
|
||||
Please list the specific changes involved in this pull request.
|
||||
|
||||
## Requirements Checklist
|
||||
- [ ] Feature implemented / Bug fixed
|
||||
- [ ] If necessary, more likely in a feature request than a bug fix
|
||||
- [ ] Change has been verified in an actual browser (Chome, Firefox, IE)
|
||||
- [ ] Unit Tests updated or fixed
|
||||
- [ ] Docs/guides updated
|
||||
- [ ] Example created ([starter template on JSBin](http://jsbin.com/axedog/edit?html,output))
|
||||
- [ ] Reviewed by Two Core Contributors
|
||||
+11
-2
@@ -1,6 +1,6 @@
|
||||
.DS_Store
|
||||
dist/*
|
||||
build/files/*
|
||||
build/temp/*
|
||||
docs/api/*
|
||||
dev.html
|
||||
projects
|
||||
@@ -10,7 +10,7 @@ test/*.map
|
||||
.s3config.json
|
||||
|
||||
node_modules
|
||||
npm-debug.log
|
||||
npm-debug.log*
|
||||
|
||||
sandbox/*
|
||||
!sandbox/*.example
|
||||
@@ -22,3 +22,12 @@ sandbox/*
|
||||
|
||||
*results.xml
|
||||
*.log
|
||||
|
||||
test/coverage/*
|
||||
.coveralls.yml
|
||||
.sass-cache
|
||||
|
||||
dist/*
|
||||
es5/*
|
||||
|
||||
.idea/
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"source": {
|
||||
"include": [ "src/js/" ],
|
||||
"includePattern": ".js$"
|
||||
},
|
||||
"opts": {
|
||||
"destination": "docs/api",
|
||||
"readme": "docs/index.md",
|
||||
"template": "node_modules/tui-jsdoc-template",
|
||||
"package": "package.json",
|
||||
"recurse": true,
|
||||
"tutorials": "docs/guides",
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"default": {
|
||||
"staticFiles": {
|
||||
"include": ["build/docs/"]
|
||||
}
|
||||
},
|
||||
"logo": {
|
||||
"url": "http://videojs.com/img/logo.png",
|
||||
"height": "30px",
|
||||
"width": "214px"
|
||||
},
|
||||
"name": "Video.js Documentation",
|
||||
"tabNames": {
|
||||
"tutorials": "Guides"
|
||||
},
|
||||
"footerText": "<span class='copyright'><a href='http://videojs.com'>Video.js</a> is a free and open source HTML5 video player. © <a href='https://brightcove.com' target='_blank'>Brightcove, Inc</a>. <a href='https://github.com/videojs/video.js/blob/master/LICENSE' class='button blue' target='_blank'>View license</a></span> <ul class='other-links'><li><a href='http://videojs.com' class='button white'><i class='fa fa-external-link'></i> Video.js</a></li> <li><a href='https://twitter.com/videojs' class='button white' target='_blank'><i class='fa fa-twitter'></i> @videojs</a></li> <li><a href='http://github.com/videojs/video.js' class='button white' target='_blank'><i class='fa fa-github-alt'></i> Source</a></li> </ul>",
|
||||
"css": [
|
||||
"styles/videojs.css",
|
||||
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css"
|
||||
]
|
||||
},
|
||||
"plugins": ["plugins/markdown"],
|
||||
"markdown": {
|
||||
"tags": ["example"],
|
||||
"idInHeadings": true
|
||||
}
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
{
|
||||
"evil" : true,
|
||||
"validthis": true,
|
||||
"browser" : true,
|
||||
"debug" : true,
|
||||
"boss" : true,
|
||||
"expr" : true,
|
||||
"eqnull" : true,
|
||||
"quotmark" : "single",
|
||||
"sub" : true,
|
||||
"trailing" : true,
|
||||
"undef" : true,
|
||||
"laxbreak" : true,
|
||||
"predef" : [
|
||||
"_V_",
|
||||
"videojs",
|
||||
"vjs",
|
||||
"goog",
|
||||
"console",
|
||||
|
||||
"require",
|
||||
"define",
|
||||
"module",
|
||||
"exports",
|
||||
"process",
|
||||
|
||||
"PlayerTest",
|
||||
"TestHelpers",
|
||||
"asyncTest",
|
||||
"deepEqual",
|
||||
"equal",
|
||||
"expect",
|
||||
"module",
|
||||
"notDeepEqual",
|
||||
"notEqual",
|
||||
"notStrictEqual",
|
||||
"ok",
|
||||
"QUnit",
|
||||
"raises",
|
||||
"start",
|
||||
"stop",
|
||||
"strictEqual",
|
||||
"test",
|
||||
"sinon"
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
# Exclude everything but the contents of the dist directory.
|
||||
**/*
|
||||
!dist/**
|
||||
!es5/**
|
||||
!src/css/**
|
||||
!docs/api/**
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
CHANGELOG.md
|
||||
@@ -0,0 +1,84 @@
|
||||
var remarkrc = {
|
||||
settings: {
|
||||
bullet: '*',
|
||||
fence: '`',
|
||||
strong: '*',
|
||||
emphasis: '_',
|
||||
listItemIndent: 1,
|
||||
incrementListMarker: false
|
||||
},
|
||||
plugins: {
|
||||
'toc': {
|
||||
tight: true
|
||||
},
|
||||
}
|
||||
};
|
||||
var args = process.argv;
|
||||
|
||||
// only lint in non-output mode
|
||||
if (args.indexOf('-o') === -1 && args.indexOf('--output') === -1) {
|
||||
remarkrc['validate-links'] = {};
|
||||
remarkrc.plugins.lint = {
|
||||
'blockquote-indentation': ['error', 2],
|
||||
'checkbox-character-style': ['warn'],
|
||||
'checkbox-content-indent': ['error'],
|
||||
'code-block-style': ['error', 'fenced'],
|
||||
'definition-case': ['off'],
|
||||
'definition-spacing': ['error'],
|
||||
'emphasis-marker': ['error', '_'],
|
||||
'fenced-code-flag': ['error'],
|
||||
'fenced-code-marker': ['error', '`'],
|
||||
'file-extension': ['error'],
|
||||
'final-definition': ['error'],
|
||||
'final-newline': ['off'],
|
||||
'first-heading-level': ['warn', 1],
|
||||
'hard-break-spaces': ['off'],
|
||||
'heading-increment': ['error'],
|
||||
'heading-style': ['error', 'atx'],
|
||||
'link-title-style': ['warn', '"'],
|
||||
'list-item-bullet-indent': ['error'],
|
||||
'list-item-content-indent': ['warn'],
|
||||
'list-item-indent': ['error', 'space'],
|
||||
'list-item-spacing': ['off'],
|
||||
'maximum-heading-length': ['off'],
|
||||
'maximum-line-length': ['off'],
|
||||
'no-auto-link-without-protocol': ['error'],
|
||||
'no-blockquote-without-caret': ['error'],
|
||||
'no-consecutive-blank-lines': ['error'],
|
||||
'no-duplicate-definitions': ['error'],
|
||||
'no-duplicate-headings-in-section': ['error'],
|
||||
'no-duplicate-headings': ['off'],
|
||||
'no-emphasis-as-heading': ['error'],
|
||||
'no-file-name-articles': ['off'],
|
||||
'no-file-name-consecutive-dashes': ['off'],
|
||||
'no-file-name-irregular-characters': ['warn', '\\.a-zA-Z0-9-_'],
|
||||
'no-file-name-mixed-case': ['error'],
|
||||
'no-file-name-outer-dashes': ['error'],
|
||||
'no-heading-content-indent': ['error'],
|
||||
'no-heading-indent': ['error'],
|
||||
'no-heading-punctuation': ['off'],
|
||||
'no-html': ['off'],
|
||||
'no-inline-padding': ['error'],
|
||||
'no-literal-urls': ['off'],
|
||||
'no-missing-blank-lines': ['off'],
|
||||
'no-multiple-toplevel-headings': ['error'],
|
||||
'no-reference-like-url': ['error'],
|
||||
'no-shell-dollars': ['error'],
|
||||
'no-shortcut-reference-iamge': ['off'],
|
||||
'no-shortcut-reference-link': ['off'],
|
||||
'no-table-indentation': ['error'],
|
||||
'no-tabs': ['error'],
|
||||
'no-undefined-references': ['error'],
|
||||
'no-unused-definitions': ['error'],
|
||||
'ordered-list-marker-style': ['error', '.'],
|
||||
'ordered-list-marker-value': ['error', 'one'],
|
||||
'rule-style': ['error', '***'],
|
||||
'strong-marker': ['error', '*'],
|
||||
'table-cell-padding': ['warn', 'padded'],
|
||||
'table-cell-alignment': ['warn'],
|
||||
'table-pipes': ['warn'],
|
||||
'unordered-list-marker-style': ['warn', '*']
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = remarkrc;
|
||||
+28
-6
@@ -1,15 +1,37 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.10
|
||||
before_script:
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash; fi
|
||||
- 4.4
|
||||
before_install:
|
||||
- export CHROME_BIN=/usr/bin/google-chrome
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
after_failure:
|
||||
- npm ls --depth=1
|
||||
after_success:
|
||||
- npm run assets
|
||||
notifications:
|
||||
irc:
|
||||
channels:
|
||||
- "chat.freenode.net#videojs"
|
||||
- chat.freenode.net#videojs
|
||||
use_notice: true
|
||||
on_success: never
|
||||
webhooks:
|
||||
- http://pam.videojs.com/savage/travis
|
||||
slack:
|
||||
secure: LrF8K6mCYWlUt6SvdbGHazyQZSk/opKoiB/wgoGYaGc9+3wYXkVexY0WkO1m6wBKhUqXRAMVMFszr1wqKgdcxtItmFMMj8HqTLI1MVqgKqYX4Ux3CnEHJQiwxIk0aVL7lHLsZTXV/2Y0QIOYmAnCrgy46klETrk0ZuXf5okpu2Q=
|
||||
env:
|
||||
global:
|
||||
- secure: K6JpKwMkfNaJix3Bb0tLjVMzHMJgtBXdd/dvfw1BMb9DCBpd81PqXbDs7yXCddUxnUPTBPxZCrQgWsw71Wn+qEoIG5MU3uOT5A2rBbx/yZonVAGv5ed/9w0xk0OzO383CmPMFqwqtp9YmdmqGjQBkYXVXJjTvNTOAExFSdhO+3U=
|
||||
- secure: GIbhjUJapvC70nIZVlhVyK+3KAD2TVKpiY/q412OO7V2izbvcM1tvU3LBoMZbROzrt5TT84tCoJDvHnrpL0OvxPwrzL5CUU7h4UTxhTOyQkEinbYAnWlW9wdrvtdczsEvANkFPqBZ53B3hVHZHMLOG8QRWaTBicF68vSHEJFqb4=
|
||||
- secure: K6JpKwMkfNaJix3Bb0tLjVMzHMJgtBXdd/dvfw1BMb9DCBpd81PqXbDs7yXCddUxnUPTBPxZCrQgWsw71Wn+qEoIG5MU3uOT5A2rBbx/yZonVAGv5ed/9w0xk0OzO383CmPMFqwqtp9YmdmqGjQBkYXVXJjTvNTOAExFSdhO+3U=
|
||||
- secure: GIbhjUJapvC70nIZVlhVyK+3KAD2TVKpiY/q412OO7V2izbvcM1tvU3LBoMZbROzrt5TT84tCoJDvHnrpL0OvxPwrzL5CUU7h4UTxhTOyQkEinbYAnWlW9wdrvtdczsEvANkFPqBZ53B3hVHZHMLOG8QRWaTBicF68vSHEJFqb4=
|
||||
- secure: gglh7xDnURKfXp9T543DD7NG1pQ8HeWh1XtRspBAwr0H7RqJBVDqqODSYSPRFhfld7M6sYmvQIXgil7XlyefnKNTXqCarvaoTg3lbip8kSltXMiNw2V6AVpsQGuja7+XbaM0do70ETTKjW4Kw6wnxEHb78BvGN/hXIeqizUAjanlDAjd7fouaxpTBIbMESe2rI+WRHPis1cmnv8v70Mrh/8Un/NO4gkebGyvA47LTDNIaVqIVjonsndr8WjMv1/PNxQ8LyCO6D64MufrobS7Sec+VuN30apwEsBw8v82MK/MZ3qXu0lUp4+ERTbuc/rymh2wDFTQeG20Kf/NTauSaH6f414KNzIRFj0/xyLAzVZKIscXM2DKXMuskkZuvHLZvaspnZWcPYTjPZl0P88N0RBqnoLdR80dR5bDljNwU2QnSBeol/q1wXNEr6I1VTRFOB+qsHrD1blVMB1I5W3I0ti1aQ7XtgMOGi1kcPb4oFcJdl+3dLFDnyRyaNfdMOnOZYBBHdQCo19Mj/L+nqPGWeeYiEAM6JsuhNjHn5Za5nGf1ztXTimVPOQjyATin0x9kST3soLWSVmdW2dBHUGDVSMhvoLLR+nKSdNQ0KfpqtgrzeLxoVnRYHVBlih41tapM9IG/6BMYnDMaRcc0i54YeUP4oxlxGSyASIenkAgC6w=
|
||||
- secure: WtIEOSnqDkCZuTlBsxwlVwaRpVTbz7ol8+XSJIZb0aFo1lLisF9cz6s9WrAfX36MaxIcDN9LFZkpXzMvNrNkZWQa1kacGWH1rbx0SiiQ8LMweAcKdnZ5uXlSplBxbJ8bZfXKB1sIHsOsYw/vWhHKkcsDUkAEzQrIiMOhuoUV3s0uKM0knKXIAfNIF0EbDzLIojm+nm+F0n5vM60LRdKesaSt/o2p2LKxdZVoFGrg48D7bdA9VEfMWWRL/evDxJmnX4p+AjBc7mklqZ5F2pYsY6XXQuuS+2Sy+lnxz01kLg+RC4Cpv5dyYfK3h0j8KeyK8IuixycVONWVe9rANq8UaIsMrRN+6uDSC8zXiH4P+h6UDMm3jetc2ZyAfhBA8OyIs5QEShae2Rd7Y3WFJxBp6UVgyj6SkXGxrEdb1ZJgTTl4dyqiP0bYrLePNP2qSJ6OTfNdG791HF077uzXI96ABdMG54Wv9N9T/hmxKwV2Lajx/GZJMmHuwT9tkHKhkcxWea1HYam9QYSFUyJ5THfNk2A9u/r8DkL62MZ85zIQBisrlFjbPAGRejq6qyirBJPAy+FCjhM+oO/i2f2bGkkAfHGT0Og1BcrWVXs54yWdO7UZgie2F+Rmdwinb/GxebZJ+21ZQ4OkVr2t1Skr/PRni9+U7q/6xCLwUJgx45XJ0FE=
|
||||
sudo: false
|
||||
dist: trusty
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
addons:
|
||||
firefox: latest
|
||||
apt:
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
|
||||
+1398
-5
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Our Pledge](#our-pledge)
|
||||
* [Our Standards](#our-standards)
|
||||
* [Our Responsibilities](#our-responsibilities)
|
||||
* [Scope](#scope)
|
||||
* [Other Community Standards](#other-community-standards)
|
||||
* [Enforcement](#enforcement)
|
||||
* [Further Enforcement](#further-enforcement)
|
||||
* [Who Watches the Watchers?](#who-watches-the-watchers)
|
||||
* [Attribution](#attribution)
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
### Other Community Standards
|
||||
|
||||
As a project on GitHub, this project is additionally covered by the [GitHub Community Guidelines](https://help.github.com/articles/github-community-guidelines/).
|
||||
|
||||
Additionally, as a project hosted on npm, is is covered by [npm, Inc's Code of Conduct](https://www.npmjs.com/policies/conduct).
|
||||
|
||||
Enforcement of those guidelines after violations overlapping with the above are the responsibility of the entities, and enforcement may happen in any or all of the services/communities.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at gary@videojs.com or @gkatsev on [slack][]. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
### Further Enforcement
|
||||
|
||||
If you've already followed the [initial enforcement steps](#enforcement), these are the steps maintainers will take for further enforcement, as needed:
|
||||
|
||||
1. Repeat the request to stop.
|
||||
1. If the person doubles down, they will have offending messages removed or edited by a maintainers given an official warning. The PR or Issue may be locked.
|
||||
1. If the behavior continues or is repeated later, the person will be blocked from participating for 24 hours.
|
||||
1. If the behavior continues or is repeated after the temporary block, a long-term (6-12mo) ban will be used.
|
||||
|
||||
On top of this, maintainers may remove any offending messages, images, contributions, etc, as they deem necessary.
|
||||
|
||||
Maintainers reserve full rights to skip any of these steps, at their discretion, if the violation is considered to be a serious and/or immediate threat to the health and well-being of members of the community. These include any threats, serious physical or verbal attacks, and other such behavior that would be completely unacceptable in any social setting that puts our members at risk.
|
||||
|
||||
Members expelled from events or venues with any sort of paid attendance will not be refunded.
|
||||
|
||||
### Who Watches the Watchers?
|
||||
|
||||
Maintainers and other leaders who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. These may include anything from removal from the maintainer team to a permanent ban from the community.
|
||||
|
||||
Additionally, as a project hosted on both GitHub and npm, [their own Codes of Conducts may be applied against maintainers of this project](#other-community-standards), externally of this project's procedures.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
The [Other Community Standards](#other-community-standards), [Further Enforcement](#further-enforcement),
|
||||
and [Who Watches the Watchers?](#who-watches-the-watchers) sections are based on [weallbehave][weallbehave],
|
||||
which is based on the [WeAllJS Code of Conduct][wealljs].
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
|
||||
[wealljs]: https://wealljs.org/code-of-conduct
|
||||
|
||||
[weallbehave]: https://npm.im/weallbehave
|
||||
|
||||
[slack]: http://slack.videojs.com
|
||||
@@ -0,0 +1,448 @@
|
||||
# Collaborator Guide
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Issues and Pull Requests](#issues-and-pull-requests)
|
||||
* [Accepting changes](#accepting-changes)
|
||||
* [Involving the TSC](#involving-the-tsc)
|
||||
* [Landing a PR](#landing-a-pr)
|
||||
* [Landing a PR manually](#landing-a-pr-manually)
|
||||
* [Landing a PR manually with several changes](#landing-a-pr-manually-with-several-changes)
|
||||
* [I just made a mistake](#i-just-made-a-mistake)
|
||||
* [I accidentally pushed a broken commit or incorrect commit to master](#i-accidentally-pushed-a-broken-commit-or-incorrect-commit-to-master)
|
||||
* [I lost changes](#i-lost-changes)
|
||||
* [I accidentally committed a broken change to master](#i-accidentally-committed-a-broken-change-to-master)
|
||||
* [video.js releases](#videojs-releases)
|
||||
* [Getting dependencies](#getting-dependencies)
|
||||
* [Install contrib](#install-contrib)
|
||||
* [npm access](#npm-access)
|
||||
* [GitHub personal access token](#github-personal-access-token)
|
||||
* [Doing a release](#doing-a-release)
|
||||
* [Doc credit](#doc-credit)
|
||||
|
||||
## Issues and Pull Requests
|
||||
|
||||
Full courtesy should always be shown in video.js projects.
|
||||
|
||||
Collaborators may manage issues they feel qualified to handle, being mindful of our guidelines.
|
||||
|
||||
Any issue and PR can be closed if they are not relevant, when in doubt leave it open for more discussion. Issues can always be re-opened if new information is made available.
|
||||
|
||||
If issues or PRs are very short and don't contain much information, ask for more by linking to the [issue][issue template] or [PR][pr template] template. There is also a [response guide](https://github.com/videojs/video.js/wiki/New-Issue-Response-Guide) if you're unsure.
|
||||
|
||||
## Accepting changes
|
||||
|
||||
Any code change in video.js should be happening through Pull Requests on GitHub. This includes core committers.
|
||||
|
||||
Before a PR is merged, it must be reviewed by at least two core committers, at least one if it comes from a core committer.
|
||||
|
||||
Feel free to @-mention a particular core committer if you know they are experts in the area that is being changed.
|
||||
|
||||
If you are unsure about the modification and cannot take responsibility for it, defer to another core committer.
|
||||
|
||||
Before merging the change, it should be left open for other core committers to comment on. At least 24 hours during a weekday, and the 48 hours on a weekend. Trivial changes or bug fixes that have been reviewed by multiple committers may be merged without delay.
|
||||
|
||||
For non-breaking changes, if there is no disagreeming between the collaborators, the PR may be landed assuming it was reviewed. If there is still disagreement, it may need to be [escalated to the TSC](#involving-the-tsc).
|
||||
|
||||
Bug fixes require a test case that fails beforehand and succeeds after. All code changes should contain tests and pass on the CI.
|
||||
|
||||
### Involving the TSC
|
||||
|
||||
A change or issue can be elevated to the TSC by assing the `tsc-agent` label. This should be done in the following scenarios:
|
||||
|
||||
* There will be a major impact on the codebase or project
|
||||
* The change is inherently controversial
|
||||
* No agreement was reached between collaborators participating in the discussion
|
||||
|
||||
The TSC will be the final arbiter when required.
|
||||
|
||||
## Landing a PR
|
||||
|
||||
Landing a PR is fairly easy given that we can use the GitHub UI for it.
|
||||
|
||||
When using the big green button on GitHub, make sure the "squash and merge" is selected -- it should be the only allowed option. If a PR has two features in it and should be merged as two separate commits, either ask the contributor to break it up into two, or follow the [manual steps](#landing-a-pr-manually).
|
||||
|
||||
The commit message should follow our [conventional changelog conventions][conventions]. They are based on the angularjs changelog conventions. The changelog is then generated from these commit messages on release.
|
||||
|
||||
The first line of the commit message -- the header and first text box on GitHub -- should be prefixed with a type and optional scope followed by a short description of the commit.
|
||||
The type is required. Two common ones are `fix` and `feat` for bug fixes and new features. Scope is optional and can be anything.
|
||||
|
||||
The body should contain extra information, potentially copied from the original comment of the PR.
|
||||
|
||||
The footer should contain things like whether this is a breaking change or what issues were fixed by this PR.
|
||||
|
||||
Here's an example:
|
||||
|
||||
```commit
|
||||
fix(html5): a regression with html5 tech
|
||||
|
||||
This is where you'd explain what the regression is.
|
||||
|
||||
Fixes #123
|
||||
```
|
||||
|
||||
### Landing a PR manually
|
||||
|
||||
_Optional:_ ensure you're not in a weird rebase or merge state:
|
||||
|
||||
```sh
|
||||
git am --abort
|
||||
git rebase --abort
|
||||
```
|
||||
|
||||
Checkout and update the master branch:
|
||||
|
||||
```sh
|
||||
git checkout master
|
||||
git remote update
|
||||
git rebase upstream/master
|
||||
```
|
||||
|
||||
Check out the PR:
|
||||
|
||||
```sh
|
||||
git fetch upstream pull/{{PR Number}}/head:{{name of branch}}
|
||||
git checkout -t {{name of branch}}
|
||||
```
|
||||
|
||||
> For example:
|
||||
>
|
||||
> ```sh
|
||||
> git fetch upstream pull/123/head:gkatsev-html5-fix
|
||||
> git checkout -t gkatsev-html5-fix
|
||||
> ```
|
||||
|
||||
_Optional:_ If necessary, rebase against master. If you have multiple features in the PR, [landing a PR manually with several changes](#landing-a-pr-manually-with-several-changes)
|
||||
|
||||
```sh
|
||||
git rebase master
|
||||
```
|
||||
|
||||
Fix up any issues that arise from the rebase, change back to the master branch and squash merge:
|
||||
|
||||
```sh
|
||||
git checkout master
|
||||
git merge --squash --no-commit gkatsev-html5-fix
|
||||
```
|
||||
|
||||
The `--no-commit` tells git not to make a commit on your behalf. It does stage everything for you, so, you can instead it:
|
||||
|
||||
```sh
|
||||
git diff --cached
|
||||
```
|
||||
|
||||
Now get the author from the original commit:
|
||||
|
||||
```sh
|
||||
git log -n 1 --pretty=short gkatsev-html5-fix
|
||||
```
|
||||
|
||||
Which shows:
|
||||
|
||||
```txt
|
||||
commit 433c58224f5be34480c8e067ca6c5406ba1c1e9c
|
||||
Author: Gary Katsevman <git@gkatsev.com>
|
||||
|
||||
Update TOC
|
||||
```
|
||||
|
||||
Now you can commit the change the change with the author, following our commit guidelines
|
||||
|
||||
```sh
|
||||
git commit --author "Gary Katsevman <git@gkatsev.com>"
|
||||
```
|
||||
|
||||
Now that it's committed, push to master
|
||||
|
||||
```sh
|
||||
git push upstream master
|
||||
```
|
||||
|
||||
Congratulate yourself for a job well done and the contributor for having his change landed in master.
|
||||
|
||||
#### Landing a PR manually with several changes
|
||||
|
||||
Follow the same steps as before but when you rebase against master, you want to do an interactive rebase and then squash the changes into just a few commits.
|
||||
|
||||
```sh
|
||||
git rebase -i master
|
||||
```
|
||||
|
||||
This will give you an output like the following:
|
||||
|
||||
```txt
|
||||
pick b4dc15d Update CONTRIBUTING.md with latest info
|
||||
pick 8592149 Add Dev certificate of origin
|
||||
pick 259dee6 Add grunt and doctoc npm scripts
|
||||
pick f12af12 Add conventional-changelog-videojs link
|
||||
pick ae4613a Update node's CONTRIBUTING.md url
|
||||
pick 433c582 Update TOC
|
||||
|
||||
# Rebase f599ef4..433c582 onto f599ef4 (6 command(s))
|
||||
#
|
||||
# Commands:
|
||||
# p, pick = use commit
|
||||
# r, reword = use commit, but edit the commit message
|
||||
# e, edit = use commit, but stop for amending
|
||||
# s, squash = use commit, but meld into previous commit
|
||||
# f, fixup = like "squash", but discard this commit's log message
|
||||
# x, exec = run command (the rest of the line) using shell
|
||||
# d, drop = remove commit
|
||||
#
|
||||
# These lines can be re-ordered; they are executed from top to bottom.
|
||||
#
|
||||
# If you remove a line here THAT COMMIT WILL BE LOST.
|
||||
#
|
||||
# However, if you remove everything, the rebase will be aborted.
|
||||
#
|
||||
# Note that empty commits are commented out
|
||||
```
|
||||
|
||||
Replace `pick` to `fixup` or `edit` depending on how you want the output to look. You can also re-order the commits, if necessary.
|
||||
|
||||
> `fixup` will squash the commit it's infront of up into the commit above it
|
||||
>
|
||||
> `edit` will allow you to edit the commit message before continuing
|
||||
|
||||
```txt
|
||||
edit b4dc15d Update CONTRIBUTING.md with latest info
|
||||
fixup 8592149 Add Dev certificate of origin
|
||||
fixup f12af12 Add conventional-changelog-videojs link
|
||||
fixup ae4613a Update node's CONTRIBUTING.md url
|
||||
fixup 433c582 Update TOC
|
||||
edit 259dee6 Add grunt and doctoc npm scripts
|
||||
```
|
||||
|
||||
When you get to the edit commits, git will give more information, but you'd want to run ammend the current commit while following our commit guidelines
|
||||
|
||||
```sh
|
||||
git commit --amend
|
||||
```
|
||||
|
||||
After going through and making the commits you want, you want to change back to master and then rebase the branch onto master so we get a clean history
|
||||
|
||||
```sh
|
||||
git rebase gkatsev-html5-fix
|
||||
```
|
||||
|
||||
This will put our two commits into master:
|
||||
|
||||
```txt
|
||||
b4dc15d chore(contributing.md): Update CONTRIBUTING.md with latest info <Gary Katsevman>
|
||||
259dee6 chore(package.json): Add grunt and doctoc npm scripts <Gary Katsevman>
|
||||
9e20386 v5.12.6 <Gary Katsevman>
|
||||
```
|
||||
|
||||
Now you're ready to push to master as in the normal instructions.
|
||||
|
||||
#### I just made a mistake
|
||||
|
||||
While `git` allows you to update the remote branch with a force push (`git push -f`). This is generally frowned upon since you're rewriting public history. However, if you just pushed the change and it's been less than 10 minutes since you've done with, you may force push to update the commit, assuming no one else has already pushed after you.
|
||||
|
||||
##### I accidentally pushed a broken commit or incorrect commit to master
|
||||
|
||||
Assuming no more than 10 minutes have passed, you may force-push to update or remove the commit. If someone else has already pushed to master or 10 minutes have passed, you should instead use the revert command (`git revert`) to revert the commit and then commit the proper change, or just fix it forward with a followup commit that fixes things.
|
||||
|
||||
##### I lost changes
|
||||
|
||||
Assuming that the changes were committed, even if you lost the commit in your current history does not mean that it is lost. In a lot of cases you can still recover it from the PR branch or if all else fails look at [git's reflog](https://git-scm.com/docs/git-reflog).
|
||||
|
||||
##### I accidentally committed a broken change to master
|
||||
|
||||
This is a great time to discover that something is broken. Because it hasn't been pushed to GitHub yet, it's very easy to reset the change as if nothing has happened and try again.
|
||||
|
||||
To do so, just reset the branch against master.
|
||||
|
||||
```sh
|
||||
git reset --hard upstream/master
|
||||
```
|
||||
|
||||
## video.js releases
|
||||
|
||||
Releasing video.js is partially automated through various scripts.
|
||||
To do a release, you need a couple of things: npm access, GitHub personal access token.
|
||||
|
||||
Releases in video.js are done on npm and GitHub and eventually posted on the CDN.
|
||||
These are the instructions for the npm/GitHub releases.
|
||||
|
||||
When we do a release, we release it as a `next` tag on npm first and then at least a week later, we promote this release to `latest` on npm.
|
||||
|
||||
### Getting dependencies
|
||||
|
||||
#### npm access
|
||||
|
||||
To see who currently has access run this:
|
||||
|
||||
```sh
|
||||
npm owner ls video.js
|
||||
```
|
||||
|
||||
If you are a core committer, you can request access to npm from one of the current owners.
|
||||
Access is managed via an [npm organization][npm org] for [Video.js][vjs npm].
|
||||
|
||||
#### GitHub personal access token
|
||||
|
||||
This is used to make a GitHub release on videojs. You can get a token from the [personal access tokens](https://github.com/settings/tokens) page.
|
||||
|
||||
After generating one, make sure to keep it safe because GitHub will not show the token for you again. A good place to save it is Lastpass Secure Notes.
|
||||
|
||||
### Deciding what type of version release
|
||||
|
||||
Since we follow the [conventional changelog conventions][conventions],
|
||||
all commits are prepended with a type, most commonly `feat` and `fix`.
|
||||
If all the commits are fix or other types such as `test` or `chore`, then the release will be a `patch` release.
|
||||
If there's even one `feat`, the release will be a `minor` release.
|
||||
If any commit has a `BREAKING CHANGE` footer, then the release will be a `major` release.
|
||||
Most common releases will be either `patch` or `minor`.
|
||||
|
||||
### Doing a release
|
||||
|
||||
It is also recommended you have a clean clone of Video.js for each release line you want to release.
|
||||
That means having a folder for master/v6 and one for 5.x.
|
||||
This is because 5.x and 6.x have different versions expecations for release process and have different dependencies.
|
||||
Plus, during development you could end up with a dirty repo, so, it just usually easier if you have a clean release repo.
|
||||
|
||||
```sh
|
||||
# for v6
|
||||
git clone git@github.com:videojs/video.js.git videojs-6-release
|
||||
# for v5
|
||||
git clone git@github.com:videojs/video.js.git videojs-5-release
|
||||
```
|
||||
|
||||
#### Video.js 6
|
||||
|
||||
Make sure go to the master branch and grab the latest updates.
|
||||
|
||||
```sh
|
||||
git checkout master
|
||||
git pull origin master
|
||||
```
|
||||
|
||||
At this point, you should run `npm install` because dependencies may have changed.
|
||||
|
||||
Then, it's mostly a standard npm package release process with running `npm version`, followed by an `npm publish`.
|
||||
|
||||
```sh
|
||||
npm version {major|minor|patch}
|
||||
```
|
||||
|
||||
Depending on the commits that have been merged, you can choose from `major`, `minor`, or `patch` as the versioning values.
|
||||
See [deciding what type of version release section](#deciding-what-type-of-version-release).
|
||||
|
||||
Optionally, you can run `git show` now to verify that the version update and CHANGELOG automation worked as expected.
|
||||
|
||||
Afterwards, you want to push the commit and the tag to the repo.
|
||||
It's necessary to do this before running `npm publish` because our GitHub release automation
|
||||
relies on the commit being available on GitHub.
|
||||
|
||||
```sh
|
||||
git push --tags origin master
|
||||
```
|
||||
|
||||
Finally, run `npm publish` with an appropriate tag. Don't forget to supply your token.
|
||||
|
||||
```sh
|
||||
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=my-personal-access-token npm publish --tag next
|
||||
```
|
||||
|
||||
After it's done, verify that the GitHub release has the correct changelog output.
|
||||
This is to make sure that the CHANGELOG didn't get garbled and isn't missing pieces.
|
||||
|
||||
If the GitHub release did not work correctly, such as if the GitHub token was not provided,
|
||||
you can run it manually:
|
||||
|
||||
```sh
|
||||
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=123 node build/gh-release.js --prelease
|
||||
```
|
||||
|
||||
#### Video.js 5
|
||||
|
||||
Make sure to go to the 5.x branch and grab the latest updates.
|
||||
|
||||
```sh
|
||||
git checkout 5.x
|
||||
git pull origin 5.x
|
||||
```
|
||||
|
||||
> *Note:* you probably need to delete v6 tags due to the way that the our CHANGELOG lib works.
|
||||
>
|
||||
> You can run this to delete them:
|
||||
> ```sh
|
||||
> git tag | grep '^v6' | xargs git tag -d
|
||||
> ```
|
||||
> This will find all tags that start with `^v6` and delete them.
|
||||
|
||||
At this point, you should run `npm install` because dependencies may have changed.
|
||||
|
||||
Then, we have a script that automates most of the steps for publishing. It's a little trickier than publishing v6.
|
||||
|
||||
##### Edit git-semver-tags
|
||||
|
||||
You'll need to edit `git-semver-tags` to support our usage of tags that are not part of the branch.
|
||||
In the file `node_modules/conventional-changelog-cli/node_modules/conventional-changelog/node_modules/conventional-changelog-core/node_modules/git-semver-tags/index.js`, edit the line that says sets the `cmd` to be:
|
||||
```js
|
||||
var cmd = 'git log --all --date-order --decorate --no-color';
|
||||
```
|
||||
|
||||
#### And now for the release
|
||||
|
||||
After getting rid of the tags and getting the latest updates, you can just run the release script:
|
||||
|
||||
```sh
|
||||
VJS_GITHUB_USER=gkatsev VJS_GITHUB_TOKEN=123 ./build/bin/release-next.sh
|
||||
```
|
||||
|
||||
It will prompt you for a version change type, so, input `patch` or `minor` or `major`.
|
||||
See [deciding what type of version release section](#deciding-what-type-of-version-release).
|
||||
|
||||
When it's done building everything, it'll show you the commit that's made via the default pager (i.e., less).
|
||||
At this point you can verify that things look normal rather than, for example, missing all the CSS.
|
||||
|
||||
After exiting the pager, it'll make sure you want to continue with publishing.
|
||||
|
||||
It will automatically release it as a `next-5` tag on npm.
|
||||
|
||||
Then push the local changes up:
|
||||
|
||||
```sh
|
||||
git push --tags origin 5.x
|
||||
```
|
||||
|
||||
Also, you'll need to copy the CHANGELOG for this version and manually edit the GitHub release to include it.
|
||||
The current release's CHANGELOG could be copied from the [raw CHANGELOG.md file][raw chg] (or locally from the markdown file)
|
||||
and then pasted into the correct [GitHub release](https://github.com/videojs/video.js/releases).
|
||||
|
||||
### Deploy as a patch to the CDN
|
||||
|
||||
Follow the steps on the [CDN repo][] for the CDN release process.
|
||||
If it's a `next` or `next-5` release, only publish the patch version to the CDN.
|
||||
|
||||
When the version gets promoted to `latest` or `latest-5`, the corresponding `minor` or `latest` version should be published to the CDN.
|
||||
|
||||
### Announcement
|
||||
|
||||
An announcement should automatically make it's way to #announcements channel on [slack][], it uses IFTTT and might take a while.
|
||||
|
||||
You can also post it to twitter or ask someone (like @gkatsev) to post on your behalf.
|
||||
|
||||
If it's a large enough release, consider writing a blog post as well.
|
||||
|
||||
## Doc credit
|
||||
|
||||
This collaborator guide was heavily inspired by [node.js's guide](https://github.com/nodejs/node/blob/master/COLLABORATOR_GUIDE.md)
|
||||
|
||||
[issue template]: /.github/ISSUE_TEMPLATE.md
|
||||
|
||||
[pr template]: /.github/PULL_REQUEST_TEMPLATE.md
|
||||
|
||||
[conventions]: https://github.com/videojs/conventional-changelog-videojs/blob/master/convention.md
|
||||
|
||||
[vjs npm]: http://npmjs.com/org/videojs
|
||||
|
||||
[npm org]: https://docs.npmjs.com/misc/orgs
|
||||
|
||||
[slack]: http://slack.videojs.com
|
||||
|
||||
[CDN repo]: https://github.com/videojs/cdn
|
||||
|
||||
[raw chg]: https://raw.githubusercontent.com/videojs/video.js/5.x/CHANGELOG.md
|
||||
+218
-161
@@ -1,139 +1,136 @@
|
||||
CONTRIBUTING
|
||||
============
|
||||
# CONTRIBUTING
|
||||
|
||||
So you want to help out? Great! There's a number of ways you can get involved.
|
||||
|
||||
* [File and discuss issues](#filing-issues)
|
||||
* [Contribute code](#contributing-code)
|
||||
* [Build and share plugins](docs/guides/plugins.md)
|
||||
* [Answer questions on Stack Overflow](http://stackoverflow.com/questions/tagged/video.js)
|
||||
## Table of Contents
|
||||
|
||||
* [Other repositories where issues could be filed](#other-repositories-where-issues-could-be-filed)
|
||||
* [Filing issues](#filing-issues)
|
||||
* [Reporting a Bug](#reporting-a-bug)
|
||||
* [Requesting a Feature](#requesting-a-feature)
|
||||
* [Contributing code](#contributing-code)
|
||||
* [Building video.js locally](#building-videojs-locally)
|
||||
* [Forking and cloning the repository](#forking-and-cloning-the-repository)
|
||||
* [Installing local dependencies](#installing-local-dependencies)
|
||||
* [Running tests](#running-tests)
|
||||
* [Building videojs](#building-videojs)
|
||||
* [Testing Locally](#testing-locally)
|
||||
* [Sandbox test directory](#sandbox-test-directory)
|
||||
* [Running a local web server](#running-a-local-web-server)
|
||||
* [Watching source and test changes](#watching-source-and-test-changes)
|
||||
* [Making Changes](#making-changes)
|
||||
* [Step 1: Verify](#step-1-verify)
|
||||
* [Step 2: Update remote](#step-2-update-remote)
|
||||
* [Step 3: Branch](#step-3-branch)
|
||||
* [Step 4: Commit](#step-4-commit)
|
||||
* [Step 5: Test](#step-5-test)
|
||||
* [Step 6: Push](#step-6-push)
|
||||
* [Code Style Guide](#code-style-guide)
|
||||
* [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11)
|
||||
* [Doc Credit](#doc-credit)
|
||||
|
||||
## Other repositories where issues could be filed
|
||||
|
||||
There's also other Video.js projects where you can help. (check the [video.js org](https://github.com/videojs) for an up-to-date list of projects)
|
||||
|
||||
* [Videojs.com](https://github.com/videojs/videojs.com)
|
||||
* [Video.js flash player](https://github.com/videojs/video-js-swf)
|
||||
* [Player skin designer](https://github.com/videojs/designer)
|
||||
* [Contribflow](https://github.com/zencoder/contribflow)
|
||||
* [Videojs.com](https://github.com/videojs/videojs.com)
|
||||
* [Video.js flash player](https://github.com/videojs/videojs-flash)
|
||||
* [HLS](https://github.com/videojs/videojs-contrib-hls)
|
||||
* [DASH](https://github.com/videojs/videojs-contrib-dash)
|
||||
* [Youtube Tech](https://github.com/videojs/videojs-youtube)
|
||||
* [Vimeo Tech](https://github.com/videojs/videojs-vimeo)
|
||||
* [Ads](https://github.com/videojs/videojs-contrib-ads)
|
||||
* [Plugin generator](https://github.com/videojs/generator-videojs-plugin)
|
||||
* [Linter][linter]
|
||||
|
||||
## Filing issues
|
||||
|
||||
Filing issues
|
||||
-------------
|
||||
[GitHub Issues](https://github.com/videojs/video.js/issues) are used for all discussions around the codebase, including **bugs**, **features**, and other **enhancements**.
|
||||
|
||||
When filling out an issue, make sure to fill out the questions in the
|
||||
|
||||
### Reporting a Bug
|
||||
|
||||
**A bug is a demonstrable problem** that is caused by the code in the repository. Good bug reports are extremely helpful. Thank You!
|
||||
|
||||
Guidelines for bug reports:
|
||||
|
||||
1. Use the [GitHub issue search](https://github.com/videojs/video.js/issues) — check if the issue has already been reported.
|
||||
|
||||
2. Check if the issue has already been fixed — try to reproduce it using the latest `master` branch in the repository.
|
||||
|
||||
3. Isolate the problem — **create a [reduced test case](http://css-tricks.com/6263-reduced-test-cases/)** with a live example. You can possibly use [this JSBin example](http://jsbin.com/axedog/7/edit) as a starting point.
|
||||
1. If your issue is with a particular video.js plugin or subproject, please open an issue against that project. See [list of some potential other projects above](#other-repositories-where-issues-could-be-filed)
|
||||
1. Use the [GitHub issue search](https://github.com/videojs/video.js/issues) — check if the issue has already been reported.
|
||||
1. Check if the issue has already been fixed — try to reproduce it using the latest `master` branch in the repository.
|
||||
1. Isolate the problem — **create a [reduced test case](https://css-tricks.com/reduced-test-cases/)** with a live example. You can possibly use [this JSBin example](http://jsbin.com/axedog/edit) as a starting point -- don't forget to update it to the videojs version you use.
|
||||
1. Answer all questions in the [issue template][]. The questions in the issue template are designed to try and provide the maintainers with as much information possible to minimize back-and-forth to get the issue resolved.
|
||||
|
||||
A good bug report should be as detailed as possible, so that others won't have to follow up for the essential details.
|
||||
|
||||
Here's an example:
|
||||
|
||||
> Short yet concise Bug Summary
|
||||
>
|
||||
> Description:
|
||||
> Happens on Windows 7 and OSX. Seen with IE9, Firefox 19 OSX, Chrome 21, Flash 11.6 and 11.2
|
||||
>
|
||||
> 1. This is the first step
|
||||
> 2. This is the second step
|
||||
> 3. Further steps, etc.
|
||||
>
|
||||
> Expected:
|
||||
> (describe the expected outcome of the steps above)
|
||||
>
|
||||
> Actual:
|
||||
> (describe what actually happens)
|
||||
>
|
||||
> `<url>` (a link to the reduced test case, if it exists)
|
||||
>
|
||||
> Any other information you want to share that is relevant to the issue being
|
||||
> reported. This might include the lines of code that you have identified as
|
||||
> causing the bug, and potential solutions (and your opinions on their
|
||||
> merits).
|
||||
|
||||
**[File a bug report](https://github.com/videojs/video.js/issues/new)**
|
||||
|
||||
### Requesting a Feature
|
||||
|
||||
1. [Check the plugin list](https://github.com/videojs/video.js/wiki/Plugins) for any plugins that may already support the feature.
|
||||
|
||||
2. [Search the issues](https://github.com/videojs/video.js/issues) for any previous requests for the same feature, and give a thumbs up or +1 on existing requests.
|
||||
|
||||
2. If no previous requests exist, create a new issue. Please be as clear as possible about why the feautre is needed and the intended use case.
|
||||
1. [Check the plugin list](http://videojs.com/plugins/) for any plugins that may already support the feature.
|
||||
1. [Search the issues](https://github.com/videojs/video.js/issues) for any previous requests for the same feature, and give a thumbs up or +1 on existing requests.
|
||||
1. If no previous requests exist, create a new issue. Please be as clear as possible about why the feautre is needed and the intended use case.
|
||||
1. Once again, be as details as possible and follow the [issue template][]
|
||||
|
||||
**[Request a feature](https://github.com/videojs/video.js/issues/new)**
|
||||
|
||||
Contributing code
|
||||
-----------------
|
||||
## Contributing code
|
||||
|
||||
To contibute code you'll need to be able to build a copy of Video.js and run tests locally. There are a few requirements before getting started.
|
||||
|
||||
- Node.js -- Video.js uses Node for build and test automation. Node is available for Windows, Mac OS X, Linux, and SunOS, as well as source code if that doesn't scare you. [Download and install Node.js](http://nodejs.org/download/)
|
||||
* Node.js
|
||||
Video.js uses Node for build and test automation. Node is available for Windows, Mac OS X, Linux, and SunOS, as well as source code if that doesn't scare you. [Download and install Node.js](http://nodejs.org/download/)
|
||||
|
||||
- grunt-cli -- Install grunt-cli globally so that you will have the correct version of grunt available for any project that needs it.
|
||||
* `grunt-cli`
|
||||
Optionally, install `grunt-cli` globally to use grunt directly. It can always be run via an npm script:
|
||||
|
||||
On Unix-based systems, you'll have to do this as a superuser:
|
||||
|
||||
```bash
|
||||
sudo npm install -g grunt-cli
|
||||
```sh
|
||||
npm run grunt
|
||||
```
|
||||
On Windows, you can just run:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
npm install -g grunt-cli
|
||||
```
|
||||
|
||||
- Contribflow -- A homegrown git workflow tool for managing feature/hotfix branches and submitting pull requests. If you have your own preferred git workflow, contribflow isn't required, but the following instructions will assume you're using it.
|
||||
Depending on how you have node and npm set up, you may need to run the global install (`-g`) as a superuser by prepending `sudo`.
|
||||
|
||||
On Unix-based systems, you'll have to do this as a superuser:
|
||||
### Building video.js locally
|
||||
|
||||
```bash
|
||||
sudo npm install -g contribflow
|
||||
```
|
||||
#### Forking and cloning the repository
|
||||
|
||||
On Windows, you can just run:
|
||||
|
||||
```bash
|
||||
npm install -g contribflow
|
||||
```
|
||||
|
||||
### Building your own copy of Video.js
|
||||
|
||||
First, [fork](http://help.github.com/fork-a-repo/) the video.js git repository. At the top of every github page, there is a Fork button. Click it, and the forking process will copy Video.js into your own GitHub account.
|
||||
First, [fork](http://help.github.com/fork-a-repo/) the video.js git repository. At the top of every GitHub page, there is a Fork button. Click it, and the forking process will copy Video.js into your own GitHub account.
|
||||
|
||||
Clone your fork of the repo into your code directory
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git clone https://github.com/<your-username>/video.js.git
|
||||
```
|
||||
|
||||
Navigate to the newly cloned directory
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cd video.js
|
||||
```
|
||||
|
||||
Assign the original repo to a remote called "upstream"
|
||||
|
||||
```
|
||||
```sh
|
||||
git remote add upstream https://github.com/videojs/video.js.git
|
||||
```
|
||||
|
||||
>In the future, if you want to pull in updates to video.js that happened after you cloned the main repo, you can run:
|
||||
> In the future, if you want to pull in updates to video.js that happened after you cloned the main repo, you can run:
|
||||
>
|
||||
> ```bash
|
||||
> ```sh
|
||||
> git remote update
|
||||
> git checkout master
|
||||
> git pull upstream master
|
||||
> ```
|
||||
|
||||
#### Installing local dependencies
|
||||
|
||||
Install the required node.js modules using node package manager
|
||||
|
||||
```bash
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
@@ -141,135 +138,195 @@ npm install
|
||||
> `npm config set color false`
|
||||
> Note that this change takes effect when a new command prompt window is opened; the current window will not be affected.
|
||||
|
||||
Build a local copy of video.js and run tests
|
||||
#### Running tests
|
||||
|
||||
```bash
|
||||
grunt
|
||||
grunt test
|
||||
Tests can be run either from the shell or from the browser.
|
||||
|
||||
To run the tests from the shell, just run
|
||||
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
Video.js is also configured to run tests with Karma. Karma is installed as a grunt plugin to run QUnit tests in real browsers, as opposed to simply running the tests in phantomjs, a headless browser. To run the tests with Karma:
|
||||
This will build video.js locally and run the test suite using [Karma](https://karma-runner.github.io/1.0/index.html), which runs our tests in actual browsers.
|
||||
|
||||
```bash
|
||||
grunt karma:dev
|
||||
To run tests from the browser, first start a local server with `npm start` (this also watches for changes and rebuilds video.js and the test files as necessary). Then navigate to `http://localhost:9999/test`, and you'll see a page that displays the results of all the tests. To rerun the tests after making changes, just refresh the page. To run an individual test, click the "Rerun" link next to the test's title.
|
||||
|
||||
#### Building videojs
|
||||
|
||||
To build video.js, simply run
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
At this point you should have a built copy of video.js in a directory named `dist`, and all tests should be passing.
|
||||
This outputs an `es5/` and `dist/` folder. The `es5/` folder is used by bundling tools like browserify and webpack to package video.js into projects. The `dist/` folder has pre-compiled versions of video.js, including a minified version and the CSS file. This file can be included in page via a `<script></script>` tag.
|
||||
|
||||
### Making Changes
|
||||
#### Testing Locally
|
||||
|
||||
Whether you're adding something new, making something better, or fixing a bug, you'll first want to search the [GitHub issues](https://github.com/videojs/video.js/issues) and [plugins list](https://github.com/videojs/video.js/wiki/Plugins) to make sure you're aware of any previous discussion or work. If an unclaimed issue exists, claim it via a comment. If no issue exists for your change, submit one, follwing the [issue filing guidelines](#filing-issues).
|
||||
Besides running automated tests, you often want to run video.js manually and play around with things as you're developing. A few things are provided to make it easier.
|
||||
|
||||
There are two categories of changes in video.js land, features and hotfixes (Video.js follows a branching model similar to [gitflow](http://nvie.com/posts/a-successful-git-branching-model/)). Hotfixes are for urgent fixes that need to be released immediately as a patch. Features are for everything else (including non-urgent fixes). If you think you have a hotfix scenario, verify that (via comment) before starting the work. We'll focus on features here, but you can swap `hotfix` for `feature` in any command.
|
||||
#### Sandbox test directory
|
||||
|
||||
Start a new development branch
|
||||
There's a sandbox directory where you can add any file and it won't get tracked in git. To start you can copy the example index file.
|
||||
|
||||
```bash
|
||||
contrib feature start
|
||||
```
|
||||
|
||||
You'll be prompted to name the branch. After that, contrib will create the branch locally, and use git to push it up to your origin, and track it. You're now ready to start building your feature or fixing that bug! Be sure to read the [Code Style Guide](#code-style-guide).
|
||||
|
||||
While you're developing, you can ensure your changes are working by writing tests (in the `test` directory) and running `grunt test`.
|
||||
|
||||
There's also a sandbox directory where you can add any file and it won't get tracked as a change. To start you can copy the example index file and see a working version of a player (using the local source code) by loading it in a browser.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cp sandbox/index.html.example sandbox/index.html
|
||||
open sandbox/index.html
|
||||
```
|
||||
|
||||
See [the following section](#running-a-local-web-server) for how to open the page in a browser.
|
||||
|
||||
### Testing Locally
|
||||
A simple Connect server is available via the Grunt plugin. The commands below will allow you to setup a test sandbox and begin development.
|
||||
#### Running a local web server
|
||||
|
||||
```bash
|
||||
cp sandbox/index.html.example sandbox/index.html
|
||||
This ties in nicely with the sandbox directory. You can always open the `sandbox/index.html` file directly but in some cases it may not work properly.
|
||||
|
||||
> Flash files (`.swf`) that are local and loaded into a locally accessed page (file:///) will NOT run.
|
||||
> To get around this you must use a local web server.
|
||||
|
||||
To run the local webserver, you can run it in a couple of ways.
|
||||
|
||||
```sh
|
||||
grunt connect
|
||||
open http://localhost:9999/sandbox/index.html
|
||||
```
|
||||
|
||||
> NOTES regarding local testing in Chrome 21+ (as of 2013/01/01)
|
||||
> Flash files that are local and loaded into a locally accessed page (file:///) will NOT run.
|
||||
> To get around this you can do either of the following:
|
||||
>
|
||||
> 1. Do your development and testing using a local HTTP server. See Grunt commands above.
|
||||
>
|
||||
> 2. [Disable the version of Flash included with Chrome](http://helpx.adobe.com/flash-player/kb/flash-player-google-chrome.html#How_can_I_run_debugger_or_alternate_versions_of_Flash_Player_in_Google_Chrome) and enable a system-wide version of Flash instead.
|
||||
or
|
||||
|
||||
Commit and push changes as you go (using git directly). Write thorough descriptions of your changes in your commit messages.
|
||||
|
||||
```bash
|
||||
git add .
|
||||
git commit -av
|
||||
git push
|
||||
```sh
|
||||
npm start
|
||||
```
|
||||
|
||||
> GitHub allows you to close an issue through your commit message using the [fixes](https://github.com/blog/831-issues-2-0-the-next-generation) keyword.
|
||||
The latter does some extra work which will be described in the next section.
|
||||
|
||||
#### Watching source and test changes
|
||||
|
||||
As you're developing, you want the build to re-run and update itself, and potentially re-run the tests. In addition, you want to launch a local web-server that you can open the `sandbox` directory in.
|
||||
To do so, you just need to run
|
||||
|
||||
```sh
|
||||
npm start
|
||||
```
|
||||
|
||||
This sets up the local webserver using connect and then watches source files, test files, and CSS files for you and rebuilds things as they happen.
|
||||
|
||||
### Making Changes
|
||||
|
||||
#### Step 1: Verify
|
||||
|
||||
Whether you're adding something new, making something better, or fixing a bug, you'll first want to search the [GitHub issues](https://github.com/videojs/video.js/issues) and [plugins list](https://github.com/videojs/video.js/wiki/Plugins) to make sure you're aware of any previous discussion or work. If an unclaimed issue exists, claim it via a comment. If no issue exists for your change, submit one, follwing the [issue filing guidelines](#filing-issues).
|
||||
|
||||
#### Step 2: Update remote
|
||||
|
||||
Before starting work, you want to update your local repository to have all the latest changes.
|
||||
|
||||
```sh
|
||||
git remote update
|
||||
git checkout master
|
||||
git rebase upstream/master
|
||||
```
|
||||
|
||||
#### Step 3: Branch
|
||||
|
||||
You want to do your work in a separate branch.
|
||||
|
||||
```sh
|
||||
git checkout -b my-branch
|
||||
```
|
||||
|
||||
#### Step 4: Commit
|
||||
|
||||
Commit changes as you go. Write thorough descriptions of your changes in your commit messages.
|
||||
For more information see our [conventional changelog guidelines for video.js](https://github.com/videojs/conventional-changelog-videojs/blob/master/convention.md)
|
||||
Follow these guidelines:
|
||||
|
||||
1. The first line should be less than 50 characters and contain a short description of the commit.
|
||||
1. The body should contain a more detailed description. It can contain things like reasoning for the change and specifics of what changed.
|
||||
1. A footer can be added if this fixes a particular issue on GitHub.
|
||||
|
||||
```sh
|
||||
git add src/js/player.js
|
||||
git commit
|
||||
```
|
||||
|
||||
An example of the first line of a commit message: `fix: changed the footer to correctly display foo`
|
||||
|
||||
In the body of the commit message, we can talk about why we made the change. What the change entails.
|
||||
Any testing considerations or things to think about when looking at the commit. For Example:
|
||||
|
||||
```txt
|
||||
fix: one line commit explanation
|
||||
|
||||
In the body of the commit message, we can talk about why we made the change. What the change entails.
|
||||
|
||||
Any testing considerations or things to think about when looking at the commit.
|
||||
|
||||
Fixes #123. The footer can contain Fixes messages.
|
||||
```
|
||||
|
||||
> Make sure that git knows your name and email:
|
||||
>
|
||||
> ```bash
|
||||
> My commit message. fixes #123
|
||||
> Testing: (briefly describe any testing here, for example, 'unit tests and cross-browser manual tests around playback and network interruption')
|
||||
> ```sh
|
||||
> git config --global user.name "Random User"
|
||||
> git config --global user.email "random.user@example.com"
|
||||
> ```
|
||||
|
||||
### Submitting your changes
|
||||
#### Step 5: Test
|
||||
|
||||
First, thoroughly test your feature or fix, including writing tests to make sure your change doesn't get regressed in a future update. If you're fixing a bug, we recommend in addition to testing the fix itself, to do some testing around the areas that your fix has touched. For example, a brief smoketest of the player never hurts.
|
||||
Any code change should come with corresponding test changes. Especially bug fixes.
|
||||
Tests attached to bug fixes should fail before the change and succeed with it.
|
||||
|
||||
Make sure your changes are pushed to origin
|
||||
|
||||
```bash
|
||||
git push
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
Use contrib to submit a a pull request (make sure you're in your feature branch)
|
||||
See [Running tests](#running-tests) for more information.
|
||||
|
||||
```bash
|
||||
contrib feature submit
|
||||
#### Step 6: Push
|
||||
|
||||
```sh
|
||||
git push origin my-branch
|
||||
```
|
||||
|
||||
You'll be prompted for title and description for the Pull Request. After that, contrib will use Git to submit your pull request to video.js.
|
||||
Then go to the [repo page](http://github.com/videojs/video.js) and click the "Pull Request" button and fill out the [pull request template](/.github/PULL_REQUEST_TEMPLATE.md)
|
||||
|
||||
You're Done! (except for cleanup.) To clean up your feature or hotfix branch:
|
||||
### Code Style Guide
|
||||
|
||||
First, checkout your feature or issue branch:
|
||||
Our javascript is linted using [videojs-standard][linter].
|
||||
|
||||
```bash
|
||||
git checkout (branchname)
|
||||
```
|
||||
## [Developer's Certificate of Origin 1.1](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#developers-certificate-of-origin-11)
|
||||
|
||||
Run this command to clean up your feature:
|
||||
By making a contribution to this project, I certify that:
|
||||
|
||||
```bash
|
||||
contrib feature delete
|
||||
```
|
||||
* (a) The contribution was created in whole or in part by me and I
|
||||
have the right to submit it under the open source license
|
||||
indicated in the file; or
|
||||
|
||||
Run this command to clean up your bug fix:
|
||||
* (b) The contribution is based upon previous work that, to the best
|
||||
of my knowledge, is covered under an appropriate open source
|
||||
license and I have the right under that license to submit that
|
||||
work with modifications, whether created in whole or in part
|
||||
by me, under the same open source license (unless I am
|
||||
permitted to submit under a different license), as indicated
|
||||
in the file; or
|
||||
|
||||
```bash
|
||||
contrib hotfix delete
|
||||
```
|
||||
> PLEASE NOTE: THIS WILL DELETE YOUR LOCAL AND REMOTE COPIES OF THE FEATURE.
|
||||
> This is meant to clean up your local and remote branches, so make sure any changes you don't want to lose have been pulled into the parent project or another branch first.
|
||||
* (c) The contribution was provided directly to me by some other
|
||||
person who certified (a), (b) or (c) and I have not modified
|
||||
it.
|
||||
|
||||
Code Style Guide
|
||||
----------------
|
||||
Please follow [Google's JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) to the letter. If your editor supports [.editorconfig](http://editorconfig.org/#download) it will make it easier to manage differences from your own coding style.
|
||||
* (d) I understand and agree that this project and the contribution
|
||||
are public and that a record of the contribution (including all
|
||||
personal information I submit with it, including my sign-off) is
|
||||
maintained indefinitely and may be redistributed consistent with
|
||||
this project or the open source license(s) involved.
|
||||
|
||||
### Style examples include:
|
||||
* Two space indents.
|
||||
* Delimit strings with single-quotes `'`, not double-quotes `"`.
|
||||
* No trailing whitespace, except in markdown files where a linebreak must be forced.
|
||||
* No more than [one assignment](http://benalman.com/news/2012/05/multiple-var-statements-javascript/) per `var` statement.
|
||||
* Prefer `if` and `else` to ["clever"](http://programmers.stackexchange.com/a/25281) uses of `? :` conditional or `||`, `&&` logical operators.
|
||||
* **When in doubt, follow the conventions you see used in the source already.**
|
||||
## Doc Credit
|
||||
|
||||
If you happen to find something in the codebase that does not follow the style guide, that's a good opportunity to make your first contribution!
|
||||
|
||||
---
|
||||
### Doc Credit
|
||||
This doc was inspired by some great contribution guide examples including [contribute.md template](https://github.com/contribute-md/contribute-md-template),
|
||||
[grunt](https://github.com/gruntjs/grunt/wiki/Contributing),
|
||||
[html5 boilerplate](https://github.com/h5bp/html5-boilerplate/blob/master/CONTRIBUTING.md),
|
||||
[jquery](https://github.com/jquery/jquery/blob/master/CONTRIBUTING.md),
|
||||
and [node.js](https://github.com/joyent/node/wiki/Contributing).
|
||||
and [node.js](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md).
|
||||
|
||||
[issue template]: /.github/ISSUE_TEMPLATE.md
|
||||
|
||||
[linter]: https://github.com/videojs/standard
|
||||
|
||||
+5
-676
@@ -1,678 +1,7 @@
|
||||
require('babel-register');
|
||||
|
||||
// Need to `require` a separate Grunt file so we can use ES6 syntax via
|
||||
// Babel's require hook.
|
||||
module.exports = function(grunt) {
|
||||
var pkg, s3, semver, version, verParts, uglify, exec;
|
||||
|
||||
semver = require('semver');
|
||||
pkg = grunt.file.readJSON('package.json');
|
||||
uglify = require('uglify-js');
|
||||
exec = require('child_process').exec;
|
||||
|
||||
try {
|
||||
s3 = grunt.file.readJSON('.s3config.json');
|
||||
} catch(e) {
|
||||
s3 = {};
|
||||
}
|
||||
|
||||
verParts = pkg.version.split('.');
|
||||
version = {
|
||||
full: pkg.version,
|
||||
major: verParts[0],
|
||||
minor: verParts[1],
|
||||
patch: verParts[2]
|
||||
};
|
||||
version.majorMinor = version.major + '.' + version.minor;
|
||||
|
||||
// loading predefined source order from source-loader.js
|
||||
// trust me, this is the easist way to do it so far
|
||||
/*jshint undef:false, evil:true */
|
||||
var blockSourceLoading = true;
|
||||
var sourceFiles; // Needed to satisfy jshint
|
||||
eval(grunt.file.read('./build/source-loader.js'));
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: pkg,
|
||||
build: {
|
||||
src: 'src/js/dependencies.js',
|
||||
options: {
|
||||
baseDir: 'src/js/'
|
||||
}
|
||||
},
|
||||
clean: {
|
||||
build: ['build/files/*'],
|
||||
dist: ['dist/*']
|
||||
},
|
||||
jshint: {
|
||||
src: {
|
||||
src: ['src/js/*.js', 'Gruntfile.js', 'test/unit/*.js'],
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
}
|
||||
}
|
||||
},
|
||||
minify: {
|
||||
source:{
|
||||
src: ['build/files/combined.video.js', 'build/compiler/goog.base.js', 'src/js/exports.js'],
|
||||
externs: ['src/js/player.externs.js', 'src/js/media/flash.externs.js'],
|
||||
dest: 'build/files/minified.video.js'
|
||||
},
|
||||
tests: {
|
||||
src: ['build/files/combined.video.js', 'build/compiler/goog.base.js', 'src/js/exports.js', 'test/unit/*.js'],
|
||||
externs: ['src/js/player.externs.js', 'src/js/media/flash.externs.js', 'test/qunit-externs.js', 'test/sinon-externs.js'],
|
||||
dest: 'build/files/test.minified.video.js'
|
||||
}
|
||||
},
|
||||
dist: {},
|
||||
qunit: {
|
||||
source: ['test/index.html'],
|
||||
minified: ['test/minified.html'],
|
||||
minified_api: ['test/minified-api.html']
|
||||
},
|
||||
watch: {
|
||||
files: [ 'src/**/*', 'test/unit/*.js', 'Gruntfile.js' ],
|
||||
tasks: 'dev'
|
||||
},
|
||||
connect: {
|
||||
dev: {
|
||||
options: {
|
||||
port: 9999,
|
||||
keepalive: true
|
||||
}
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
minor: {
|
||||
files: [
|
||||
{expand: true, cwd: 'build/files/', src: ['*'], dest: 'dist/'+version.majorMinor+'/', filter: 'isFile'} // includes files in path
|
||||
]
|
||||
},
|
||||
patch: {
|
||||
files: [
|
||||
{expand: true, cwd: 'build/files/', src: ['*'], dest: 'dist/'+version.full+'/', filter: 'isFile'} // includes files in path
|
||||
]
|
||||
}
|
||||
},
|
||||
s3: {
|
||||
options: s3,
|
||||
minor: {
|
||||
upload: [
|
||||
{
|
||||
src: 'dist/cdn/*',
|
||||
dest: 'vjs/'+version.majorMinor+'/',
|
||||
rel: 'dist/cdn/',
|
||||
headers: {
|
||||
'Cache-Control': 'public, max-age=2628000'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
patch: {
|
||||
upload: [
|
||||
{
|
||||
src: 'dist/cdn/*',
|
||||
dest: 'vjs/'+version.full+'/',
|
||||
rel: 'dist/cdn/',
|
||||
headers: {
|
||||
'Cache-Control': 'public, max-age=31536000'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
minify: {
|
||||
expand: true,
|
||||
cwd: 'build/files/',
|
||||
src: ['video-js.css'],
|
||||
dest: 'build/files/',
|
||||
ext: '.min.css'
|
||||
}
|
||||
},
|
||||
less: {
|
||||
dev: {
|
||||
files: {
|
||||
'build/files/video-js.css': 'src/css/video-js.less'
|
||||
}
|
||||
}
|
||||
},
|
||||
karma: {
|
||||
// this config file applies to all following configs except if overwritten
|
||||
options: {
|
||||
configFile: 'test/karma.conf.js'
|
||||
},
|
||||
|
||||
// this only runs on PRs from the mainrepo on saucelabs
|
||||
saucelabs: {
|
||||
browsers: ['chrome_sl']
|
||||
},
|
||||
chrome_sl: {
|
||||
browsers: ['chrome_sl']
|
||||
},
|
||||
firefox_sl: {
|
||||
browsers: ['firefox_sl']
|
||||
},
|
||||
safari_sl: {
|
||||
browsers: ['safari_sl']
|
||||
},
|
||||
ipad_sl: {
|
||||
browsers: ['ipad_sl']
|
||||
},
|
||||
android_sl: {
|
||||
browsers: ['android_sl']
|
||||
},
|
||||
ie_sl: {
|
||||
browsers: ['ie_sl']
|
||||
},
|
||||
|
||||
// these are run locally on local browsers
|
||||
dev: {
|
||||
browsers: ['Chrome', 'Firefox', 'Safari']
|
||||
},
|
||||
chromecanary: {
|
||||
browsers: ['ChromeCanary']
|
||||
},
|
||||
chrome: {
|
||||
browsers: ['Chrome']
|
||||
},
|
||||
firefox: {
|
||||
browsers: ['Firefox']
|
||||
},
|
||||
safari: {
|
||||
browsers: ['Safari']
|
||||
},
|
||||
ie: {
|
||||
browsers: ['IE']
|
||||
},
|
||||
phantomjs: {
|
||||
browsers: ['PhantomJS']
|
||||
},
|
||||
|
||||
// This is all the minified tests run locally on local browsers
|
||||
minified_dev: {
|
||||
browsers: ['Chrome', 'Firefox', 'Safari'],
|
||||
configFile: 'test/karma.minified.conf.js'
|
||||
},
|
||||
minified_chromecanary: {
|
||||
browsers: ['ChromeCanary'],
|
||||
configFile: 'test/karma.minified.conf.js'
|
||||
},
|
||||
minified_chrome: {
|
||||
browsers: ['Chrome'],
|
||||
configFile: 'test/karma.minified.conf.js'
|
||||
},
|
||||
minified_firefox: {
|
||||
browsers: ['Firefox'],
|
||||
configFile: 'test/karma.minified.conf.js'
|
||||
},
|
||||
minified_safari: {
|
||||
browsers: ['Safari'],
|
||||
configFile: 'test/karma.minified.conf.js'
|
||||
},
|
||||
minified_ie: {
|
||||
browsers: ['IE'],
|
||||
configFile: 'test/karma.minified.conf.js'
|
||||
},
|
||||
minified_phantomjs: {
|
||||
browsers: ['PhantomJS'],
|
||||
configFile: 'test/karma.minified.conf.js'
|
||||
},
|
||||
|
||||
// This is all the minified api tests run locally on local browsers
|
||||
minified_api_dev: {
|
||||
browsers: ['Chrome', 'Firefox', 'Safari'],
|
||||
configFile: 'test/karma.minified.api.conf.js'
|
||||
},
|
||||
minified_api_chromecanary: {
|
||||
browsers: ['ChromeCanary'],
|
||||
configFile: 'test/karma.minified.api.conf.js'
|
||||
},
|
||||
minified_api_chrome: {
|
||||
browsers: ['Chrome'],
|
||||
configFile: 'test/karma.minified.api.conf.js'
|
||||
},
|
||||
minified_api_firefox: {
|
||||
browsers: ['Firefox'],
|
||||
configFile: 'test/karma.minified.api.conf.js'
|
||||
},
|
||||
minified_api_safari: {
|
||||
browsers: ['Safari'],
|
||||
configFile: 'test/karma.minified.api.conf.js'
|
||||
},
|
||||
minified_api_ie: {
|
||||
browsers: ['IE'],
|
||||
configFile: 'test/karma.minified.api.conf.js'
|
||||
},
|
||||
minified_api_phantomjs: {
|
||||
browsers: ['PhantomJS'],
|
||||
configFile: 'test/karma.minified.api.conf.js'
|
||||
}
|
||||
},
|
||||
vjsdocs: {
|
||||
all: {
|
||||
src: sourceFiles,
|
||||
dest: 'docs/api',
|
||||
options: {
|
||||
baseURL: 'https://github.com/videojs/video.js/blob/master/'
|
||||
}
|
||||
}
|
||||
},
|
||||
vjslanguages: {
|
||||
defaults: {
|
||||
files: {
|
||||
'build/files/lang': ['lang/*.json']
|
||||
}
|
||||
}
|
||||
},
|
||||
zip: {
|
||||
dist: {
|
||||
router: function (filepath) {
|
||||
var path = require('path');
|
||||
return path.relative('dist', filepath);
|
||||
},
|
||||
// compression: 'DEFLATE',
|
||||
src: ['dist/video-js/**/*'],
|
||||
dest: 'dist/video-js-' + version.full + '.zip'
|
||||
}
|
||||
},
|
||||
usebanner: {
|
||||
dist: {
|
||||
options: {
|
||||
position: 'top',
|
||||
banner: '/*! Video.js v' + version.full + ' <%= pkg.copyright %> */ ',
|
||||
linebreak: true
|
||||
},
|
||||
files: {
|
||||
src: [ 'build/files/minified.video.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
version: {
|
||||
options: {
|
||||
pkg: 'package.json'
|
||||
},
|
||||
major: {
|
||||
options: {
|
||||
release: 'major'
|
||||
},
|
||||
src: ['package.json', 'bower.json', 'component.json']
|
||||
},
|
||||
minor: {
|
||||
options: {
|
||||
release: 'minor'
|
||||
},
|
||||
src: ['package.json', 'bower.json', 'component.json']
|
||||
},
|
||||
patch: {
|
||||
options: {
|
||||
release: 'patch'
|
||||
},
|
||||
src: ['package.json', 'bower.json', 'component.json']
|
||||
}
|
||||
},
|
||||
tagrelease: {
|
||||
file: 'package.json',
|
||||
commit: true,
|
||||
message: 'Release %version%',
|
||||
prefix: 'v'
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-videojs-languages');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
grunt.loadNpmTasks('grunt-s3');
|
||||
grunt.loadNpmTasks('contribflow');
|
||||
grunt.loadNpmTasks('grunt-karma');
|
||||
grunt.loadNpmTasks('videojs-doc-generator');
|
||||
grunt.loadNpmTasks('grunt-zip');
|
||||
grunt.loadNpmTasks('grunt-banner');
|
||||
grunt.loadNpmTasks('grunt-version');
|
||||
grunt.loadNpmTasks('grunt-tagrelease');
|
||||
grunt.loadNpmTasks('chg');
|
||||
|
||||
// grunt.loadTasks('./docs/tasks/');
|
||||
// grunt.loadTasks('../videojs-doc-generator/tasks/');
|
||||
|
||||
grunt.registerTask('pretask', ['jshint', 'less', 'vjslanguages', 'build', 'minify', 'usebanner']);
|
||||
// Default task.
|
||||
grunt.registerTask('default', ['pretask', 'dist']);
|
||||
// Development watch task
|
||||
grunt.registerTask('dev', ['jshint', 'less', 'vjslanguages', 'build', 'qunit:source']);
|
||||
grunt.registerTask('test-qunit', ['pretask', 'qunit']);
|
||||
|
||||
// The test task will run `karma:saucelabs` when running in travis,
|
||||
// when running via a PR from a fork, it'll run qunit tests in phantom using
|
||||
// karma otherwise, it'll run the tests in chrome via karma
|
||||
// You can specify which browsers to build with by using grunt-style arguments
|
||||
// or separating them with a comma:
|
||||
// grunt test:chrome:firefox # grunt-style
|
||||
// grunt test:chrome,firefox # comma-separated
|
||||
grunt.registerTask('test', function() {
|
||||
var tasks = this.args,
|
||||
tasksMinified,
|
||||
tasksMinifiedApi;
|
||||
|
||||
grunt.task.run(['pretask']);
|
||||
|
||||
if (process.env.TRAVIS_PULL_REQUEST !== 'false') {
|
||||
grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']);
|
||||
} else if (process.env.TRAVIS) {
|
||||
grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']);
|
||||
//Disabling saucelabs until we figure out how to make it run reliably.
|
||||
//grunt.task.run([
|
||||
//'karma:chrome_sl',
|
||||
//'karma:firefox_sl',
|
||||
//'karma:safari_sl',
|
||||
//'karma:ipad_sl',
|
||||
//'karma:android_sl',
|
||||
//'karma:ie_sl'
|
||||
//]);
|
||||
} else {
|
||||
// if we aren't running this in a CI, but running it manually, we can
|
||||
// supply arguments to this task. These arguments are either colon (`:`)
|
||||
// separated which is the default grunt separator for arguments, or they
|
||||
// are comma (`,`) separated to make it easier.
|
||||
// The arguments are the names of which browsers you want. It'll then
|
||||
// make sure you have the `minified` and `minified_api` for those browsers
|
||||
// as well.
|
||||
if (tasks.length === 0) {
|
||||
tasks.push('chrome');
|
||||
}
|
||||
if (tasks.length === 1) {
|
||||
tasks = tasks[0].split(',');
|
||||
}
|
||||
|
||||
tasksMinified = tasks.slice();
|
||||
tasksMinifiedApi = tasks.slice();
|
||||
|
||||
tasksMinified = tasksMinified.map(function(task) {
|
||||
return 'minified_' + task;
|
||||
});
|
||||
|
||||
tasksMinifiedApi = tasksMinifiedApi.map(function(task) {
|
||||
return 'minified_api_' + task;
|
||||
});
|
||||
|
||||
tasks = tasks.concat(tasksMinified).concat(tasksMinifiedApi);
|
||||
tasks = tasks.map(function(task) {
|
||||
return 'karma:' + task;
|
||||
});
|
||||
|
||||
grunt.task.run(tasks);
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('saucelabs', function() {
|
||||
var done = this.async();
|
||||
|
||||
if (this.args[0] == 'connect') {
|
||||
exec('curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash',
|
||||
function(error, stdout, stderr) {
|
||||
if (error) {
|
||||
grunt.log.error(error);
|
||||
return done();
|
||||
}
|
||||
|
||||
grunt.verbose.error(stderr.toString());
|
||||
grunt.verbose.writeln(stdout.toString());
|
||||
grunt.task.run(['karma:saucelabs']);
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
grunt.task.run(['karma:saucelabs']);
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
var fs = require('fs');
|
||||
|
||||
grunt.registerMultiTask('build', 'Building Source', function(){
|
||||
|
||||
// Fix windows file path delimiter issue
|
||||
var i = sourceFiles.length;
|
||||
while (i--) {
|
||||
sourceFiles[i] = sourceFiles[i].replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
// Create a combined sources file. https://github.com/zencoder/video-js/issues/287
|
||||
var combined = '';
|
||||
sourceFiles.forEach(function(result){
|
||||
combined += grunt.file.read(result);
|
||||
});
|
||||
// Replace CDN version ref in js. Use major/minor version.
|
||||
combined = combined.replace(/GENERATED_CDN_VSN/g, version.majorMinor);
|
||||
|
||||
grunt.file.write('build/files/combined.video.js', combined);
|
||||
|
||||
// Copy over other files
|
||||
// grunt.file.copy('src/css/video-js.png', 'build/files/video-js.png');
|
||||
grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'build/files/video-js.swf');
|
||||
|
||||
// Inject version number into css file
|
||||
var css = grunt.file.read('build/files/video-js.css');
|
||||
css = css.replace(/GENERATED_AT_BUILD/g, version.full);
|
||||
grunt.file.write('build/files/video-js.css', css);
|
||||
|
||||
// Copy over font files
|
||||
grunt.file.recurse('src/css/font', function(absdir, rootdir, subdir, filename) {
|
||||
// Block .DS_Store files
|
||||
if ('filename'.substring(0,1) !== '.') {
|
||||
grunt.file.copy(absdir, 'build/files/font/' + filename);
|
||||
}
|
||||
});
|
||||
|
||||
// Minify CSS
|
||||
grunt.task.run(['cssmin']);
|
||||
});
|
||||
|
||||
grunt.registerMultiTask('minify', 'Minify JS files using Closure Compiler.', function() {
|
||||
var done = this.async();
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
var externs = this.data.externs || [];
|
||||
var dest = this.data.dest;
|
||||
var filePatterns = [];
|
||||
|
||||
// Make sure deeper directories exist for compiler
|
||||
grunt.file.write(dest, '');
|
||||
|
||||
if (this.data.sourcelist) {
|
||||
filePatterns = filePatterns.concat(grunt.file.read(this.data.sourcelist).split(','));
|
||||
}
|
||||
if (this.data.src) {
|
||||
filePatterns = filePatterns.concat(this.data.src);
|
||||
}
|
||||
|
||||
// Build closure compiler shell command
|
||||
var command = 'java -jar build/compiler/compiler.jar'
|
||||
+ ' --compilation_level ADVANCED_OPTIMIZATIONS'
|
||||
// + ' --formatting=pretty_print'
|
||||
+ ' --js_output_file=' + dest
|
||||
+ ' --create_source_map ' + dest + '.map --source_map_format=V3'
|
||||
+ ' --jscomp_warning=checkTypes --warning_level=VERBOSE'
|
||||
+ ' --output_wrapper "(function() {%output%})();"';
|
||||
//@ sourceMappingURL=video.js.map
|
||||
|
||||
// Add each js file
|
||||
grunt.file.expand(filePatterns).forEach(function(file){
|
||||
command += ' --js='+file;
|
||||
});
|
||||
|
||||
// Add externs
|
||||
externs.forEach(function(extern){
|
||||
command += ' --externs='+extern;
|
||||
});
|
||||
|
||||
// Run command
|
||||
exec(command, { maxBuffer: 500*1024 }, function(err, stdout, stderr){
|
||||
|
||||
if (err) {
|
||||
grunt.warn(err);
|
||||
done(false);
|
||||
}
|
||||
|
||||
if (stdout) {
|
||||
grunt.log.writeln(stdout);
|
||||
}
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
grunt.registerTask('dist-copy', 'Assembling distribution', function(){
|
||||
var css, jsmin, jsdev, cdnjs;
|
||||
|
||||
// Manually copy each source file
|
||||
grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js');
|
||||
grunt.file.copy('build/files/combined.video.js', 'dist/video-js/video.dev.js');
|
||||
grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css');
|
||||
grunt.file.copy('build/files/video-js.min.css', 'dist/video-js/video-js.min.css');
|
||||
grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/video-js/video-js.swf');
|
||||
grunt.file.copy('build/demo-files/demo.html', 'dist/video-js/demo.html');
|
||||
grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/video-js/demo.captions.vtt');
|
||||
grunt.file.copy('src/css/video-js.less', 'dist/video-js/video-js.less');
|
||||
|
||||
|
||||
// Copy over font files
|
||||
grunt.file.recurse('build/files/font', function(absdir, rootdir, subdir, filename) {
|
||||
// Block .DS_Store files
|
||||
if ('filename'.substring(0,1) !== '.') {
|
||||
grunt.file.copy(absdir, 'dist/video-js/font/' + filename);
|
||||
}
|
||||
});
|
||||
|
||||
// Copy over language files
|
||||
grunt.file.recurse('build/files/lang', function(absdir, rootdir, subdir, filename) {
|
||||
// Block .DS_Store files
|
||||
if ('filename'.substring(0,1) !== '.') {
|
||||
grunt.file.copy(absdir, 'dist/cdn/lang/' + filename);
|
||||
grunt.file.copy(absdir, 'dist/video-js/lang/' + filename);
|
||||
}
|
||||
});
|
||||
|
||||
// ds_store files sometime find their way in
|
||||
if (grunt.file.exists('dist/video-js/.DS_Store')) {
|
||||
grunt.file['delete']('dist/video-js/.DS_Store');
|
||||
}
|
||||
|
||||
// CDN version uses already hosted font files
|
||||
// Minified version only, doesn't need demo files
|
||||
grunt.file.copy('build/files/minified.video.js', 'dist/cdn/video.js');
|
||||
grunt.file.copy('build/files/video-js.min.css', 'dist/cdn/video-js.css');
|
||||
grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/cdn/video-js.swf');
|
||||
grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/cdn/demo.captions.vtt');
|
||||
grunt.file.copy('build/demo-files/demo.html', 'dist/cdn/demo.html');
|
||||
|
||||
// Replace font urls with CDN versions
|
||||
css = grunt.file.read('dist/cdn/video-js.css');
|
||||
css = css.replace(/font\//g, '../f/3/');
|
||||
grunt.file.write('dist/cdn/video-js.css', css);
|
||||
|
||||
// Add CDN-specfic JS
|
||||
jsmin = grunt.file.read('dist/cdn/video.js');
|
||||
// GA Tracking Pixel (manually building the pixel URL)
|
||||
cdnjs = uglify.minify('src/js/cdn.js').code.replace('v0.0.0', 'v'+version.full);
|
||||
grunt.file.write('dist/cdn/video.js', jsmin + cdnjs);
|
||||
});
|
||||
|
||||
grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){
|
||||
var doc = grunt.file.read('docs/guides/setup.md');
|
||||
var version = pkg.version;
|
||||
|
||||
// remove the patch version to point to the latest patch
|
||||
version = version.replace(/(\d\.\d)\.\d/, '$1');
|
||||
|
||||
// update the version in http://vjs.zencdn.net/4.3/video.js
|
||||
doc = doc.replace(/(\/\/vjs\.zencdn\.net\/)\d\.\d(\.\d)?/g, '$1'+version);
|
||||
grunt.file.write('docs/guides/setup.md', doc);
|
||||
});
|
||||
|
||||
grunt.registerTask('dist', 'Creating distribution', ['dist-copy', 'zip:dist']);
|
||||
|
||||
grunt.registerTask('next-issue', 'Get the next issue that needs a response', function(){
|
||||
var done = this.async();
|
||||
var GitHubApi = require('github');
|
||||
var open = require('open');
|
||||
|
||||
var github = new GitHubApi({
|
||||
// required
|
||||
version: '3.0.0',
|
||||
// optional
|
||||
debug: true,
|
||||
protocol: 'https',
|
||||
// host: 'github.my-GHE-enabled-company.com',
|
||||
// pathPrefix: '/api/v3', // for some GHEs
|
||||
timeout: 5000
|
||||
});
|
||||
|
||||
github.issues.repoIssues({
|
||||
// optional:
|
||||
// headers: {
|
||||
// 'cookie': 'blahblah'
|
||||
// },
|
||||
user: 'videojs',
|
||||
repo: 'video.js',
|
||||
sort: 'updated',
|
||||
direction: 'asc',
|
||||
state: 'open',
|
||||
per_page: 100
|
||||
}, function(err, res) {
|
||||
var issueToOpen;
|
||||
var usersWithWrite = ['heff', 'mmcc'];
|
||||
var categoryLabels = ['enhancement', 'bug', 'question', 'feature'];
|
||||
|
||||
console.log('Number of issues: '+res.length);
|
||||
|
||||
// TODO: Find the best way to exclude an issue where a question has been asked of the
|
||||
// issue owner/submitter that hasn't been answerd yet.
|
||||
// A stupid simple first step would be to check for the needs: more info label
|
||||
// and exactly one comment (the question)
|
||||
|
||||
// find issues that need categorizing, no category labels
|
||||
res.some(function(issue){
|
||||
if (issue.labels.length === 0) {
|
||||
return issueToOpen = issue; // break
|
||||
}
|
||||
// look for category labels
|
||||
var categorized = issue.labels.some(function(label){
|
||||
return categoryLabels.indexOf(label.name) >= 0;
|
||||
});
|
||||
if (!categorized) {
|
||||
return issueToOpen = issue; // break
|
||||
}
|
||||
});
|
||||
if (issueToOpen) {
|
||||
open(issueToOpen.html_url);
|
||||
return done();
|
||||
}
|
||||
|
||||
// find issues that need confirming or answering
|
||||
res.some(function(issue){
|
||||
// look for confirmed label
|
||||
var confirmed = issue.labels.some(function(label){
|
||||
return label.name === 'confirmed';
|
||||
});
|
||||
// Was exluding questions, but that might leave a lot of people hanging
|
||||
// var question = issue.labels.some(function(label){
|
||||
// return label.name === 'question';
|
||||
// });
|
||||
if (!confirmed) { // && !question
|
||||
return issueToOpen = issue; // break
|
||||
}
|
||||
});
|
||||
if (issueToOpen) {
|
||||
open(issueToOpen.html_url);
|
||||
return done();
|
||||
}
|
||||
|
||||
grunt.log.writeln('No next issue found');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
require('./build/grunt.js')(grunt);
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Copyright 2013 Brightcove, Inc.
|
||||
Copyright Brightcove, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+106
-31
@@ -1,60 +1,135 @@
|
||||

|
||||
![Video.js logo][logo]
|
||||
|
||||
# [Video.js - HTML5 Video Player](http://videojs.com) [](https://travis-ci.org/videojs/video.js)
|
||||
# [Video.js - HTML5 Video Player][vjs]
|
||||
|
||||
> Video.js is a web video player built from the ground up for an HTML5 world. It supports HTML5 and Flash video, as well as YouTube and Vimeo (through [plugins](https://github.com/videojs/video.js/wiki/Plugins)). It supports video playback on desktops and mobile devices. This project was started mid 2010, and the player is now used on over ~~50,000~~ 100,000 websites.
|
||||
[![Build Status][travis-icon]][travis-link]
|
||||
[![Coverage Status][coveralls-icon]][coveralls-link]
|
||||
[![Slack Status][slack-icon]][slack-link]
|
||||
|
||||
## Quick start
|
||||
Thanks to the awesome folks over at [Fastly](http://www.fastly.com/), there's a free, CDN hosted version of Video.js that anyone can use. Simply add these includes to your document's
|
||||
`<head>`:
|
||||
[![NPM][npm-icon]][npm-link]
|
||||
|
||||
> Video.js is a web video player built from the ground up for an HTML5 world. It supports HTML5 and Flash video, as well as YouTube and Vimeo (through [plugins][plugins]). It supports video playback on desktops and mobile devices. This project was started mid 2010, and the player is now used on over ~~50,000~~ ~~100,000~~ ~~200,000~~ [400,000 websites][builtwith].
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Quick Start](#quick-start)
|
||||
* [Contributing](#contributing)
|
||||
* [Code of Conduct](#code-of-conduct)
|
||||
* [License](#license)
|
||||
|
||||
## Quick Start
|
||||
|
||||
Thanks to the awesome folks over at [Fastly][fastly], there's a free, CDN hosted version of Video.js that anyone can use. Add these tags to your document's `<head>`:
|
||||
|
||||
```html
|
||||
<link href="http://vjs.zencdn.net/4.9/video-js.css" rel="stylesheet">
|
||||
<script src="http://vjs.zencdn.net/4.9/video.js"></script>
|
||||
<link href="//vjs.zencdn.net/5.19/video-js.min.css" rel="stylesheet">
|
||||
<script src="//vjs.zencdn.net/5.19/video.min.js"></script>
|
||||
```
|
||||
|
||||
Then, whenever you want to use Video.js you can simply use the `<video>` element as your normally would, but with an additional `data-setup` attribute containing any Video.js options. These options
|
||||
can include any Video.js option plus potential [plugin](https://github.com/videojs/video.js/wiki/Plugins) options, just make sure they're valid JSON!
|
||||
> For the latest version of video.js and URLs to use, check out the [Getting Started][getting-started] page on our website.
|
||||
|
||||
Next, using Video.js is as simple as creating a `<video>` element, but with an additional `data-setup` attribute. At a minimum, this attribute must have a value of `'{}'`, but it can include any Video.js [options][options] - just make sure it contains valid JSON!
|
||||
|
||||
```html
|
||||
<video id="really-cool-video" class="video-js vjs-default-skin" controls
|
||||
preload="auto" width="640" height="264" poster="really-cool-video-poster.jpg"
|
||||
data-setup='{}'>
|
||||
<source src="really-cool-video.mp4" type='video/mp4'>
|
||||
<source src="really-cool-video.webm" type='video/webm'>
|
||||
<video
|
||||
id="my-player"
|
||||
class="video-js"
|
||||
controls
|
||||
preload="auto"
|
||||
poster="//vjs.zencdn.net/v/oceans.png"
|
||||
data-setup='{}'>
|
||||
<source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"></source>
|
||||
<source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"></source>
|
||||
<source src="//vjs.zencdn.net/v/oceans.ogv" type="video/ogg"></source>
|
||||
<p class="vjs-no-js">
|
||||
To view this video please enable JavaScript, and consider upgrading to a web browser
|
||||
that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
|
||||
To view this video please enable JavaScript, and consider upgrading to a
|
||||
web browser that
|
||||
<a href="http://videojs.com/html5-video-support/" target="_blank">
|
||||
supports HTML5 video
|
||||
</a>
|
||||
</p>
|
||||
</video>
|
||||
```
|
||||
|
||||
If you don't want to use auto-setup, you can leave off the `data-setup` attribute and initialize a video element manually.
|
||||
When the page loads, Video.js will find this element and automatically setup a player in its place.
|
||||
|
||||
```javascript
|
||||
var player = videojs('really-cool-video', { /* Options */ }, function() {
|
||||
console.log('Good to go!');
|
||||
If you don't want to use automatic setup, you can leave off the `data-setup` attribute and initialize a `<video>` element manually using the `videojs` function:
|
||||
|
||||
this.play(); // if you don't trust autoplay for some reason
|
||||
```js
|
||||
var player = videojs('my-player');
|
||||
```
|
||||
|
||||
The `videojs` function also accepts an `options` object and a callback to be invoked
|
||||
when the player is ready:
|
||||
|
||||
```js
|
||||
var options = {};
|
||||
|
||||
var player = videojs('my-player', options, function onPlayerReady() {
|
||||
videojs.log('Your player is ready!');
|
||||
|
||||
// In this context, `this` is the player that was created by Video.js.
|
||||
this.play();
|
||||
|
||||
// How about an event listener?
|
||||
this.on('ended', function() {
|
||||
console.log('awww...over so soon?');
|
||||
videojs.log('Awww...over so soon?!');
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
If you're ready to dive in, the [documentation](/blob/master/docs/index.md) is the first place to go for more information. Generally the
|
||||
[player API docs](/blob/master/docs/api/vjs.Player.md) are the most pertinent.
|
||||
If you're ready to dive in, the [Getting Started][getting-started] page and [documentation][docs] are the best places to go for more information. If you get stuck, head over to our [Slack channel][slack-link]!
|
||||
|
||||
## Contributing
|
||||
Video.js is a free and open source library, and we appreciate any help you're willing to give. Check out the [contributing guide](CONTRIBUTING.md).
|
||||
|
||||
## Building your own Video.js from source
|
||||
To build your own custom version read the section on [contributing code](CONTRIBUTING.md#contributing-code) and ["Building your own copy"](CONTRIBUTING.md#building-your-own-copy-of-videojs) in the contributing guide.
|
||||
Video.js is a free and open source library, and we appreciate any help you're willing to give - whether it's fixing bugs, improving documentation, or suggesting new features. Check out the [contributing guide][contributing] for more!
|
||||
|
||||
## License
|
||||
_Video.js uses [BrowserStack][browserstack] for compatibility testing._
|
||||
|
||||
Video.js is licensed under the Apache License, Version 2.0. [View the license file](LICENSE)
|
||||
## [Code of Conduct][coc]
|
||||
|
||||
Copyright 2014 Brightcove, Inc.
|
||||
Please note that this project is released with a [Contributor Code of Conduct][coc]. By participating in this project you agree to abide by its terms.
|
||||
|
||||
## [License][license]
|
||||
|
||||
Video.js is [licensed][license] under the Apache License, Version 2.0.
|
||||
|
||||
[browserstack]: https://browserstack.com
|
||||
|
||||
[builtwith]: https://trends.builtwith.com/media/VideoJS
|
||||
|
||||
[contributing]: CONTRIBUTING.md
|
||||
|
||||
[coveralls-icon]: https://coveralls.io/repos/github/videojs/video.js/badge.svg?branch=master
|
||||
|
||||
[coveralls-link]: https://coveralls.io/github/videojs/video.js?branch=master
|
||||
|
||||
[docs]: http://docs.videojs.com
|
||||
|
||||
[fastly]: http://www.fastly.com/
|
||||
|
||||
[getting-started]: http://videojs.com/getting-started/
|
||||
|
||||
[license]: LICENSE
|
||||
|
||||
[logo]: http://videojs.com/img/logo.png
|
||||
|
||||
[npm-icon]: https://nodei.co/npm/video.js.png?downloads=true&downloadRank=true
|
||||
|
||||
[npm-link]: https://nodei.co/npm/video.js/
|
||||
|
||||
[options]: docs/guides/options.md
|
||||
|
||||
[plugins]: http://videojs.com/plugins/
|
||||
|
||||
[slack-icon]: http://slack.videojs.com/badge.svg
|
||||
|
||||
[slack-link]: http://slack.videojs.com
|
||||
|
||||
[travis-icon]: https://travis-ci.org/videojs/video.js.svg?branch=master
|
||||
|
||||
[travis-link]: https://travis-ci.org/videojs/video.js
|
||||
|
||||
[vjs]: http://videojs.com
|
||||
|
||||
[coc]: CODE_OF_CONDUCT.md
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "video.js",
|
||||
"description": "An HTML5 and Flash video player with a common API and skin for both.",
|
||||
"version": "4.10.1",
|
||||
"main": [
|
||||
"dist/video-js/video.js",
|
||||
"dist/video-js/video-js.css"
|
||||
],
|
||||
"keywords": [
|
||||
"videojs",
|
||||
"html5",
|
||||
"flash",
|
||||
"video",
|
||||
"player"
|
||||
],
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests",
|
||||
"build"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
const fs = require('fs');
|
||||
const zlib = require('zlib');
|
||||
const Promise = require('bluebird');
|
||||
const klawSync = require('klaw-sync');
|
||||
const filesize = require('filesize');
|
||||
const Table = require('cli-table');
|
||||
|
||||
const files = klawSync('dist/', {
|
||||
ignore: ['examples', 'lang', 'font', 'ie8', '*.zip', '*.gz'],
|
||||
nodir: true
|
||||
});
|
||||
|
||||
Promise.all(files.map(gzipAndStat))
|
||||
.then(mapFiles)
|
||||
.then(function(files) {
|
||||
logTable(files);
|
||||
|
||||
return files;
|
||||
})
|
||||
.then(cleanup)
|
||||
.catch(function(err) {
|
||||
console.error(err.stack);
|
||||
});
|
||||
|
||||
function cleanup(files) {
|
||||
files.forEach(function(file) {
|
||||
fs.unlinkSync('dist/' + file[0] + '.gz');
|
||||
});
|
||||
}
|
||||
|
||||
function mapFiles(files) {
|
||||
return files.map(function(file) {
|
||||
const path = file[0].path;
|
||||
const fileStat = file[0].stats;
|
||||
const gzStat = file[1];
|
||||
return [file[0].path.split('dist/')[1], filesize(fileStat.size), filesize(gzStat.size)];
|
||||
});
|
||||
}
|
||||
|
||||
function gzipAndStat(file) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
const readStream = fs.createReadStream(file.path);
|
||||
const writeStream = fs.createWriteStream(file.path + '.gz');
|
||||
const gzip = zlib.createGzip();
|
||||
readStream.pipe(gzip).pipe(writeStream).on('close', function() {
|
||||
const gzStat = fs.statSync(file.path + '.gz');
|
||||
|
||||
resolve([file, gzStat]);
|
||||
})
|
||||
.on('error', reject);
|
||||
});
|
||||
}
|
||||
|
||||
function logTable(files) {
|
||||
const table = new Table({
|
||||
head: ['filename', 'size', 'gzipped'],
|
||||
colAligns: ['left', 'right', 'right'],
|
||||
style: {
|
||||
border: ['white']
|
||||
}
|
||||
});
|
||||
|
||||
table.push.apply(table, files);
|
||||
console.log(table.toString());
|
||||
}
|
||||
Arquivo executável
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# exit after any line errors
|
||||
set -e
|
||||
|
||||
# exit if this is a version commit
|
||||
# otherwise we cause an inifite loop when package version
|
||||
# bumps get pushed back to master
|
||||
if [[ $CI_MESSAGE = v[0-9]* ]]; then
|
||||
echo "Version commit found. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# exit if this is just a change to the build process not source
|
||||
if [[ $CI_MESSAGE = build:* ]]; then
|
||||
echo "Build commit found. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Install our task runner..."
|
||||
npm install -g contrib
|
||||
|
||||
echo "Configure npm for publishing..."
|
||||
printf "_auth=$NPM_AUTH_TOKEN\nemail=$NPM_EMAIL\n" > .npmrc
|
||||
|
||||
echo "Set git user to last committer..."
|
||||
git config --global user.email $CI_COMMITTER_EMAIL
|
||||
git config --global user.name $CI_COMMITTER_NAME
|
||||
|
||||
echo "Setup git branches and remotes..."
|
||||
git remote set-branches origin stable master
|
||||
git fetch
|
||||
git remote add upstream git@github.com:videojs/video.js.git
|
||||
|
||||
echo "Run the task..."
|
||||
contrib release prerelease
|
||||
Arquivo executável
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var version = require('../../package.json').version;
|
||||
|
||||
console.log(version);
|
||||
@@ -1,202 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
@@ -1,292 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009 The Closure Compiler Authors.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
//
|
||||
// Contents
|
||||
//
|
||||
|
||||
The Closure Compiler performs checking, instrumentation, and
|
||||
optimizations on JavaScript code. The purpose of this README is to
|
||||
explain how to build and run the Closure Compiler.
|
||||
|
||||
The Closure Compiler requires Java 6 or higher.
|
||||
http://www.java.com/
|
||||
|
||||
|
||||
//
|
||||
// Building The Closure Compiler
|
||||
//
|
||||
|
||||
There are three ways to get a Closure Compiler executable.
|
||||
|
||||
1) Use one we built for you.
|
||||
|
||||
Pre-built Closure binaries can be found at
|
||||
http://code.google.com/p/closure-compiler/downloads/list
|
||||
|
||||
|
||||
2) Check out the source and build it with Apache Ant.
|
||||
|
||||
First, check out the full source tree of the Closure Compiler. There
|
||||
are instructions on how to do this at the project site.
|
||||
http://code.google.com/p/closure-compiler/source/checkout
|
||||
|
||||
Apache Ant is a cross-platform build tool.
|
||||
http://ant.apache.org/
|
||||
|
||||
At the root of the source tree, there is an Ant file named
|
||||
build.xml. To use it, navigate to the same directory and type the
|
||||
command
|
||||
|
||||
ant jar
|
||||
|
||||
This will produce a jar file called "build/compiler.jar".
|
||||
|
||||
|
||||
3) Check out the source and build it with Eclipse.
|
||||
|
||||
Eclipse is a cross-platform IDE.
|
||||
http://www.eclipse.org/
|
||||
|
||||
Under Eclipse's File menu, click "New > Project ..." and create a
|
||||
"Java Project." You will see an options screen. Give the project a
|
||||
name, select "Create project from existing source," and choose the
|
||||
root of the checked-out source tree as the existing directory. Verify
|
||||
that you are using JRE version 6 or higher.
|
||||
|
||||
Eclipse can use the build.xml file to discover rules. When you
|
||||
navigate to the build.xml file, you will see all the build rules in
|
||||
the "Outline" pane. Run the "jar" rule to build the compiler in
|
||||
build/compiler.jar.
|
||||
|
||||
|
||||
//
|
||||
// Running The Closure Compiler
|
||||
//
|
||||
|
||||
Once you have the jar binary, running the Closure Compiler is straightforward.
|
||||
|
||||
On the command line, type
|
||||
|
||||
java -jar compiler.jar
|
||||
|
||||
This starts the compiler in interactive mode. Type
|
||||
|
||||
var x = 17 + 25;
|
||||
|
||||
then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux)
|
||||
and "Enter" again. The Compiler will respond:
|
||||
|
||||
var x=42;
|
||||
|
||||
The Closure Compiler has many options for reading input from a file,
|
||||
writing output to a file, checking your code, and running
|
||||
optimizations. To learn more, type
|
||||
|
||||
java -jar compiler.jar --help
|
||||
|
||||
You can read more detailed documentation about the many flags at
|
||||
http://code.google.com/closure/compiler/docs/gettingstarted_app.html
|
||||
|
||||
|
||||
//
|
||||
// Compiling Multiple Scripts
|
||||
//
|
||||
|
||||
If you have multiple scripts, you should compile them all together with
|
||||
one compile command.
|
||||
|
||||
java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js
|
||||
|
||||
The Closure Compiler will concatenate the files in the order they're
|
||||
passed at the command line.
|
||||
|
||||
If you need to compile many, many scripts together, you may start to
|
||||
run into problems with managing dependencies between scripts. You
|
||||
should check out the Closure Library. It contains functions for
|
||||
enforcing dependencies between scripts, and a tool called calcdeps.py
|
||||
that knows how to give scripts to the Closure Compiler in the right
|
||||
order.
|
||||
|
||||
http://code.google.com/p/closure-library/
|
||||
|
||||
//
|
||||
// Licensing
|
||||
//
|
||||
|
||||
Unless otherwise stated, all source files are licensed under
|
||||
the Apache License, Version 2.0.
|
||||
|
||||
|
||||
-----
|
||||
Code under:
|
||||
src/com/google/javascript/rhino
|
||||
test/com/google/javascript/rhino
|
||||
|
||||
URL: http://www.mozilla.org/rhino
|
||||
Version: 1.5R3, with heavy modifications
|
||||
License: Netscape Public License and MPL / GPL dual license
|
||||
|
||||
Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an
|
||||
implementation of JavaScript for the JVM. The JavaScript parser and
|
||||
the parse tree data structures were extracted and modified
|
||||
significantly for use by Google's JavaScript compiler.
|
||||
|
||||
Local Modifications: The packages have been renamespaced. All code not
|
||||
relevant to parsing has been removed. A JsDoc parser and static typing
|
||||
system have been added.
|
||||
|
||||
|
||||
-----
|
||||
Code in:
|
||||
lib/rhino
|
||||
|
||||
Rhino
|
||||
URL: http://www.mozilla.org/rhino
|
||||
Version: Trunk
|
||||
License: Netscape Public License and MPL / GPL dual license
|
||||
|
||||
Description: Mozilla Rhino is an implementation of JavaScript for the JVM.
|
||||
|
||||
Local Modifications: Minor changes to parsing JSDoc that usually get pushed
|
||||
up-stream to Rhino trunk.
|
||||
|
||||
|
||||
-----
|
||||
Code in:
|
||||
lib/args4j.jar
|
||||
|
||||
Args4j
|
||||
URL: https://args4j.dev.java.net/
|
||||
Version: 2.0.16
|
||||
License: MIT
|
||||
|
||||
Description:
|
||||
args4j is a small Java class library that makes it easy to parse command line
|
||||
options/arguments in your CUI application.
|
||||
|
||||
Local Modifications: None.
|
||||
|
||||
|
||||
-----
|
||||
Code in:
|
||||
lib/guava.jar
|
||||
|
||||
Guava Libraries
|
||||
URL: http://code.google.com/p/guava-libraries/
|
||||
Version: 13.0.1
|
||||
License: Apache License 2.0
|
||||
|
||||
Description: Google's core Java libraries.
|
||||
|
||||
Local Modifications: None.
|
||||
|
||||
|
||||
-----
|
||||
Code in:
|
||||
lib/jsr305.jar
|
||||
|
||||
Annotations for software defect detection
|
||||
URL: http://code.google.com/p/jsr-305/
|
||||
Version: svn revision 47
|
||||
License: BSD License
|
||||
|
||||
Description: Annotations for software defect detection.
|
||||
|
||||
Local Modifications: None.
|
||||
|
||||
|
||||
-----
|
||||
Code in:
|
||||
lib/jarjar.jar
|
||||
|
||||
Jar Jar Links
|
||||
URL: http://jarjar.googlecode.com/
|
||||
Version: 1.1
|
||||
License: Apache License 2.0
|
||||
|
||||
Description:
|
||||
A utility for repackaging Java libraries.
|
||||
|
||||
Local Modifications: None.
|
||||
|
||||
|
||||
----
|
||||
Code in:
|
||||
lib/junit.jar
|
||||
|
||||
JUnit
|
||||
URL: http://sourceforge.net/projects/junit/
|
||||
Version: 4.10
|
||||
License: Common Public License 1.0
|
||||
|
||||
Description: A framework for writing and running automated tests in Java.
|
||||
|
||||
Local Modifications: None.
|
||||
|
||||
|
||||
---
|
||||
Code in:
|
||||
lib/protobuf-java.jar
|
||||
|
||||
Protocol Buffers
|
||||
URL: http://code.google.com/p/protobuf/
|
||||
Version: 2.4.1
|
||||
License: New BSD License
|
||||
|
||||
Description: Supporting libraries for protocol buffers,
|
||||
an encoding of structured data.
|
||||
|
||||
Local Modifications: None
|
||||
|
||||
|
||||
---
|
||||
Code in:
|
||||
lib/ant.jar
|
||||
lib/ant-launcher.jar
|
||||
|
||||
URL: http://ant.apache.org/bindownload.cgi
|
||||
Version: 1.8.1
|
||||
License: Apache License 2.0
|
||||
Description:
|
||||
Ant is a Java based build tool. In theory it is kind of like "make"
|
||||
without make's wrinkles and with the full portability of pure java code.
|
||||
|
||||
Local Modifications: None
|
||||
|
||||
|
||||
---
|
||||
Code in:
|
||||
lib/json.jar
|
||||
URL: http://json.org/java/index.html
|
||||
Version: JSON version 20090211
|
||||
License: MIT license
|
||||
Description:
|
||||
JSON is a set of java files for use in transmitting data in JSON format.
|
||||
|
||||
Local Modifications: None
|
||||
|
||||
---
|
||||
Code in:
|
||||
tools/maven-ant-tasks-2.1.3.jar
|
||||
URL: http://maven.apache.org
|
||||
Version 2.1.3
|
||||
License: Apache License 2.0
|
||||
Description:
|
||||
Maven Ant tasks are used to manage dependencies and to install/deploy to
|
||||
maven repositories.
|
||||
|
||||
Local Modifications: None
|
||||
Arquivo binário não exibido.
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -0,0 +1,33 @@
|
||||
var unified = require('unified');
|
||||
var markdown = require('remark-parse');
|
||||
var stringify = require('remark-stringify');
|
||||
var fs = require('fs');
|
||||
|
||||
module.exports = function() {
|
||||
var processor = unified()
|
||||
.use(markdown, {commonmark: true})
|
||||
.use(stringify);
|
||||
|
||||
var ast = processor.parse(fs.readFileSync('./CHANGELOG.md'));
|
||||
|
||||
var changelog = [];
|
||||
changelog.push(processor.stringify(ast.children[0]));
|
||||
|
||||
// start at 1 so we get the first anchor tag
|
||||
// and can break on the second
|
||||
for (var i = 1; i < ast.children.length; i++) {
|
||||
var item = processor.stringify(ast.children[i]);
|
||||
|
||||
if (/^<a name="/.test(item)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (/^###/.test(item)) {
|
||||
item = '\n' + item + '\n';
|
||||
}
|
||||
|
||||
changelog.push(item);
|
||||
}
|
||||
|
||||
return changelog.join('\n');
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Video.js | HTML5 Video Player</title>
|
||||
|
||||
<!-- Chang URLs to wherever Video.js files will be hosted -->
|
||||
<link href="video-js.css" rel="stylesheet" type="text/css">
|
||||
<!-- video.js must be in the <head> for older IEs to work. -->
|
||||
<script src="video.js"></script>
|
||||
|
||||
<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
|
||||
<script>
|
||||
videojs.options.flash.swf = "video-js.swf";
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264"
|
||||
poster="http://video-js.zencoder.com/oceans-clip.png"
|
||||
data-setup="{}">
|
||||
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
|
||||
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
|
||||
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
|
||||
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<track kind="subtitles" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
|
||||
</video>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
import sh from 'shelljs';
|
||||
import path from 'path';
|
||||
|
||||
|
||||
export default function(commit, commitRange) {
|
||||
const SINGLE_COMMIT = `git diff-tree --no-commit-id --name-only -r ${commit}`;
|
||||
const COMMIT_RANGE = `git diff --name-only ${commitRange}`;
|
||||
|
||||
let command = SINGLE_COMMIT;
|
||||
|
||||
if (commitRange) {
|
||||
command = COMMIT_RANGE
|
||||
}
|
||||
|
||||
const output = sh.exec(command, {async: false, silent: true}).stdout;
|
||||
|
||||
const files = output.split('\n').filter(Boolean);
|
||||
return files.every((file) => file.startsWith('docs') || path.extname(file) === '.md');
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
#resizer,
|
||||
footer {
|
||||
background-color: #ECEEF1;
|
||||
color: #868688;
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
.footer-text {
|
||||
padding: 3px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
footer .copyright {
|
||||
float: left;
|
||||
}
|
||||
|
||||
footer .other-links {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
footer .other-links li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
footer .logo {
|
||||
display: none;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
var replace = require("replace");
|
||||
var path = require('path')
|
||||
var apiPath = path.join(__dirname, '..', 'docs', 'api');
|
||||
|
||||
var replacements = [
|
||||
{find: /\/docs\/guides\/(.+)\.md/g, replace: 'tutorial-$1.html'},
|
||||
{find: /tutorial-tech.html/g, replace: 'tutorial-tech_.html'},
|
||||
{find: /\/docs\/guides\//g, replace: '#'},
|
||||
{find: /(\<h[1-6] id="(?:.*)?)video-js(.*)?"\>/g, replace: '$1videojs$2">'},
|
||||
{find: /(\<h[1-6] id="(?:.*)?)don-t(.*)?"\>/g, replace: '$1dont$2">'},
|
||||
{find: /(\<h[1-6] id="(?:.*)?)node-js(.*)?"\>/g, replace: '$1nodejs$2">'},
|
||||
{find: /(\<h[1-6] id="(?:.*)?)vtt-js(.*)?"\>/g, replace: '$1vttjs$2">'},
|
||||
{find: /(\<h[1-6] id=")-(.*)("\>)/g, replace: '$1$2$3'},
|
||||
{find: /(\<h[1-6] id=")(.*)-("\>)/g, replace: '$1$2$3'},
|
||||
{find: /(\<h[1-6] id=".*)-docs-guides-.*-md("\>)/g, replace: '$1$2'},
|
||||
// replace all children with children-1
|
||||
{find: /\<h3 id="children"\>/g, replace: '<h3 id="children-1">'},
|
||||
// remove the -1 from the first item
|
||||
{find: /\<h3 id="children-1"\>/, replace: '<h3 id="children">'},
|
||||
{find: '<h4 id="nativecontrolsfortouch">', replace: '<h4 id="nativecontrolsfortouch-1">'},
|
||||
{find: '<h3 id="videojs-(audio|video)track">', replace: '<h3 id="videojs$1track">'},
|
||||
{find: '<h3 id="text-tracks">', replace: '<h3 id="text-tracks-1">'},
|
||||
{find: '<h2 id="q-how-can-i-hide-the-links-to-my-video-subtitles-audio-tracks">',
|
||||
replace: '<h2 id="q-how-can-i-hide-the-links-to-my-videosubtitlesaudiotracks">'},
|
||||
{find: '<h3 id="dispose-http-docs-videojs-com-player-html-dispose">',
|
||||
replace: '<h3 id="dispose">'},
|
||||
{find: '<h4 id="effect-on-player-width-and-player-height">',
|
||||
replace: '<h4 id="effect-on-playerwidth-and-playerheight">'},
|
||||
{find: '<h4 id="i-want-to-have-a-single-source-and-dont-care-about-live-adaptive-streaming">',
|
||||
replace: '<h4 id="i-want-to-have-a-single-source-and-dont-care-about-liveadaptive-streaming">'},
|
||||
{find: '<h2 id="api-docs-api">', replace: '<h2 id="api-docs">'},
|
||||
{find: '<h2 id="guides-docs-guides">', replace: '<h2 id="guides">'}
|
||||
];
|
||||
|
||||
|
||||
replacements.forEach(function(obj) {
|
||||
replace({
|
||||
regex: obj.find,
|
||||
replacement: obj.replace,
|
||||
paths: [apiPath],
|
||||
recursive: true,
|
||||
silent: true
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
var ghrelease = require('gh-release');
|
||||
var currentChangelog = require('./current-changelog.js');
|
||||
var safeParse = require('safe-json-parse/tuple');
|
||||
var pkg = require('../package.json')
|
||||
var minimist = require('minimist');
|
||||
|
||||
var args = minimist(process.argv.slice(2), {
|
||||
boolean: ['prerelease'],
|
||||
default: {
|
||||
prerelease: false
|
||||
},
|
||||
alias: {
|
||||
p: 'prerelease'
|
||||
}
|
||||
});
|
||||
|
||||
var options = {
|
||||
owner: 'videojs',
|
||||
repo: 'video.js',
|
||||
body: currentChangelog(),
|
||||
assets: ['./dist/video-js-'+pkg.version+'.zip'],
|
||||
endpoint: 'https://api.github.com',
|
||||
auth: {
|
||||
username: process.env.VJS_GITHUB_USER,
|
||||
password: process.env.VJS_GITHUB_TOKEN
|
||||
}
|
||||
};
|
||||
|
||||
var tuple = safeParse(process.env.npm_config_argv);
|
||||
var npmargs = tuple[0] ? [] : tuple[1].cooked;
|
||||
|
||||
if (args.prerelease || npmargs.some(function(arg) { return /next/.test(arg); })) {
|
||||
options.prerelease = true;
|
||||
}
|
||||
|
||||
ghrelease(options, function(err, result) {
|
||||
if (err) {
|
||||
console.error('Unable to publish release to github');
|
||||
console.error('err:', err);
|
||||
console.error('result:', result);
|
||||
} else {
|
||||
console.log('Publish release to github!');
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,588 @@
|
||||
import {gruntCustomizer, gruntOptionsMaker} from './options-customizer.js';
|
||||
import chg from 'chg';
|
||||
import npmRun from 'npm-run';
|
||||
import isDocsOnly from './docs-only.js';
|
||||
|
||||
module.exports = function(grunt) {
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
let _ = require('lodash');
|
||||
let pkg = grunt.file.readJSON('package.json');
|
||||
let license = grunt.file.read('build/license-header.txt');
|
||||
let bannerCommonData = _.pick(pkg, ['version', 'copyright']);
|
||||
let verParts = pkg.version.split('.');
|
||||
let version = {
|
||||
full: pkg.version,
|
||||
major: verParts[0],
|
||||
minor: verParts[1],
|
||||
patch: verParts[2]
|
||||
};
|
||||
|
||||
const browserifyGruntDefaults = {
|
||||
browserifyOptions: {
|
||||
standalone: 'videojs'
|
||||
},
|
||||
plugin: [
|
||||
['bundle-collapser/plugin'],
|
||||
['browserify-derequire']
|
||||
]
|
||||
};
|
||||
|
||||
const githubReleaseDefaults = {
|
||||
options: {
|
||||
release: {
|
||||
tag_name: 'v'+ version.full,
|
||||
name: version.full,
|
||||
body: npmRun.execSync('conventional-changelog -p videojs', {
|
||||
silent: true,
|
||||
encoding: 'utf8'
|
||||
})
|
||||
},
|
||||
},
|
||||
files: {
|
||||
src: [`dist/video-js-${version.full}.zip`] // Files that you want to attach to Release
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Customizes _.merge behavior in `browserifyGruntOptions` to concatenate
|
||||
* arrays. This can be overridden on a per-call basis to
|
||||
*
|
||||
* @see https://lodash.com/docs#merge
|
||||
* @function browserifyGruntCustomizer
|
||||
* @private
|
||||
* @param {Mixed} objectValue
|
||||
* @param {Mixed} sourceValue
|
||||
* @return {Object}
|
||||
*/
|
||||
const browserifyGruntCustomizer = gruntCustomizer;
|
||||
|
||||
/**
|
||||
* Creates a unique object of Browserify Grunt task options.
|
||||
*
|
||||
* @function browserifyGruntOptions
|
||||
* @private
|
||||
* @param {Object} [options]
|
||||
* @param {Function} [customizer=browserifyGruntCustomizer]
|
||||
* If the default array-concatenation behavior is not desireable,
|
||||
* pass _.noop or a unique customizer (https://lodash.com/docs#merge).
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
const browserifyGruntOptions = gruntOptionsMaker(browserifyGruntDefaults, browserifyGruntCustomizer);
|
||||
|
||||
const githubReleaseCustomizer = gruntCustomizer;
|
||||
const githubReleaseOptions = gruntOptionsMaker(githubReleaseDefaults, githubReleaseCustomizer);
|
||||
|
||||
/**
|
||||
* Creates processor functions for license banners.
|
||||
*
|
||||
* @function createLicenseProcessor
|
||||
* @private
|
||||
* @param {Object} data Custom data overriding `bannerCommonData`. Will
|
||||
* not be mutated.
|
||||
* @return {Function} A function which returns a processed grunt template
|
||||
* using an object constructed from `bannerCommonData`
|
||||
* and the `data` argument.
|
||||
*/
|
||||
function createLicenseProcessor(data) {
|
||||
return () => {
|
||||
return grunt.template.process(license, {
|
||||
data: _.merge({}, bannerCommonData, data)
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
version.majorMinor = `${version.major}.${version.minor}`;
|
||||
grunt.vjsVersion = version;
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg,
|
||||
clean: {
|
||||
build: ['build/temp/*', 'es5'],
|
||||
dist: ['dist/*']
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
preserveComments: 'some',
|
||||
screwIE8: false,
|
||||
mangle: true,
|
||||
compress: {
|
||||
sequences: true,
|
||||
dead_code: true,
|
||||
conditionals: true,
|
||||
booleans: true,
|
||||
unused: true,
|
||||
if_return: true,
|
||||
join_vars: true,
|
||||
drop_console: true
|
||||
}
|
||||
},
|
||||
build: {
|
||||
files: {
|
||||
'build/temp/alt/video.novtt.min.js': 'build/temp/alt/video.novtt.js',
|
||||
'build/temp/video.min.js': 'build/temp/video.js'
|
||||
}
|
||||
}
|
||||
},
|
||||
dist: {},
|
||||
watch: {
|
||||
dist: {
|
||||
files: [
|
||||
'build/temp/video.js',
|
||||
'build/temp/alt/video.novtt.js',
|
||||
'build/temp/video-js.css',
|
||||
'build/temp/alt/video-js-cdn.css'
|
||||
],
|
||||
tasks: ['copy:dist']
|
||||
},
|
||||
minify: {
|
||||
files: ['build/temp/video.js'],
|
||||
tasks: ['uglify']
|
||||
},
|
||||
skin: {
|
||||
files: ['src/css/**/*'],
|
||||
tasks: ['skin']
|
||||
},
|
||||
lang: {
|
||||
files: ['lang/**/*.json'],
|
||||
tasks: ['vjslanguages']
|
||||
}
|
||||
},
|
||||
connect: {
|
||||
dev: {
|
||||
options: {
|
||||
port: Number(process.env.VJS_CONNECT_PORT) || 9999,
|
||||
livereload: true,
|
||||
useAvailablePort: true
|
||||
}
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
minor: {
|
||||
files: [
|
||||
{expand: true, cwd: 'build/temp/', src: ['*'], dest: 'dist/'+version.majorMinor+'/', filter: 'isFile'} // includes files in path
|
||||
]
|
||||
},
|
||||
patch: {
|
||||
files: [
|
||||
{expand: true, cwd: 'build/temp/', src: ['*'], dest: 'dist/'+version.full+'/', filter: 'isFile'} // includes files in path
|
||||
]
|
||||
},
|
||||
fonts: { cwd: 'node_modules/videojs-font/fonts/', src: ['*'], dest: 'build/temp/font/', expand: true, filter: 'isFile' },
|
||||
swf: { cwd: 'node_modules/videojs-swf/dist/', src: 'video-js.swf', dest: 'build/temp/', expand: true, filter: 'isFile' },
|
||||
ie8: { cwd: 'node_modules/videojs-ie8/dist/', src: ['**/**'], dest: 'build/temp/ie8/', expand: true, filter: 'isFile' },
|
||||
dist: { cwd: 'build/temp/', src: ['**/**', '!test*'], dest: 'dist/', expand: true, filter: 'isFile' },
|
||||
a11y: { src: 'sandbox/descriptions.html.example', dest: 'sandbox/descriptions.test-a11y.html' }, // Can only test a file with a .html or .htm extension
|
||||
examples: { cwd: 'docs/examples/', src: ['**/**'], dest: 'dist/examples/', expand: true, filter: 'isFile' }
|
||||
},
|
||||
cssmin: {
|
||||
minify: {
|
||||
expand: true,
|
||||
cwd: 'build/temp/',
|
||||
src: ['video-js.css', 'alt/video-js-cdn.css'],
|
||||
dest: 'build/temp/',
|
||||
ext: '.min.css'
|
||||
}
|
||||
},
|
||||
sass: {
|
||||
build: {
|
||||
files: {
|
||||
'build/temp/video-js.css': 'src/css/vjs.scss',
|
||||
'build/temp/alt/video-js-cdn.css': 'src/css/vjs-cdn.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
karma: {
|
||||
// this config file applies to all following configs except if overwritten
|
||||
options: {
|
||||
configFile: 'test/karma.conf.js'
|
||||
},
|
||||
|
||||
defaults: {
|
||||
detectBrowsers: {
|
||||
enabled: !process.env.TRAVIS,
|
||||
usePhantomJS: false
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
autoWatch: true,
|
||||
singleRun: false
|
||||
},
|
||||
|
||||
// these are run locally on local browsers
|
||||
dev: { browsers: ['Chrome', 'Firefox', 'Safari'] },
|
||||
chromecanary: { browsers: ['ChromeCanary'] },
|
||||
chrome: { browsers: ['Chrome'] },
|
||||
firefox: { browsers: ['Firefox'] },
|
||||
safari: { browsers: ['Safari'] },
|
||||
ie: { browsers: ['IE'] },
|
||||
|
||||
// this only runs on PRs from the mainrepo on BrowserStack
|
||||
browserstack: { browsers: ['chrome_bs'] },
|
||||
chrome_bs: { browsers: ['chrome_bs'] },
|
||||
firefox_bs: { browsers: ['firefox_bs'] },
|
||||
safari_bs: { browsers: ['safari_bs'] },
|
||||
edge_bs: { browsers: ['edge_bs'] },
|
||||
ie11_bs: { browsers: ['ie11_bs'] },
|
||||
ie10_bs: { browsers: ['ie10_bs'] },
|
||||
ie9_bs: { browsers: ['ie9_bs'] },
|
||||
ie8_bs: { browsers: ['ie8_bs'] }
|
||||
},
|
||||
vjsdocs: {
|
||||
all: {
|
||||
// TODO: Update vjsdocs to support new build, or switch to jsdoc
|
||||
src: '',
|
||||
dest: 'docs/api',
|
||||
options: {
|
||||
baseURL: 'https://github.com/videojs/video.js/blob/master/'
|
||||
}
|
||||
}
|
||||
},
|
||||
vjslanguages: {
|
||||
defaults: {
|
||||
files: {
|
||||
'build/temp/lang': ['lang/*.json']
|
||||
}
|
||||
}
|
||||
},
|
||||
zip: {
|
||||
dist: {
|
||||
router: function (filepath) {
|
||||
var path = require('path');
|
||||
return path.relative('dist', filepath);
|
||||
},
|
||||
// compression: 'DEFLATE',
|
||||
src: ['dist/**/*'],
|
||||
dest: 'dist/video-js-' + version.full + '.zip'
|
||||
}
|
||||
},
|
||||
version: {
|
||||
options: {
|
||||
pkg: 'package.json'
|
||||
},
|
||||
major: {
|
||||
options: {
|
||||
release: 'major'
|
||||
},
|
||||
src: ['package.json']
|
||||
},
|
||||
minor: {
|
||||
options: {
|
||||
release: 'minor'
|
||||
},
|
||||
src: ['package.json']
|
||||
},
|
||||
patch: {
|
||||
options: {
|
||||
release: 'patch'
|
||||
},
|
||||
src: ['package.json']
|
||||
},
|
||||
prerelease: {
|
||||
options: {
|
||||
release: 'prerelease'
|
||||
},
|
||||
src: ['package.json']
|
||||
},
|
||||
css: {
|
||||
options: {
|
||||
prefix: '@version\\s*'
|
||||
},
|
||||
src: 'build/temp/video-js.css'
|
||||
}
|
||||
},
|
||||
'github-release': {
|
||||
options: {
|
||||
repository: 'videojs/video.js',
|
||||
auth: {
|
||||
user: process.env.VJS_GITHUB_USER,
|
||||
password: process.env.VJS_GITHUB_TOKEN
|
||||
}
|
||||
},
|
||||
release: githubReleaseOptions(),
|
||||
prerelease: githubReleaseOptions({
|
||||
options: {
|
||||
release: {
|
||||
prerelease: true
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
babel: {
|
||||
es5: {
|
||||
files: [{
|
||||
expand: true,
|
||||
cwd: 'src/js/',
|
||||
src: ['**/*.js', '!base-styles.js'],
|
||||
dest: 'es5/'
|
||||
}]
|
||||
}
|
||||
},
|
||||
browserify: {
|
||||
build: {
|
||||
options: browserifyGruntOptions(),
|
||||
files: {
|
||||
'build/temp/video.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
buildnovtt: {
|
||||
options: browserifyGruntOptions({transform: [
|
||||
['aliasify', {aliases: {'videojs-vtt.js': false}}]
|
||||
]}),
|
||||
files: {
|
||||
'build/temp/alt/video.novtt.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options: browserifyGruntOptions({
|
||||
watch: true,
|
||||
keepAlive: true,
|
||||
}),
|
||||
files: {
|
||||
'build/temp/video.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
watchnovtt: {
|
||||
options: browserifyGruntOptions({
|
||||
transform: [
|
||||
['aliasify', {aliases: {'videojs-vtt.js': false}}]
|
||||
],
|
||||
watch: true,
|
||||
keepAlive: true,
|
||||
}),
|
||||
files: {
|
||||
'build/temp/alt/video.novtt.js': ['es5/video.js']
|
||||
}
|
||||
},
|
||||
tests: {
|
||||
options: {
|
||||
browserifyOptions: {
|
||||
verbose: true,
|
||||
standalone: false,
|
||||
transform: ['babelify']
|
||||
},
|
||||
plugin: [
|
||||
['proxyquireify/plugin', 'bundle-collapser/plugin']
|
||||
],
|
||||
banner: false,
|
||||
watch: true,
|
||||
keepAlive: true
|
||||
},
|
||||
files: {
|
||||
'build/temp/tests.js': [
|
||||
'test/globals-shim.js',
|
||||
'test/unit/**/*.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
coveralls: {
|
||||
options: {
|
||||
// warn instead of failing when coveralls errors
|
||||
// we've seen coveralls 503 relatively frequently
|
||||
force: true
|
||||
},
|
||||
all: {
|
||||
src: 'test/coverage/lcov.info'
|
||||
}
|
||||
},
|
||||
concat: {
|
||||
options: {
|
||||
separator: '\n'
|
||||
},
|
||||
ie8_addition: {
|
||||
src: ['build/temp/video-js.css', 'src/css/ie8.css'],
|
||||
dest: 'build/temp/video-js.css'
|
||||
}
|
||||
},
|
||||
concurrent: {
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
},
|
||||
tests: [
|
||||
'shell:babel',
|
||||
'browserify:tests'
|
||||
],
|
||||
dev: [
|
||||
'shell:babel',
|
||||
'shell:rollupwatch',
|
||||
'browserify:tests',
|
||||
'watch:skin',
|
||||
'watch:lang',
|
||||
'watch:dist'
|
||||
],
|
||||
// Run multiple watch tasks in parallel
|
||||
// Needed so watchify can cache intelligently
|
||||
watchAll: [
|
||||
'watch',
|
||||
'browserify:watch',
|
||||
'browserify:watchnovtt',
|
||||
'browserify:tests',
|
||||
'karma:watch'
|
||||
],
|
||||
watchSandbox: [
|
||||
'watch',
|
||||
'browserify:watch'
|
||||
]
|
||||
},
|
||||
usebanner: {
|
||||
novtt: {
|
||||
options: {
|
||||
process: createLicenseProcessor({includesVtt: false})
|
||||
},
|
||||
files: {
|
||||
src: ['build/temp/alt/video.novtt.js']
|
||||
}
|
||||
},
|
||||
vtt: {
|
||||
options: {
|
||||
process: createLicenseProcessor({includesVtt: true})
|
||||
},
|
||||
files: {
|
||||
src: ['build/temp/video.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
shell: {
|
||||
rollup: {
|
||||
command: 'npm run rollup',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
},
|
||||
rollupall: {
|
||||
command: 'npm run rollup -- --no-progress && npm run rollup-minify -- --no-progress',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
},
|
||||
rollupwatch: {
|
||||
command: 'npm run rollup-dev',
|
||||
optoins: {
|
||||
preferLocal: true
|
||||
}
|
||||
},
|
||||
babel: {
|
||||
command: 'npm run babel -- --watch --quiet',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
},
|
||||
lint: {
|
||||
command: 'npm run lint -- --errors',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
},
|
||||
noderequire: {
|
||||
command: 'node test/require/node.js',
|
||||
options: {
|
||||
failOnError: true
|
||||
}
|
||||
},
|
||||
browserify: {
|
||||
command: 'browserify test/require/browserify.js -o build/temp/browserify.js',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
},
|
||||
webpack: {
|
||||
command: 'webpack --hide-modules test/require/webpack.js build/temp/webpack.js',
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
}
|
||||
},
|
||||
accessibility: {
|
||||
options: {
|
||||
accessibilityLevel: 'WCAG2AA',
|
||||
reportLevels: {
|
||||
notice: false,
|
||||
warning: true,
|
||||
error: true
|
||||
},
|
||||
ignore: [
|
||||
// Ignore warning about contrast of the "vjs-no-js" fallback link
|
||||
'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.BgImage'
|
||||
]
|
||||
|
||||
},
|
||||
test: {
|
||||
src: ['sandbox/descriptions.test-a11y.html']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// load all the npm grunt tasks
|
||||
require('load-grunt-tasks')(grunt);
|
||||
grunt.loadNpmTasks('videojs-doc-generator');
|
||||
grunt.loadNpmTasks('chg');
|
||||
grunt.loadNpmTasks('grunt-accessibility');
|
||||
|
||||
grunt.registerTask('build', [
|
||||
'shell:lint',
|
||||
'clean:build',
|
||||
|
||||
'shell:rollupall',
|
||||
|
||||
'skin',
|
||||
'version:css',
|
||||
'cssmin',
|
||||
|
||||
'copy:fonts',
|
||||
'copy:swf',
|
||||
'copy:ie8',
|
||||
'vjslanguages'
|
||||
]);
|
||||
|
||||
grunt.registerTask('dist', [
|
||||
'clean:dist',
|
||||
'build',
|
||||
'copy:dist',
|
||||
'copy:examples',
|
||||
'zip:dist'
|
||||
]);
|
||||
|
||||
grunt.registerTask('skin', ['sass', 'concat:ie8_addition']);
|
||||
|
||||
// Default task - build and test
|
||||
grunt.registerTask('default', ['test']);
|
||||
|
||||
// The test script includes coveralls only when the TRAVIS env var is set.
|
||||
grunt.registerTask('test', function() {
|
||||
const tasks = [
|
||||
'build',
|
||||
'shell:noderequire',
|
||||
'shell:browserify',
|
||||
'shell:webpack',
|
||||
'karma:defaults',
|
||||
'test-a11y'
|
||||
];
|
||||
|
||||
if (process.env.TRAVIS) {
|
||||
if (isDocsOnly(process.env.TRAVIS_COMMIT, process.env.TRAVIS_COMMIT_RANGE)) {
|
||||
grunt.log.write('Not running any tests because only docs were changed');
|
||||
return;
|
||||
}
|
||||
|
||||
tasks.concat(process.env.TRAVIS && 'coveralls').filter(Boolean);
|
||||
}
|
||||
|
||||
grunt.task.run(tasks);
|
||||
});
|
||||
|
||||
// Run while developing
|
||||
grunt.registerTask('dev', ['sandbox', 'connect:dev', 'concurrent:dev']);
|
||||
grunt.registerTask('watchAll', ['build', 'connect:dev', 'concurrent:watchAll']);
|
||||
grunt.registerTask('test-a11y', ['copy:a11y', 'accessibility']);
|
||||
|
||||
// Pick your testing, or run both in different terminals
|
||||
grunt.registerTask('test-ui', ['browserify:tests']);
|
||||
grunt.registerTask('test-cli', ['karma:watch']);
|
||||
|
||||
// Load all the tasks in the tasks directory
|
||||
grunt.loadTasks('build/tasks');
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Video.js <%= version %> <http://videojs.com/>
|
||||
* <%= copyright %>
|
||||
* Available under Apache License Version 2.0
|
||||
* <https://github.com/videojs/video.js/blob/master/LICENSE>
|
||||
<% if (includesVtt) { %> *
|
||||
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
||||
* Available under Apache License Version 2.0
|
||||
* <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
|
||||
<% } %> */
|
||||
@@ -0,0 +1,49 @@
|
||||
import _ from 'lodash';
|
||||
/**
|
||||
* Customizes _.merge behavior in `gruntOptions` to concatenate
|
||||
* arrays. This can be overridden on a per-call basis to
|
||||
*
|
||||
* @see https://lodash.com/docs#merge
|
||||
* @function GruntCustomizer
|
||||
* @private
|
||||
* @param {Mixed} objectValue
|
||||
* @param {Mixed} sourceValue
|
||||
* @return {Object}
|
||||
*/
|
||||
function gruntCustomizer(objectValue, sourceValue) {
|
||||
if (Array.isArray(objectValue)) {
|
||||
return objectValue.concat(sourceValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a gruntOptions instance for the specific defaultOptions and gruntCustomizer
|
||||
*
|
||||
* @function browserifyGruntOptions
|
||||
* @private
|
||||
* @param {Object} [options]
|
||||
* @param {Function} [customizer=gruntCustomizer]
|
||||
* If the default array-concatenation behavior is not desireable,
|
||||
* pass _.noop or a unique customizer (https://lodash.com/docs#merge).
|
||||
*
|
||||
* @return {Function}
|
||||
*/
|
||||
function gruntOptionsMaker(defaultOptions, gruntCustomizer) {
|
||||
/**
|
||||
* Creates a unique object of Browserify Grunt task options.
|
||||
*
|
||||
* @function gruntOptions
|
||||
* @private
|
||||
* @param {Object} [options]
|
||||
* @param {Function} [customizer=browserifyGruntCustomizer]
|
||||
* If the default array-concatenation behavior is not desireable,
|
||||
* pass _.noop or a unique customizer (https://lodash.com/docs#merge).
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
return function gruntOptions(options = null, customizer = gruntCustomizer) {
|
||||
return _.merge({}, defaultOptions, options, customizer);
|
||||
}
|
||||
};
|
||||
|
||||
export { gruntCustomizer, gruntOptionsMaker };
|
||||
@@ -0,0 +1,212 @@
|
||||
import { rollup } from 'rollup';
|
||||
import duration from 'humanize-duration';
|
||||
import watch from 'rollup-watch';
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import json from 'rollup-plugin-json';
|
||||
import filesize from 'rollup-plugin-filesize';
|
||||
import progress from 'rollup-plugin-progress';
|
||||
import ignore from 'rollup-plugin-ignore';
|
||||
import uglify from 'rollup-plugin-uglify';
|
||||
import minimist from 'minimist';
|
||||
import _ from 'lodash';
|
||||
import pkg from '../package.json';
|
||||
import fs from 'fs';
|
||||
|
||||
const args = minimist(process.argv.slice(2), {
|
||||
boolean: ['watch', 'minify', 'progress'],
|
||||
default: {
|
||||
progress: true
|
||||
},
|
||||
alias: {
|
||||
w: 'watch',
|
||||
m: 'minify',
|
||||
p: 'progress'
|
||||
}
|
||||
});
|
||||
|
||||
if (args.watch) {
|
||||
args.progress = false;
|
||||
}
|
||||
|
||||
const compiledLicense = _.template(fs.readFileSync('./build/license-header.txt', 'utf8'));
|
||||
const bannerData = _.pick(pkg, ['version', 'copyright']);
|
||||
|
||||
const primedResolve = resolve({
|
||||
jsnext: true,
|
||||
main: true,
|
||||
browser: true
|
||||
});
|
||||
const primedCjs = commonjs({
|
||||
sourceMap: false
|
||||
});
|
||||
const primedBabel = babel({
|
||||
babelrc: false,
|
||||
exclude: 'node_modules/**',
|
||||
presets: [
|
||||
'es3',
|
||||
['es2015', {
|
||||
loose: true,
|
||||
modules: false
|
||||
}]
|
||||
],
|
||||
plugins: ['external-helpers']
|
||||
});
|
||||
|
||||
const es = {
|
||||
options: {
|
||||
entry: 'src/js/video.js',
|
||||
plugins: [
|
||||
json(),
|
||||
primedBabel,
|
||||
args.progress ? progress() : {},
|
||||
filesize()
|
||||
],
|
||||
onwarn(warning) {
|
||||
if (warning.code === 'UNUSED_EXTERNAL_IMPORT' ||
|
||||
warning.code === 'UNRESOLVED_IMPORT') {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(warning.message);
|
||||
},
|
||||
legacy: true
|
||||
},
|
||||
banner: compiledLicense(Object.assign({includesVtt: true}, bannerData)),
|
||||
useStrict: false,
|
||||
format: 'es',
|
||||
dest: 'dist/video.es.js'
|
||||
};
|
||||
|
||||
const cjs = Object.assign({}, es, {
|
||||
format: 'cjs',
|
||||
dest: 'dist/video.cjs.js'
|
||||
});
|
||||
|
||||
const umd = {
|
||||
options: {
|
||||
entry: 'src/js/video.js',
|
||||
plugins: [
|
||||
primedResolve,
|
||||
json(),
|
||||
primedCjs,
|
||||
primedBabel,
|
||||
args.progress ? progress() : {},
|
||||
filesize()
|
||||
],
|
||||
legacy: true
|
||||
},
|
||||
banner: compiledLicense(Object.assign({includesVtt: true}, bannerData)),
|
||||
useStrict: false,
|
||||
format: 'umd',
|
||||
dest: 'dist/video.js'
|
||||
};
|
||||
|
||||
const minifiedUmd = Object.assign({}, _.cloneDeep(umd), {
|
||||
dest: 'dist/video.min.js'
|
||||
});
|
||||
|
||||
minifiedUmd.options.plugins.splice(4, 0, uglify({
|
||||
preserveComments: 'some',
|
||||
screwIE8: false,
|
||||
mangle: true,
|
||||
compress: {
|
||||
/* eslint-disable camelcase */
|
||||
sequences: true,
|
||||
dead_code: true,
|
||||
conditionals: true,
|
||||
booleans: true,
|
||||
unused: true,
|
||||
if_return: true,
|
||||
join_vars: true,
|
||||
drop_console: true
|
||||
/* eslint-enable camelcase */
|
||||
}
|
||||
}));
|
||||
|
||||
const novttUmd = Object.assign({}, _.cloneDeep(umd), {
|
||||
banner: compiledLicense(Object.assign({includesVtt: false}, bannerData)),
|
||||
dest: 'dist/alt/video.novtt.js'
|
||||
});
|
||||
|
||||
novttUmd.options.plugins.unshift(ignore(['videojs-vtt.js']));
|
||||
|
||||
const minifiedNovttUmd = Object.assign({}, _.cloneDeep(minifiedUmd), {
|
||||
banner: compiledLicense(Object.assign({includesVtt: false}, bannerData)),
|
||||
dest: 'dist/alt/video.novtt.min.js'
|
||||
});
|
||||
|
||||
minifiedNovttUmd.options.plugins.unshift(ignore(['videojs-vtt.js']));
|
||||
|
||||
function runRollup({options, useStrict, format, dest, banner}) {
|
||||
rollup(options)
|
||||
.then(function(bundle) {
|
||||
bundle.write({
|
||||
useStrict,
|
||||
format,
|
||||
dest,
|
||||
banner,
|
||||
moduleName: 'videojs',
|
||||
sourceMap: false
|
||||
});
|
||||
}, function(err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
if (!args.watch) {
|
||||
if (args.minify) {
|
||||
runRollup(minifiedUmd);
|
||||
runRollup(minifiedNovttUmd);
|
||||
} else {
|
||||
runRollup(es);
|
||||
runRollup(cjs);
|
||||
runRollup(umd);
|
||||
runRollup(novttUmd);
|
||||
}
|
||||
} else {
|
||||
const props = ['format', 'dest', 'banner', 'useStrict'];
|
||||
const watchers = [
|
||||
['es', watch({rollup},
|
||||
Object.assign({},
|
||||
es.options,
|
||||
_.pick(es, props)))],
|
||||
['cjs', watch({rollup},
|
||||
Object.assign({},
|
||||
cjs.options,
|
||||
_.pick(cjs, props)))],
|
||||
['umd', watch({rollup},
|
||||
Object.assign({moduleName: 'videojs'},
|
||||
umd.options,
|
||||
_.pick(umd, props)))],
|
||||
['novtt', watch({rollup},
|
||||
Object.assign({moduleName: 'videojs'},
|
||||
novttUmd.options,
|
||||
_.pick(novttUmd, props)))]
|
||||
];
|
||||
|
||||
watchers.forEach(function([type, watcher]) {
|
||||
watcher.on('event', (details) => {
|
||||
if (details.code === 'BUILD_START') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Bundling ${type}...`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (details.code === 'BUILD_END') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Bundled ${type} in %s`, duration(details.duration));
|
||||
return;
|
||||
}
|
||||
|
||||
if (details.code === 'ERROR') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(details.error.toString());
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
// This file is used to load the video.js source files into a page
|
||||
// in the correct order based on dependencies.
|
||||
// When you create a new source file you will need to add
|
||||
// it to the list below to use it in sandbox/index.html and
|
||||
// test/index.html
|
||||
|
||||
// You can use the projectRoot variable to adjust relative urls
|
||||
// that this script loads. By default it's "../", which is what /sandbox
|
||||
// and /test need. If you had sandbox/newDir/index.html, in index.html you
|
||||
// would set projectRoot = "../../"
|
||||
|
||||
// We could use somehting like requireJS to load files, and at one point
|
||||
// we used goog.require/provide to load dependencies, but that seems like
|
||||
// overkill with the small number of files we actually have.
|
||||
|
||||
// ADD NEW SOURCE FILES HERE
|
||||
var sourceFiles = [
|
||||
"src/js/core.js",
|
||||
"src/js/core-object.js",
|
||||
"src/js/events.js",
|
||||
"src/js/lib.js",
|
||||
"src/js/util.js",
|
||||
"src/js/component.js",
|
||||
"src/js/button.js",
|
||||
"src/js/slider.js",
|
||||
"src/js/menu.js",
|
||||
"src/js/media-error.js",
|
||||
"src/js/fullscreen-api.js",
|
||||
"src/js/player.js",
|
||||
"src/js/control-bar/control-bar.js",
|
||||
"src/js/control-bar/live-display.js",
|
||||
"src/js/control-bar/play-toggle.js",
|
||||
"src/js/control-bar/time-display.js",
|
||||
"src/js/control-bar/fullscreen-toggle.js",
|
||||
"src/js/control-bar/progress-control.js",
|
||||
"src/js/control-bar/volume-control.js",
|
||||
"src/js/control-bar/mute-toggle.js",
|
||||
"src/js/control-bar/volume-menu-button.js",
|
||||
"src/js/control-bar/playback-rate-menu-button.js",
|
||||
"src/js/poster.js",
|
||||
"src/js/loading-spinner.js",
|
||||
"src/js/big-play-button.js",
|
||||
"src/js/error-display.js",
|
||||
"src/js/media/media.js",
|
||||
"src/js/media/html5.js",
|
||||
"src/js/media/flash.js",
|
||||
"src/js/media/loader.js",
|
||||
"src/js/tracks.js",
|
||||
"src/js/json.js",
|
||||
"src/js/setup.js",
|
||||
"src/js/plugins.js"
|
||||
];
|
||||
|
||||
// Allow overriding the default project root
|
||||
var projectRoot = projectRoot || '../';
|
||||
|
||||
function loadScripts(scriptsArr){
|
||||
for (var i = 0; i < scriptsArr.length; i++) {
|
||||
// Using document.write because that's the easiest way to avoid triggering
|
||||
// asynchrnous script loading
|
||||
document.write( "<script src='" + projectRoot + scriptsArr[i] + "'><\/script>" );
|
||||
}
|
||||
}
|
||||
|
||||
// We use this file in the grunt build script to load the same source file list
|
||||
// and don't want to load the scripts there.
|
||||
if (typeof blockSourceLoading === 'undefined') {
|
||||
loadScripts(sourceFiles);
|
||||
|
||||
// Allow for making Flash first
|
||||
if (window.location.href.indexOf("?flash") !== -1) {
|
||||
// Using doc.write to load this script to, otherwise when it runs videojs
|
||||
// is undefined
|
||||
document.write('<script>videojs.options.techOrder = ["flash"];videojs.options.flash.swf = "../src/swf/video-js.swf";</script>')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = function(grunt) {
|
||||
grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){
|
||||
let doc = grunt.file.read('docs/guides/setup.md');
|
||||
let version = require('../../package.json').version;
|
||||
|
||||
// remove the patch version to point to the latest patch
|
||||
version = version.replace(/(\d+\.\d+)\.\d+/, '$1');
|
||||
|
||||
// update the version in http://vjs.zencdn.net/4.3/video.js
|
||||
doc = doc.replace(/(\/\/vjs\.zencdn\.net\/)\d+\.\d+(\.\d+)?/g, '$1'+version);
|
||||
grunt.file.write('docs/guides/setup.md', doc);
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
module.exports = function(grunt) {
|
||||
grunt.registerTask('check-translations', 'Check that translations are up to date', function(){
|
||||
const source = require('../../lang/en.json');
|
||||
const table = require('markdown-table');
|
||||
let doc = grunt.file.read('docs/translations-needed.md');
|
||||
const tableRegex = /(<!-- START langtable -->)(.|\n)*(<!-- END langtable -->)/;
|
||||
let tableData = [['Language file', 'Missing translations']];
|
||||
|
||||
grunt.file.recurse('lang', (abspath, rootdir, subdir, filename) => {
|
||||
if (filename === 'en.json') {
|
||||
return;
|
||||
}
|
||||
const target = require(`../../${abspath}`);
|
||||
let missing = [];
|
||||
for (const string in source) {
|
||||
if (!target[string]) {
|
||||
grunt.log.writeln(`${filename} missing "${string}"`);
|
||||
missing.push(string);
|
||||
}
|
||||
}
|
||||
if (missing.length > 0) {
|
||||
grunt.log.error(`${filename} is missing ${missing.length} translations.`);
|
||||
tableData.push([`${filename} (missing ${missing.length})`, missing[0]]);
|
||||
for (var i = 1; i < missing.length; i++) {
|
||||
tableData.push(['', missing[i]]);
|
||||
}
|
||||
} else {
|
||||
grunt.log.ok(`${filename} is up to date.`);
|
||||
tableData.push([`${filename} (Complete)`, '']);
|
||||
}
|
||||
});
|
||||
doc = doc.replace(tableRegex, `$1\n` + table(tableData) + `\n$3`);
|
||||
grunt.file.write('docs/translations-needed.md', doc);
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const klawSync = require('klaw-sync');
|
||||
|
||||
module.exports = function(grunt) {
|
||||
grunt.registerTask('sandbox', 'copy over sandbox example files if necessary', function() {
|
||||
const files = klawSync('sandbox/').filter((file) => path.extname(file.path) === '.example');
|
||||
|
||||
const changes = files.map(function(file) {
|
||||
const p = path.parse(file.path);
|
||||
const nonExample = path.join(p.dir, p.name);
|
||||
return {
|
||||
file: file.path,
|
||||
copy: nonExample
|
||||
};
|
||||
})
|
||||
.filter(function(change) {
|
||||
return !fs.existsSync(change.copy);
|
||||
});
|
||||
|
||||
changes.forEach(function(change) {
|
||||
grunt.file.copy(change.file, change.copy);
|
||||
});
|
||||
|
||||
if (changes.length) {
|
||||
grunt.log.writeln("Updated Sandbox files for:");
|
||||
grunt.log.writeln('\t' + changes.map((chg) => chg.copy).join('\n\t'));
|
||||
} else {
|
||||
grunt.log.writeln("No sandbox updates necessary");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
module.exports = function(grunt) {
|
||||
grunt.registerTask('addStyleInjection', 'Adding base style injection', function() {
|
||||
let minifiedCss = grunt.file.read('build/files/video-js.min.css');
|
||||
// We need to escape any strings
|
||||
minifiedCss = minifiedCss.replace(/'/g, '\\\'');
|
||||
|
||||
let combinedJs = grunt.file.read('build/files/combined.video.js');
|
||||
combinedJs = combinedJs.replace(/\{{GENERATED_STYLES}}/g, minifiedCss);
|
||||
grunt.file.write('build/files/combined.video.js', combinedJs);
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
module.exports = function(grunt) {
|
||||
// You can specify which browsers to build with by using grunt-style arguments
|
||||
// or separating them with a comma:
|
||||
// grunt test:chrome:firefox # grunt-style
|
||||
// grunt test:chrome,firefox # comma-separated
|
||||
grunt.registerTask('test-local', function() {
|
||||
let tasks = this.args;
|
||||
let tasksMinified;
|
||||
|
||||
// if we aren't running this in a CI, but running it manually, we can
|
||||
// supply arguments to this task. These arguments are either colon (`:`)
|
||||
// separated which is the default grunt separator for arguments, or they
|
||||
// are comma (`,`) separated to make it easier.
|
||||
// The arguments are the names of which browsers you want.
|
||||
if (tasks.length === 0) {
|
||||
tasks.push('chrome');
|
||||
}
|
||||
if (tasks.length === 1) {
|
||||
tasks = tasks[0].split(',');
|
||||
}
|
||||
|
||||
tasks = tasks.map((task) => `karma:${task}`);
|
||||
|
||||
grunt.task.run(tasks);
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
module.exports = function(grunt) {
|
||||
grunt.registerTask('vjs-version', function() {
|
||||
let version = grunt.vjsVersion.full;
|
||||
grunt.log.writeln(version);
|
||||
return version;
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
var safeParse = require("safe-json-parse/tuple");
|
||||
var tuple = safeParse(process.env.npm_config_argv);
|
||||
var npm_config_argv = tuple[1]
|
||||
|
||||
if (tuple[0]) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var sh = require('shelljs');
|
||||
var prereleaseType = npm_config_argv['remain'][0];
|
||||
var approvedTypes = {
|
||||
'major': 1,
|
||||
'minor': 1,
|
||||
'patch': 1
|
||||
}
|
||||
|
||||
if (prereleaseType in approvedTypes) {
|
||||
sh.exec('npm run changelog');
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "video.js",
|
||||
"description": "An HTML5 and Flash video player with a common API and skin for both.",
|
||||
"version": "4.10.1",
|
||||
"keywords": [
|
||||
"videojs",
|
||||
"html5",
|
||||
"flash",
|
||||
"video",
|
||||
"player"
|
||||
],
|
||||
"scripts": ["dist/video-js/video.dev.js"],
|
||||
"styles": ["dist/video-js/video-js.css"],
|
||||
"files": ["dist/video-js/video-js.swf"],
|
||||
"fonts": [
|
||||
"dist/video-js/font/vjs.eot",
|
||||
"dist/video-js/font/vjs.svg",
|
||||
"dist/video-js/font/vjs.ttf",
|
||||
"dist/video-js/font/vjs.woff"
|
||||
],
|
||||
"main": "dist/video-js/video.dev.js"
|
||||
}
|
||||
-269
@@ -1,269 +0,0 @@
|
||||
{
|
||||
"project": {
|
||||
"owner": "videojs",
|
||||
"name": "video.js",
|
||||
"requirements": [
|
||||
{
|
||||
"name": "git",
|
||||
"info": "http://git-scm.com"
|
||||
},
|
||||
{
|
||||
"name": "node.js",
|
||||
"info": "http://nodejs.org"
|
||||
}
|
||||
],
|
||||
"urls": {
|
||||
"git": "https://github.com/videojs/video.js.git",
|
||||
"repo_api": "https://api.github.com/repos/videojs/video.js",
|
||||
"repo_ui": "https://github.com/videojs/video.js"
|
||||
},
|
||||
"branches": {
|
||||
"development": "master",
|
||||
"release": "stable"
|
||||
}
|
||||
},
|
||||
|
||||
"install": [
|
||||
[ "git fetch origin", "Get all git branches" ],
|
||||
[ "git checkout -b stable origin/stable", "Create the stable branch for patches" ],
|
||||
[ "git remote add upstream {{project.urls.git}}", "Add the upstream project as a remote for pulling changes" ],
|
||||
[ "git fetch upstream", "Get all upstream branches and changes" ],
|
||||
{ "include": "update all" }
|
||||
],
|
||||
|
||||
"update": {
|
||||
"all": {
|
||||
"steps": [
|
||||
{ "include": "update stable" },
|
||||
{ "include": "update master" },
|
||||
[ "npm install", "Download dependencies"],
|
||||
[ "grunt", "Build the library" ]
|
||||
]
|
||||
},
|
||||
"master": {
|
||||
"steps": [
|
||||
[ "git checkout master", "Switch to the development branch" ],
|
||||
[ "git pull upstream master", "Get any changes to master in the main project" ],
|
||||
[ "git push origin master", "Push any changes to your copy of the main project" ]
|
||||
]
|
||||
},
|
||||
"stable": {
|
||||
"steps": [
|
||||
[ "git checkout stable", "Switch to the release branch" ],
|
||||
[ "git pull upstream stable", "Get any changes to stable in the main project" ],
|
||||
[ "git push origin stable", "Push any changes to your copy of the main project" ]
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"test": "grunt test" ,
|
||||
"watch": "grunt watch",
|
||||
"server": "grunt connect",
|
||||
|
||||
"feature": {
|
||||
"desc": "Create a new feature or general enhancement",
|
||||
"baseBranch": "master",
|
||||
"start": {
|
||||
"desc": "Start a new feature",
|
||||
"steps": [
|
||||
{ "include": "update {{project.branches.development}}" },
|
||||
{ "include": "branch start" }
|
||||
]
|
||||
},
|
||||
"submit": {
|
||||
"desc": "Submit a pull request for a feature when it's finished",
|
||||
"steps": [
|
||||
{ "include": "branch submit" }
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"desc": "Delete the current feature branch",
|
||||
"steps": [
|
||||
{ "include": "branch delete" }
|
||||
]
|
||||
},
|
||||
"accept": {
|
||||
"steps": [
|
||||
{ "include": "update {{project.branches.development}}" },
|
||||
{ "include": "pull_request accept" }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"patch": {
|
||||
"desc": "Create an urgent fix for the latest stable version",
|
||||
"baseBranch": "stable",
|
||||
"start": {
|
||||
"desc": "Start a new patch",
|
||||
"finished": "Make your changes and then run `contrib patch submit`",
|
||||
"steps": [
|
||||
{ "include": "update {{project.branches.release}}" },
|
||||
{ "include": "branch start" }
|
||||
]
|
||||
},
|
||||
"submit": {
|
||||
"desc": "Submit a pull request for a patch when it's finished",
|
||||
"steps": [
|
||||
{ "include": "branch submit" }
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"desc": "Delete the current patch branch",
|
||||
"steps": [
|
||||
{ "include": "branch delete" }
|
||||
]
|
||||
},
|
||||
"accept": {
|
||||
"steps": [
|
||||
{ "include": "update {{project.branches.release}}" },
|
||||
{ "include": "pull_request accept" }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"report": {
|
||||
"desc": "Submit a bug report",
|
||||
"steps": [
|
||||
{ "prompt": "text", "desc": "Create a title that is descriptive of the problem", "id": "title" },
|
||||
{ "prompt": "text", "desc": "What did you do? (steps to reproduce)", "id": "reproduce" },
|
||||
{ "prompt": "text", "desc": "What did you expect to happen?", "id": "expected" },
|
||||
{ "prompt": "text", "desc": "What actually happened?", "id": "actual" },
|
||||
{ "prompt": "text", "desc": "What version of video.js are you using?", "id": "version" },
|
||||
{ "prompt": "text", "desc": "Are you using any video.js plugins?", "id": "plugins" },
|
||||
{ "prompt": "text", "desc": "What browsers/platforms did you experience this in (e.g. Win 7, IE10; Android 4, Chrome;)?", "id": "browsers" },
|
||||
{ "prompt": "text", "desc": "Is there a URL to a live example, or a jsbin (e.g. http://jsbin.com/axedog/9999/edit)?", "id": "example" },
|
||||
{ "prompt": "text", "desc": "Are there any other details you'd like to provide?", "id": "details" },
|
||||
{ "open": "{{project.urls.repo_ui}}/issues/new?title={{title}}&body=**Steps to reproduce:**\n> {{reproduce}}\n\n**What was expected:**\n> {{expected}}\n\n**What Happened:**\n> {{actual}}\n\n**Video.js Version:**\n> {{version}}\n\n**Plugins:**\n> {{plugins}}\n\n**Browsers experienced on:**\n> {{browsers}}\n\n**Example:**\n> {{example}}\n\n**Other details:**\n> {{details}}" }
|
||||
],
|
||||
"finished": "Thanks for submitting a bug report! One of our contributors will address it as soon as possible."
|
||||
},
|
||||
|
||||
"request": {
|
||||
"desc": "Submit a feature/enhancement request",
|
||||
"steps": [
|
||||
{ "prompt": "text", "desc": "Create a title that is descriptive of the enhancement", "id": "title" },
|
||||
{ "prompt": "text", "desc": "Describe the feature/enhancement (be as detailed as possible so it's clear who, why, and how it would be used)", "id": "describe" },
|
||||
{ "prompt": "text", "desc": "Is there any existing documentation or related specifications?", "id": "docs" },
|
||||
{ "prompt": "text", "desc": "Are there any existing examples?", "id": "examples" },
|
||||
{ "prompt": "confirm", "desc": "You will be redirected to Github where you can submit this issue, OK?" },
|
||||
{ "open": "{{project.urls.repo_ui}}/issues/new?title={{ title }}&body=**Describe the feature/enhancement:**\n> {{ describe }}\n\n**Existing docs/specs:**\n> {{ docs }}\n\n**Existing examples:**\n> {{ examples }}" }
|
||||
],
|
||||
"finished": "Thanks for submitting a feature request! One of our contributors will address it as soon as possible."
|
||||
},
|
||||
|
||||
"release": {
|
||||
"desc": "Create and publish a release",
|
||||
"steps": [
|
||||
[ "git diff --exit-code", "Ensure there's no unadded changes" ],
|
||||
[ "git diff --cached --exit-code", "Ensure there's no added changes" ],
|
||||
{ "prompt": "confirm", "desc": "Have the changes been merged into the release branch (stable)?" },
|
||||
{ "prompt": "text", "desc": "Provide the release type (major, minor, patch)", "id": "type" },
|
||||
[ "git checkout stable", "Checkout the release branch" ],
|
||||
[ "git pull upstream stable", "Update the release branch" ],
|
||||
[ "grunt test", "Run tests" ],
|
||||
[ "grunt chg-release:{{ type }}", "Update the changelog with the new release" ],
|
||||
[ "grunt version:{{ type }}", "Bump package versions" ],
|
||||
[ "grunt", "Build the release" ],
|
||||
[ "git add dist/video-js --force", "Add the (otherwise ignored) release files" ],
|
||||
[ "grunt vjsdocs", "Rebuild the docs" ],
|
||||
[ "grunt cdn-links", "Update the cdn urls in the docs" ],
|
||||
[ "grunt tagrelease", "Tag the release" ],
|
||||
[ "git push upstream stable", "Push changes to the remote" ],
|
||||
[ "git push upstream --tags", "Push tags to the remote" ],
|
||||
[ "npm publish", "Publish to npm" ],
|
||||
[ "git checkout master", "Checkout the development branch" ],
|
||||
[ "git pull upstream master", "Update the development branch" ],
|
||||
[ "git merge stable", "Merge changes" ],
|
||||
[ "grunt clean:dist", "Remove built dist files to re-ignore them" ],
|
||||
[ "git add -u", "Add the changes for the removed dist files" ],
|
||||
[ "git commit -m 'Removed dist files'", "Commit the removed dist files" ],
|
||||
[ "git push upstream master", "Push development branch changes" ]
|
||||
]
|
||||
},
|
||||
|
||||
"branch": {
|
||||
"private": true,
|
||||
"start": {
|
||||
"steps": [
|
||||
{ "prompt": "text", "desc": "Name the branch", "id": "name" },
|
||||
[ "git checkout -b {{name}} {{baseBranch}}", "Create the branch" ],
|
||||
[ "git push -u origin {{name}}", "Push the branch to your remote copy of the project" ]
|
||||
]
|
||||
},
|
||||
"submit": {
|
||||
"desc": "Submit a pull request for when the change is finished",
|
||||
"steps": [
|
||||
{ "exec": "git diff --exit-code", "desc": "Test for unadded changes {{ args.[0] }}", "fail": "Make sure all changes have been added and committed, or stashed, before switching branches" },
|
||||
{ "exec": "git diff --cached --exit-code", "desc": "Test for uncommitted changes", "fail": "Make sure all changes have been added and committed, or stashed, before switching branches" },
|
||||
{ "include": "test" },
|
||||
{ "exec": "git rev-parse --abbrev-ref HEAD", "desc": "Get the current branch", "id": "branch" },
|
||||
{ "prompt": "confirm", "desc": "Are you sure {{branch}} is the branch you want to submit?" },
|
||||
{ "prompt": "text", "desc": "Which github user or org are you submitting from?", "id": "user" },
|
||||
{ "open": "{{project.urls.repo_ui}}/compare/videojs:{{baseBranch}}...{{user}}:{{branch}}", "desc": "Open the github pull request page" }
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"desc": "Delete the current branch",
|
||||
"steps": [
|
||||
{ "exec": "git rev-parse --abbrev-ref HEAD", "desc": "Get the current branch name", "id": "name" },
|
||||
{ "prompt": "confirm", "desc": "Are you sure '{{name}}' is the branch you want to delete?" },
|
||||
{ "exec": "git branch -D {{name}}", "desc": "Delete the local copy of the branch" },
|
||||
{ "exec": "git push origin :{{name}}", "desc": "Delete the remote copy of the branch" }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"pull_request": {
|
||||
"private": true,
|
||||
|
||||
"review": {
|
||||
"steps": [
|
||||
{ "prompt": "text", "desc": "What is the the pull request number?", "id": "prNum" },
|
||||
{ "get": "{{project.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
|
||||
[ "git fetch {{pr.head.repo.ssh_url}} {{pr.head.ref}}", "Get the pull request changes but don't merge them" ],
|
||||
[ "git merge-base master FETCH_HEAD", "Get the common ancestor commit", "base" ],
|
||||
[ "git checkout -b review-{{pr.user.login}}-{{pr.head.ref}} {{base}}", "Create a new local branch for the pull request that has a base of the common commit" ],
|
||||
[ "git merge FETCH_HEAD", "Merge in the pull request changes" ],
|
||||
[ "grunt test", "Build and run tests" ]
|
||||
]
|
||||
},
|
||||
|
||||
"modify": {
|
||||
"desc": "Submit a modification to an existing pull request",
|
||||
"steps": [
|
||||
{ "exec": "git diff --exit-code", "desc": "Test for unadded changes", "fail": "Make sure all changes have been added and committed before submitting changes" },
|
||||
{ "exec": "git diff --cached --exit-code", "desc": "Test for uncommitted changes", "fail": "Make sure all changes have been committed before submitting changes" },
|
||||
{ "include": "test" },
|
||||
{ "exec": "git rev-parse --abbrev-ref HEAD", "desc": "Get the current branch", "id": "branch" },
|
||||
{ "prompt": "confirm", "desc": "Are you sure {{branch}} is the branch you want to submit?" },
|
||||
{ "prompt": "text", "desc": "Which github user or org are you submitting from?", "id": "user" },
|
||||
{ "prompt": "text", "desc": "What is the the pull request number?", "id": "prNum" },
|
||||
{ "get": "{{project.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
|
||||
{ "exec": "git push -u origin {{branch}}", "desc": "Push the changes to the remote repo" },
|
||||
{ "open": "https://github.com/{{user}}/video.js/compare/{{pr.head.label}}...{{user}}:{{branch}}", "desc": "Open the github pull request page" }
|
||||
]
|
||||
},
|
||||
|
||||
"accept": {
|
||||
"steps": [
|
||||
{ "prompt": "text", "desc": "What is the the pull request number?", "id": "prNum" },
|
||||
{ "get": "{{project.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
|
||||
{ "get": "{{project.urls.repo_api}}/pulls/{{prNum}}/commits", "desc": "Get the PR commits to access author info", "id": "prCommits" },
|
||||
[ "git checkout -b {{pr.user.login}}-{{pr.head.ref}} {{pr.base.ref}}", "Create a new branch for merging the changes" ],
|
||||
[ "git fetch {{pr.head.repo.ssh_url}} {{pr.head.ref}}", "Fetch the changes" ],
|
||||
[ "git merge --no-commit --squash FETCH_HEAD", "Merge the changes in without committing so they can be squashed" ],
|
||||
[ "grunt test", "Run tests to make sure they still pass" ],
|
||||
{ "prompt": "text", "desc": "Describe this change in one line", "id": "line" },
|
||||
[ "grunt chg-add:'{{line}} ([view](https\\://github.com/videojs/video.js/pull/{{prNum}}))'", "Add a line to the changelog" ],
|
||||
[ "git add CHANGELOG.md", "Add the changlelog change to be committed" ],
|
||||
[ "git commit -a --author='{{prCommits.[0].commit.author.name}} <{{prCommits.[0].commit.author.email}}>' -m '{{line}}. closes #{{prNum}}'", "Commit the changes" ],
|
||||
{ "prompt": "confirm", "desc": "Does everything look ok?" },
|
||||
[ "git checkout {{pr.base.ref}}", "Check out the base branch" ],
|
||||
[ "git merge {{pr.user.login}}-{{pr.head.ref}}", "Merge the changes" ],
|
||||
[ "git push origin {{pr.base.ref}}", "Push the changes to your remote copy of the project" ],
|
||||
[ "git push upstream {{pr.base.ref}}", "Push the changes to the main project" ],
|
||||
[ "git branch -D {{pr.user.login}}-{{pr.head.ref}}", "Delete the local branch used for merging" ]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
externo
-41
@@ -1,41 +0,0 @@
|
||||
WEBVTT
|
||||
|
||||
00:00.700 --> 00:04.110
|
||||
Captions describe all relevant audio for the hearing impaired.
|
||||
[ Heroic music playing for a seagull ]
|
||||
|
||||
00:04.500 --> 00:05.000
|
||||
[ Splash!!! ]
|
||||
|
||||
00:05.100 --> 00:06.000
|
||||
[ Sploosh!!! ]
|
||||
|
||||
00:08.000 --> 00:09.225
|
||||
[ Splash...splash...splash splash splash ]
|
||||
|
||||
00:10.525 --> 00:11.255
|
||||
[ Splash, Sploosh again ]
|
||||
|
||||
00:13.500 --> 00:14.984
|
||||
Dolphin: eeeEEEEEeeee!
|
||||
|
||||
00:14.984 --> 00:16.984
|
||||
Dolphin: Squawk! eeeEEE?
|
||||
|
||||
00:25.000 --> 00:28.284
|
||||
[ A whole ton of splashes ]
|
||||
|
||||
00:29.500 --> 00:31.000
|
||||
Mine. Mine. Mine.
|
||||
|
||||
00:34.300 --> 00:36.000
|
||||
Shark: Chomp
|
||||
|
||||
00:36.800 --> 00:37.900
|
||||
Shark: CHOMP!!!
|
||||
|
||||
00:37.861 --> 00:41.193
|
||||
EEEEEEOOOOOOOOOOWHALENOISE
|
||||
|
||||
00:42.593 --> 00:45.611
|
||||
[ BIG SPLASH ]
|
||||
externo
-32
@@ -1,32 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Video.js | HTML5 Video Player</title>
|
||||
|
||||
<!-- Chang URLs to wherever Video.js files will be hosted -->
|
||||
<link href="video-js.css" rel="stylesheet" type="text/css">
|
||||
<!-- video.js must be in the <head> for older IEs to work. -->
|
||||
<script src="video.js"></script>
|
||||
|
||||
<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
|
||||
<script>
|
||||
videojs.options.flash.swf = "video-js.swf";
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264"
|
||||
poster="http://video-js.zencoder.com/oceans-clip.png"
|
||||
data-setup="{}">
|
||||
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
|
||||
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
|
||||
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
|
||||
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<track kind="subtitles" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
|
||||
</video>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
externo
BIN
Arquivo binário não exibido.
externo
-28
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!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">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="icomoon" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " d="" horiz-adv-x="512" />
|
||||
<glyph unicode="" d="M1024 960v-416l-160 160-192-192-96 96 192 192-160 160zM448 288l-192-192 160-160h-416v416l160-160 192 192z" />
|
||||
<glyph unicode="" d="M192 832l640-384-640-384z" />
|
||||
<glyph unicode="" d="M128 832h320v-768h-320zM576 832h320v-768h-320z" />
|
||||
<glyph unicode="" d="M401.332 881.332c25.668 25.668 46.668 16.968 46.668-19.332v-828c0-36.3-21-44.998-46.668-19.33l-241.332 241.33h-160v384h160l241.332 241.332z" />
|
||||
<glyph unicode="" d="M549.020 218.98c-12.286 0-24.568 4.686-33.942 14.058-18.746 18.746-18.746 49.136 0 67.882 81.1 81.1 81.1 213.058 0 294.156-18.746 18.746-18.746 49.138 0 67.882 18.746 18.744 49.136 18.744 67.882 0 118.53-118.53 118.53-311.392 0-429.922-9.372-9.37-21.656-14.056-33.94-14.056zM401.332 881.332c25.668 25.668 46.668 16.968 46.668-19.332v-828c0-36.3-21-44.998-46.668-19.33l-241.332 241.33h-160v384h160l241.332 241.332z" />
|
||||
<glyph unicode="" d="M719.53 128.47c-12.286 0-24.568 4.686-33.942 14.058-18.744 18.744-18.744 49.136 0 67.882 131.006 131.006 131.006 344.17 0 475.176-18.744 18.746-18.744 49.138 0 67.882 18.744 18.742 49.138 18.744 67.882 0 81.594-81.592 126.53-190.076 126.53-305.468 0-115.39-44.936-223.876-126.53-305.47-9.372-9.374-21.656-14.060-33.94-14.060zM549.020 218.98c-12.286 0-24.568 4.686-33.942 14.058-18.746 18.746-18.746 49.136 0 67.882 81.1 81.1 81.1 213.058 0 294.156-18.746 18.746-18.746 49.138 0 67.882 18.746 18.744 49.136 18.744 67.882 0 118.53-118.53 118.53-311.392 0-429.922-9.372-9.37-21.656-14.056-33.94-14.056zM401.332 881.332c25.668 25.668 46.668 16.968 46.668-19.332v-828c0-36.3-21-44.998-46.668-19.33l-241.332 241.33h-160v384h160l241.332 241.332z" />
|
||||
<glyph unicode="" d="M890.040 37.96c-12.286 0-24.568 4.686-33.942 14.058-18.744 18.746-18.744 49.136 0 67.882 87.638 87.642 135.904 204.16 135.904 328.1 0 123.938-48.266 240.458-135.904 328.098-18.744 18.746-18.744 49.138 0 67.882 18.744 18.744 49.138 18.744 67.882 0 105.77-105.772 164.022-246.4 164.022-395.98 0-149.582-58.252-290.208-164.022-395.98-9.372-9.374-21.656-14.060-33.94-14.060zM719.53 128.47c-12.286 0-24.568 4.686-33.942 14.058-18.744 18.744-18.744 49.136 0 67.882 131.006 131.006 131.006 344.17 0 475.176-18.744 18.746-18.744 49.138 0 67.882 18.744 18.742 49.138 18.744 67.882 0 81.594-81.592 126.53-190.076 126.53-305.468 0-115.39-44.936-223.876-126.53-305.47-9.372-9.374-21.656-14.060-33.94-14.060zM549.020 218.98c-12.286 0-24.568 4.686-33.942 14.058-18.746 18.746-18.746 49.136 0 67.882 81.1 81.1 81.1 213.058 0 294.156-18.746 18.746-18.746 49.138 0 67.882 18.746 18.744 49.136 18.744 67.882 0 118.53-118.53 118.53-311.392 0-429.922-9.372-9.37-21.656-14.056-33.94-14.056zM401.332 881.332c25.668 25.668 46.668 16.968 46.668-19.332v-828c0-36.3-21-44.998-46.668-19.33l-241.332 241.33h-160v384h160l241.332 241.332z" horiz-adv-x="1088" />
|
||||
<glyph unicode="" d="M512 960l-320-512 320-512 320 512z" />
|
||||
<glyph unicode="" d="M0 960h1374.316v-1030.414h-1374.316v1030.414zM1245.462 449.276c-1.706 180.052-8.542 258.568-51.2 314.036-7.68 11.946-22.186 18.772-34.132 27.296-41.814 30.73-238.944 41.814-467.636 41.814-228.702 0-435.21-11.084-476.17-41.814-12.8-8.524-27.316-15.35-35.84-27.296-41.822-55.468-47.786-133.984-50.346-314.036 2.56-180.062 8.524-258.57 50.346-314.036 8.524-12.8 23.040-18.774 35.84-27.306 40.96-31.574 247.468-41.814 476.17-43.52 228.692 1.706 425.822 11.946 467.636 43.52 11.946 8.532 26.452 14.506 34.132 27.306 42.658 55.466 49.494 133.974 51.2 314.036zM662.358 495.904c-11.58 140.898-86.51 223.906-220.556 223.906-122.458 0-218.722-110.432-218.722-287.88 0-178.212 87.73-289.396 232.734-289.396 115.766 0 196.798 85.298 209.588 226.95h-138.302c-5.48-52.548-27.414-92.914-73.72-92.914-73.108 0-86.51 72.354-86.51 149.27 0 105.868 30.46 159.932 81.032 159.932 45.082 0 73.718-32.75 77.976-89.868h136.48zM1140.026 495.904c-11.57 140.898-86.51 223.906-220.546 223.906-122.466 0-218.722-110.432-218.722-287.88 0-178.212 87.73-289.396 232.734-289.396 115.758 0 196.788 85.298 209.58 226.95h-138.304c-5.47-52.548-27.404-92.914-73.71-92.914-73.116 0-86.518 72.354-86.518 149.27 0 105.868 30.468 159.932 81.030 159.932 45.084 0 73.728-32.75 77.986-89.868h136.47z" horiz-adv-x="1374" />
|
||||
<glyph unicode="" d="M128 832h768v-768h-768z" />
|
||||
<glyph unicode="" d="M384 832c0-70.692 57.308-128 128-128s128 57.308 128 128c0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM655.53 719.53c0-70.692 57.308-128 128-128s128 57.308 128 128c0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM832 448c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64zM719.53 176.47c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64zM448.002 64c0 0 0 0 0 0 0-35.346 28.654-64 64-64 35.346 0 64 28.654 64 64 0 0 0 0 0 0 0 0 0 0 0 0 0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64s0 0 0 0zM176.472 176.47c0 0 0 0 0 0 0-35.346 28.654-64 64-64 35.346 0 64 28.654 64 64 0 0 0 0 0 0 0 0 0 0 0 0 0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64s0 0 0 0zM144.472 719.53c0 0 0 0 0 0 0-53.019 42.981-96 96-96 53.019 0 96 42.981 96 96 0 0 0 0 0 0 0 0 0 0 0 0 0 53.019-42.981 96-96 96-53.019 0-96-42.981-96-96s0 0 0 0zM56 448c0-39.765 32.235-72 72-72s72 32.235 72 72c0 39.765-32.235 72-72 72-39.765 0-72-32.235-72-72z" />
|
||||
<glyph unicode="" d="M448 384v-416l-160 160-192-192-96 96 192 192-160 160zM1024 864l-192-192 160-160h-416v416l160-160 192 192z" />
|
||||
<glyph unicode="" d="M512 896c282.77 0 512-186.25 512-416 0-229.752-229.23-416-512-416-27.156 0-53.81 1.734-79.824 5.044-109.978-109.978-241.25-129.7-368.176-132.596v26.916c68.536 33.578 128 94.74 128 164.636 0 9.754-0.758 19.33-2.164 28.696-115.796 76.264-189.836 192.754-189.836 323.304 0 229.75 229.23 416 512 416z" />
|
||||
<glyph unicode="" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512 704c141.384 0 256-114.616 256-256s-114.616-256-256-256-256 114.616-256 256 114.616 256 256 256zM817.47 142.53c-81.594-81.594-190.080-126.53-305.47-126.53-115.392 0-223.876 44.936-305.47 126.53-81.594 81.594-126.53 190.078-126.53 305.47 0 115.39 44.936 223.876 126.53 305.47l67.882-67.882c0 0 0 0 0 0-131.006-131.006-131.006-344.17 0-475.176 63.462-63.462 147.838-98.412 237.588-98.412 89.748 0 174.124 34.95 237.588 98.412 131.006 131.006 131.006 344.168 0 475.176l67.882 67.882c81.594-81.594 126.53-190.080 126.53-305.47 0-115.392-44.936-223.876-126.53-305.47z" />
|
||||
<glyph unicode="" d="M864 256c-45.16 0-85.92-18.738-115.012-48.83l-431.004 215.502c1.314 8.252 2.016 16.706 2.016 25.328s-0.702 17.076-2.016 25.326l431.004 215.502c29.092-30.090 69.852-48.828 115.012-48.828 88.366 0 160 71.634 160 160s-71.634 160-160 160-160-71.634-160-160c0-8.622 0.704-17.076 2.016-25.326l-431.004-215.504c-29.092 30.090-69.852 48.83-115.012 48.83-88.366 0-160-71.636-160-160 0-88.368 71.634-160 160-160 45.16 0 85.92 18.738 115.012 48.828l431.004-215.502c-1.312-8.25-2.016-16.704-2.016-25.326 0-88.368 71.634-160 160-160s160 71.632 160 160c0 88.364-71.634 160-160 160z" />
|
||||
<glyph unicode="" d="M1024 448c-1.278 66.862-15.784 133.516-42.576 194.462-26.704 61-65.462 116.258-113.042 161.92-47.552 45.696-103.944 81.82-164.984 105.652-61.004 23.924-126.596 35.352-191.398 33.966-64.81-1.282-129.332-15.374-188.334-41.356-59.048-25.896-112.542-63.47-156.734-109.576-44.224-46.082-79.16-100.708-102.186-159.798-23.114-59.062-34.128-122.52-32.746-185.27 1.286-62.76 14.964-125.148 40.134-182.206 25.088-57.1 61.476-108.828 106.11-151.548 44.61-42.754 97.472-76.504 154.614-98.72 57.118-22.304 118.446-32.902 179.142-31.526 60.708 1.29 120.962 14.554 176.076 38.914 55.15 24.282 105.116 59.48 146.366 102.644 41.282 43.14 73.844 94.236 95.254 149.43 13.034 33.458 21.88 68.4 26.542 103.798 1.246-0.072 2.498-0.12 3.762-0.12 35.346 0 64 28.652 64 64 0 1.796-0.094 3.572-0.238 5.332h0.238zM922.306 278.052c-23.472-53.202-57.484-101.4-99.178-141.18-41.67-39.81-91-71.186-144.244-91.79-53.228-20.678-110.29-30.452-166.884-29.082-56.604 1.298-112.596 13.736-163.82 36.474-51.25 22.666-97.684 55.49-135.994 95.712-38.338 40.198-68.528 87.764-88.322 139.058-19.87 51.284-29.228 106.214-27.864 160.756 1.302 54.552 13.328 108.412 35.254 157.69 21.858 49.3 53.498 93.97 92.246 130.81 38.73 36.868 84.53 65.87 133.874 84.856 49.338 19.060 102.136 28.006 154.626 26.644 52.5-1.306 104.228-12.918 151.562-34.034 47.352-21.050 90.256-51.502 125.624-88.782 35.396-37.258 63.21-81.294 81.39-128.688 18.248-47.392 26.782-98.058 25.424-148.496h0.238c-0.144-1.76-0.238-3.536-0.238-5.332 0-33.012 24.992-60.174 57.086-63.624-6.224-34.822-16.53-68.818-30.78-100.992z" />
|
||||
<glyph unicode="" d="M512 960c-278.748 0-505.458-222.762-511.848-499.974 5.92 241.864 189.832 435.974 415.848 435.974 229.75 0 416-200.576 416-448 0-53.020 42.98-96 96-96 53.020 0 96 42.98 96 96 0 282.77-229.23 512-512 512zM512-64c278.748 0 505.458 222.762 511.848 499.974-5.92-241.864-189.832-435.974-415.848-435.974-229.75 0-416 200.576-416 448 0 53.020-42.98 96-96 96-53.020 0-96-42.98-96-96 0-282.77 229.23-512 512-512z" />
|
||||
<glyph unicode="" d="M1024 351.906v192.188l-146.774 24.462c-5.958 18.132-13.222 35.668-21.694 52.5l86.454 121.034-135.896 135.898-120.826-86.304c-16.91 8.554-34.538 15.888-52.768 21.902l-24.402 146.414h-192.188l-24.402-146.416c-18.23-6.014-35.858-13.348-52.766-21.902l-120.828 86.304-135.898-135.898 86.454-121.036c-8.47-16.83-15.734-34.366-21.692-52.498l-146.774-24.46v-192.188l147.118-24.52c5.96-17.968 13.21-35.348 21.642-52.030l-86.748-121.448 135.898-135.896 121.654 86.894c16.602-8.35 33.89-15.528 51.764-21.434l24.578-147.472h192.188l24.578 147.474c17.874 5.906 35.162 13.084 51.766 21.432l121.652-86.892 135.896 135.896-86.744 121.446c8.432 16.682 15.678 34.062 21.64 52.032l147.118 24.518zM512 320c-70.692 0-128 57.306-128 128 0 70.692 57.308 128 128 128 70.694 0 128-57.308 128-128 0-70.694-57.306-128-128-128z" />
|
||||
</font></defs></svg>
|
||||
|
Antes Largura: | Altura: | Tamanho: 10 KiB |
externo
BIN
Arquivo binário não exibido.
externo
BIN
Arquivo binário não exibido.
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("de",{
|
||||
"Play": "Wiedergabe",
|
||||
"Pause": "Pause",
|
||||
"Current Time": "Aktueller Zeitpunkt",
|
||||
"Duration Time": "Dauer",
|
||||
"Remaining Time": "Verbleibende Zeit",
|
||||
"Stream Type": "Streamtyp",
|
||||
"LIVE": "LIVE",
|
||||
"Loaded": "Geladen",
|
||||
"Progress": "Status",
|
||||
"Fullscreen": "Vollbild",
|
||||
"Non-Fullscreen": "Kein Vollbild",
|
||||
"Mute": "Ton aus",
|
||||
"Unmuted": "Ton ein",
|
||||
"Playback Rate": "Wiedergabegeschwindigkeit",
|
||||
"Subtitles": "Untertitel",
|
||||
"subtitles off": "Untertitel aus",
|
||||
"Captions": "Untertitel",
|
||||
"captions off": "Untertitel aus",
|
||||
"Chapters": "Kapitel",
|
||||
"You aborted the video playback": "Sie haben die Videowiedergabe abgebrochen.",
|
||||
"A network error caused the video download to fail part-way.": "Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.",
|
||||
"No compatible source was found for this video.": "Für dieses Video wurde keine kompatible Quelle gefunden."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("es",{
|
||||
"Play": "Reproducción",
|
||||
"Pause": "Pausa",
|
||||
"Current Time": "Tiempo reproducido",
|
||||
"Duration Time": "Duración total",
|
||||
"Remaining Time": "Tiempo restante",
|
||||
"Stream Type": "Tipo de secuencia",
|
||||
"LIVE": "DIRECTO",
|
||||
"Loaded": "Cargado",
|
||||
"Progress": "Progreso",
|
||||
"Fullscreen": "Pantalla completa",
|
||||
"Non-Fullscreen": "Pantalla no completa",
|
||||
"Mute": "Silenciar",
|
||||
"Unmuted": "No silenciado",
|
||||
"Playback Rate": "Velocidad de reproducción",
|
||||
"Subtitles": "Subtítulos",
|
||||
"subtitles off": "Subtítulos desactivados",
|
||||
"Captions": "Subtítulos especiales",
|
||||
"captions off": "Subtítulos especiales desactivados",
|
||||
"Chapters": "Capítulos",
|
||||
"You aborted the video playback": "Ha interrumpido la reproducción del vídeo.",
|
||||
"A network error caused the video download to fail part-way.": "Un error de red ha interrumpido la descarga del vídeo.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "No se ha podido cargar el vídeo debido a un fallo de red o del servidor o porque el formato es incompatible.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La reproducción de vídeo se ha interrumpido por un problema de corrupción de datos o porque el vídeo precisa funciones que su navegador no ofrece.",
|
||||
"No compatible source was found for this video.": "No se ha encontrado ninguna fuente compatible con este vídeo."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("fr",{
|
||||
"Play": "Lecture",
|
||||
"Pause": "Pause",
|
||||
"Current Time": "Temps actuel",
|
||||
"Duration Time": "Durée",
|
||||
"Remaining Time": "Temps restant",
|
||||
"Stream Type": "Type de flux",
|
||||
"LIVE": "EN DIRECT",
|
||||
"Loaded": "Chargé",
|
||||
"Progress": "Progression",
|
||||
"Fullscreen": "Plein écran",
|
||||
"Non-Fullscreen": "Fenêtré",
|
||||
"Mute": "Sourdine",
|
||||
"Unmuted": "Son activé",
|
||||
"Playback Rate": "Vitesse de lecture",
|
||||
"Subtitles": "Sous-titres",
|
||||
"subtitles off": "Sous-titres désactivés",
|
||||
"Captions": "Sous-titres",
|
||||
"captions off": "Sous-titres désactivés",
|
||||
"Chapters": "Chapitres",
|
||||
"You aborted the video playback": "Vous avez interrompu la lecture de la vidéo.",
|
||||
"A network error caused the video download to fail part-way.": "Une erreur de réseau a interrompu le téléchargement de la vidéo.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.",
|
||||
"No compatible source was found for this video.": "Aucune source compatible n'a été trouvée pour cette vidéo."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("it",{
|
||||
"Play": "Play",
|
||||
"Pause": "Pausa",
|
||||
"Current Time": "Orario attuale",
|
||||
"Duration Time": "Durata",
|
||||
"Remaining Time": "Tempo rimanente",
|
||||
"Stream Type": "Tipo del Streaming",
|
||||
"LIVE": "LIVE",
|
||||
"Loaded": "Caricato",
|
||||
"Progress": "Stato",
|
||||
"Fullscreen": "Schermo intero",
|
||||
"Non-Fullscreen": "Chiudi schermo intero",
|
||||
"Mute": "Muto",
|
||||
"Unmuted": "Audio",
|
||||
"Playback Rate": "Tasso di riproduzione",
|
||||
"Subtitles": "Sottotitoli",
|
||||
"subtitles off": "Senza sottotitoli",
|
||||
"Captions": "Sottotitoli non udenti",
|
||||
"captions off": "Senza sottotitoli non udenti",
|
||||
"Chapters": "Capitolo",
|
||||
"You aborted the video playback": "La riproduzione del filmato è stata interrotta.",
|
||||
"A network error caused the video download to fail part-way.": "Il download del filmato è stato interrotto a causa di un problema rete.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Il filmato non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La riproduzione del filmato è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.",
|
||||
"No compatible source was found for this video.": "Non ci sono fonti compatibili per questo filmato."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("ja",{
|
||||
"Play": "再生",
|
||||
"Pause": "一時停止",
|
||||
"Current Time": "現在の時間",
|
||||
"Duration Time": "長さ",
|
||||
"Remaining Time": "残りの時間",
|
||||
"Stream Type": "ストリームの種類",
|
||||
"LIVE": "ライブ",
|
||||
"Loaded": "ロード済み",
|
||||
"Progress": "進行状況",
|
||||
"Fullscreen": "フルスクリーン",
|
||||
"Non-Fullscreen": "フルスクリーン以外",
|
||||
"Mute": "ミュート",
|
||||
"Unmuted": "ミュート解除",
|
||||
"Playback Rate": "再生レート",
|
||||
"Subtitles": "サブタイトル",
|
||||
"subtitles off": "サブタイトル オフ",
|
||||
"Captions": "キャプション",
|
||||
"captions off": "キャプション オフ",
|
||||
"Chapters": "チャプター",
|
||||
"You aborted the video playback": "動画再生を中止しました",
|
||||
"A network error caused the video download to fail part-way.": "ネットワーク エラーにより動画のダウンロードが途中で失敗しました",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "サーバーまたはネットワークのエラー、またはフォーマットがサポートされていないため、動画をロードできませんでした",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "破損の問題、またはお使いのブラウザがサポートしていない機能が動画に使用されていたため、動画の再生が中止されました",
|
||||
"No compatible source was found for this video.": "この動画に対して互換性のあるソースが見つかりませんでした"
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("ko",{
|
||||
"Play": "재생",
|
||||
"Pause": "일시중지",
|
||||
"Current Time": "현재 시간",
|
||||
"Duration Time": "지정 기간",
|
||||
"Remaining Time": "남은 시간",
|
||||
"Stream Type": "스트리밍 유형",
|
||||
"LIVE": "라이브",
|
||||
"Loaded": "로드됨",
|
||||
"Progress": "진행",
|
||||
"Fullscreen": "전체 화면",
|
||||
"Non-Fullscreen": "전체 화면 해제",
|
||||
"Mute": "음소거",
|
||||
"Unmuted": "음소거 해제",
|
||||
"Playback Rate": "재생 비율",
|
||||
"Subtitles": "서브타이틀",
|
||||
"subtitles off": "서브타이틀 끄기",
|
||||
"Captions": "자막",
|
||||
"captions off": "자막 끄기",
|
||||
"Chapters": "챕터",
|
||||
"You aborted the video playback": "비디오 재생을 취소했습니다.",
|
||||
"A network error caused the video download to fail part-way.": "네트워크 오류로 인하여 비디오 일부를 다운로드하지 못 했습니다.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "비디오를 로드할 수 없습니다. 서버 혹은 네트워크 오류 때문이거나 지원되지 않는 형식 때문일 수 있습니다.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "비디오 재생이 취소됐습니다. 비디오가 손상되었거나 비디오가 사용하는 기능을 브라우저에서 지원하지 않는 것 같습니다.",
|
||||
"No compatible source was found for this video.": "비디오에 호환되지 않는 소스가 있습니다."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("nl",{
|
||||
"Play": "Afspelen",
|
||||
"Pause": "Pauze",
|
||||
"Current Time": "Huidige Tijd",
|
||||
"Duration Time": "Looptijd",
|
||||
"Remaining Time": "Resterende Tijd",
|
||||
"Stream Type": "Stream Type",
|
||||
"LIVE": "LIVE",
|
||||
"Loaded": "Geladen",
|
||||
"Progress": "Status",
|
||||
"Fullscreen": "Volledig scherm",
|
||||
"Non-Fullscreen": "Geen volledig scherm",
|
||||
"Mute": "Geluid Uit",
|
||||
"Unmuted": "Geluid Aan",
|
||||
"Playback Rate": "Weergave Rate",
|
||||
"Subtitles": "Ondertiteling",
|
||||
"subtitles off": "Ondertiteling uit",
|
||||
"Captions": "Onderschriften",
|
||||
"captions off": "Onderschriften uit",
|
||||
"Chapters": "Hoofdstukken",
|
||||
"You aborted the video playback": "Je hebt de video weergave afgebroken.",
|
||||
"A network error caused the video download to fail part-way.": "De video download is mislukt door een netwerkfout.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "De video kon niet worden geladen, veroorzaakt door een server of netwerkfout of het formaat word niet ondersteund.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "De video weergave is afgebroken omdat deze beschadigd is of de video gebruikt functionaliteit die niet door je browser word ondersteund.",
|
||||
"No compatible source was found for this video.": "Voor deze video is geen ondersteunde bron gevonden."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("pt-BR",{
|
||||
"Play": "Tocar",
|
||||
"Pause": "Pause",
|
||||
"Current Time": "Tempo",
|
||||
"Duration Time": "Duração",
|
||||
"Remaining Time": "Tempo Restante",
|
||||
"Stream Type": "Tipo de Stream",
|
||||
"LIVE": "AO VIVO",
|
||||
"Loaded": "Carregado",
|
||||
"Progress": "Progressão",
|
||||
"Fullscreen": "Tela Cheia",
|
||||
"Non-Fullscreen": "Tela Normal",
|
||||
"Mute": "Mudo",
|
||||
"Unmuted": "Habilitar Som",
|
||||
"Playback Rate": "Velocidade",
|
||||
"Subtitles": "Legendas",
|
||||
"subtitles off": "Sem Legendas",
|
||||
"Captions": "Anotações",
|
||||
"captions off": "Sem Anotações",
|
||||
"Chapters": "Capítulos",
|
||||
"You aborted the video playback": "Você parou a execução de vídeo.",
|
||||
"A network error caused the video download to fail part-way.": "Um erro na rede fez o vídeo parar parcialmente.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "O vídeo não pode ser carregado, ou porque houve um problema com sua rede ou pelo formato do vídeo não ser suportado.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "A Execução foi interrompida por um problema com o vídeo ou por seu navegador não dar suporte ao seu formato.",
|
||||
"No compatible source was found for this video.": "Não foi encontrada fonte de vídeo compatível."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("ru",{
|
||||
"Play": "Воспроизвести",
|
||||
"Pause": "Приостановить",
|
||||
"Current Time": "Текущее время",
|
||||
"Duration Time": "Продолжительность",
|
||||
"Remaining Time": "Оставшееся время",
|
||||
"Stream Type": "Тип потока",
|
||||
"LIVE": "ОНЛАЙН",
|
||||
"Loaded": "Загрузка",
|
||||
"Progress": "Прогресс",
|
||||
"Fullscreen": "Полноэкранный режим",
|
||||
"Non-Fullscreen": "Неполноэкранный режим",
|
||||
"Mute": "Без звука",
|
||||
"Unmuted": "Со звуком",
|
||||
"Playback Rate": "Скорость воспроизведения",
|
||||
"Subtitles": "Субтитры",
|
||||
"subtitles off": "Субтитры выкл.",
|
||||
"Captions": "Подписи",
|
||||
"captions off": "Подписи выкл.",
|
||||
"Chapters": "Главы",
|
||||
"You aborted the video playback": "Вы прервали воспроизведение видео",
|
||||
"A network error caused the video download to fail part-way.": "Ошибка сети вызвала сбой во время загрузки видео.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Невозможно загрузить видео из-за сетевого или серверного сбоя либо формат не поддерживается.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "Воспроизведение видео было приостановлено из-за повреждения либо в связи с тем, что видео использует функции, неподдерживаемые вашим браузером.",
|
||||
"No compatible source was found for this video.": "Совместимые источники для этого видео отсутствуют."
|
||||
});
|
||||
externo
-26
@@ -1,26 +0,0 @@
|
||||
videojs.addLanguage("uk",{
|
||||
"Play": "Відтворити",
|
||||
"Pause": "Призупинити",
|
||||
"Current Time": "Поточний час",
|
||||
"Duration Time": "Тривалість",
|
||||
"Remaining Time": "Час, що залишився",
|
||||
"Stream Type": "Тип потоку",
|
||||
"LIVE": "НАЖИВО",
|
||||
"Loaded": "Завантаження",
|
||||
"Progress": "Прогрес",
|
||||
"Fullscreen": "Повноекранний режим",
|
||||
"Non-Fullscreen": "Неповноекранний режим",
|
||||
"Mute": "Без звуку",
|
||||
"Unmuted": "Зі звуком",
|
||||
"Playback Rate": "Швидкість відтворення",
|
||||
"Subtitles": "Субтитри",
|
||||
"subtitles off": "Без субтитрів",
|
||||
"Captions": "Підписи",
|
||||
"captions off": "Без підписів",
|
||||
"Chapters": "Розділи",
|
||||
"You aborted the video playback": "Ви припинили відтворення відео",
|
||||
"A network error caused the video download to fail part-way.": "Помилка мережі викликала збій під час завантаження відео.",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Неможливо завантажити відео через мережевий чи серверний збій або формат не підтримується.",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "Відтворення відео було припинено через пошкодження або у зв'язку з тим, що відео використовує функції, які не підтримуються вашим браузером.",
|
||||
"No compatible source was found for this video.": "Сумісні джерела для цього відео відсутні."
|
||||
});
|
||||
externo
-27
@@ -1,27 +0,0 @@
|
||||
videojs.addLanguage("zh",{
|
||||
"Play": "播放",
|
||||
"Pause": "暂停",
|
||||
"Current Time": "当前时间",
|
||||
"Duration Time": "时长",
|
||||
"Remaining Time": "剩余时间",
|
||||
"Stream Type": "媒体流类型",
|
||||
"LIVE": "直播",
|
||||
"Loaded": "加载完毕",
|
||||
"Progress": "进度",
|
||||
"Fullscreen": "全屏",
|
||||
"Non-Fullscreen": "退出全屏",
|
||||
"Mute": "静音",
|
||||
"Unmuted": "取消静音",
|
||||
"Playback Rate": "播放码率",
|
||||
"Subtitles": "字幕",
|
||||
"subtitles off": "字幕关闭",
|
||||
"Captions": "内嵌字幕",
|
||||
"captions off": "内嵌字幕关闭",
|
||||
"Chapters": "节目段落",
|
||||
"You aborted the video playback": "视频播放被终止",
|
||||
"A network error caused the video download to fail part-way.": "网络错误导致视频下载中途失败。",
|
||||
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。",
|
||||
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。",
|
||||
"No compatible source was found for this video.": "无法找到此视频兼容的源。",
|
||||
"The video is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。"
|
||||
});
|
||||
externo
-968
@@ -1,968 +0,0 @@
|
||||
/*!
|
||||
Video.js Default Styles (http://videojs.com)
|
||||
Version 4.10.1
|
||||
Create your own skin at http://designer.videojs.com
|
||||
*/
|
||||
/* SKIN
|
||||
================================================================================
|
||||
The main class name for all skin-specific styles. To make your own skin,
|
||||
replace all occurances of 'vjs-default-skin' with a new name. Then add your new
|
||||
skin name to your video tag instead of the default skin.
|
||||
e.g. <video class="video-js my-skin-name">
|
||||
*/
|
||||
.vjs-default-skin {
|
||||
color: #cccccc;
|
||||
}
|
||||
/* Custom Icon Font
|
||||
--------------------------------------------------------------------------------
|
||||
The control icons are from a custom font. Each icon corresponds to a character
|
||||
(e.g. "\e001"). Font icons allow for easy scaling and coloring of icons.
|
||||
*/
|
||||
@font-face {
|
||||
font-family: 'VideoJS';
|
||||
src: url('font/vjs.eot');
|
||||
src: url('font/vjs.eot?#iefix') format('embedded-opentype'), url('font/vjs.woff') format('woff'), url('font/vjs.ttf') format('truetype'), url('font/vjs.svg#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
/* Base UI Component Classes
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
/* Slider - used for Volume bar and Seek bar */
|
||||
.vjs-default-skin .vjs-slider {
|
||||
/* Replace browser focus hightlight with handle highlight */
|
||||
outline: 0;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
/* background-color-with-alpha */
|
||||
background-color: #333333;
|
||||
background-color: rgba(51, 51, 51, 0.9);
|
||||
}
|
||||
.vjs-default-skin .vjs-slider:focus {
|
||||
/* box-shadow */
|
||||
-webkit-box-shadow: 0 0 2em #ffffff;
|
||||
-moz-box-shadow: 0 0 2em #ffffff;
|
||||
box-shadow: 0 0 2em #ffffff;
|
||||
}
|
||||
.vjs-default-skin .vjs-slider-handle {
|
||||
position: absolute;
|
||||
/* Needed for IE6 */
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.vjs-default-skin .vjs-slider-handle:before {
|
||||
content: "\e009";
|
||||
font-family: VideoJS;
|
||||
font-size: 1em;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
text-shadow: 0em 0em 1em #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
/* Rotate the square icon to make a diamond */
|
||||
/* transform */
|
||||
-webkit-transform: rotate(-45deg);
|
||||
-moz-transform: rotate(-45deg);
|
||||
-ms-transform: rotate(-45deg);
|
||||
-o-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
/* Control Bar
|
||||
--------------------------------------------------------------------------------
|
||||
The default control bar that is a container for most of the controls.
|
||||
*/
|
||||
.vjs-default-skin .vjs-control-bar {
|
||||
/* Start hidden */
|
||||
display: none;
|
||||
position: absolute;
|
||||
/* Place control bar at the bottom of the player box/video.
|
||||
If you want more margin below the control bar, add more height. */
|
||||
bottom: 0;
|
||||
/* Use left/right to stretch to 100% width of player div */
|
||||
left: 0;
|
||||
right: 0;
|
||||
/* Height includes any margin you want above or below control items */
|
||||
height: 3.0em;
|
||||
/* background-color-with-alpha */
|
||||
background-color: #07141e;
|
||||
background-color: rgba(7, 20, 30, 0.7);
|
||||
}
|
||||
/* Show the control bar only once the video has started playing */
|
||||
.vjs-default-skin.vjs-has-started .vjs-control-bar {
|
||||
display: block;
|
||||
/* Visibility needed to make sure things hide in older browsers too. */
|
||||
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
/* transition */
|
||||
-webkit-transition: visibility 0.1s, opacity 0.1s;
|
||||
-moz-transition: visibility 0.1s, opacity 0.1s;
|
||||
-o-transition: visibility 0.1s, opacity 0.1s;
|
||||
transition: visibility 0.1s, opacity 0.1s;
|
||||
}
|
||||
/* Hide the control bar when the video is playing and the user is inactive */
|
||||
.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
/* transition */
|
||||
-webkit-transition: visibility 1s, opacity 1s;
|
||||
-moz-transition: visibility 1s, opacity 1s;
|
||||
-o-transition: visibility 1s, opacity 1s;
|
||||
transition: visibility 1s, opacity 1s;
|
||||
}
|
||||
.vjs-default-skin.vjs-controls-disabled .vjs-control-bar {
|
||||
display: none;
|
||||
}
|
||||
.vjs-default-skin.vjs-using-native-controls .vjs-control-bar {
|
||||
display: none;
|
||||
}
|
||||
/* The control bar shouldn't show after an error */
|
||||
.vjs-default-skin.vjs-error .vjs-control-bar {
|
||||
display: none;
|
||||
}
|
||||
/* Don't hide the control bar if it's audio */
|
||||
.vjs-audio.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
/* IE8 is flakey with fonts, and you have to change the actual content to force
|
||||
fonts to show/hide properly.
|
||||
- "\9" IE8 hack didn't work for this
|
||||
- Found in XP IE8 from http://modern.ie. Does not show up in "IE8 mode" in IE9
|
||||
*/
|
||||
@media \0screen {
|
||||
.vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before {
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
/* General styles for individual controls. */
|
||||
.vjs-default-skin .vjs-control {
|
||||
outline: none;
|
||||
position: relative;
|
||||
float: left;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 3.0em;
|
||||
width: 4em;
|
||||
}
|
||||
/* Font button icons */
|
||||
.vjs-default-skin .vjs-control:before {
|
||||
font-family: VideoJS;
|
||||
font-size: 1.5em;
|
||||
line-height: 2;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
/* Replacement for focus outline */
|
||||
.vjs-default-skin .vjs-control:focus:before,
|
||||
.vjs-default-skin .vjs-control:hover:before {
|
||||
text-shadow: 0em 0em 1em #ffffff;
|
||||
}
|
||||
.vjs-default-skin .vjs-control:focus {
|
||||
/* outline: 0; */
|
||||
/* keyboard-only users cannot see the focus on several of the UI elements when
|
||||
this is set to 0 */
|
||||
|
||||
}
|
||||
/* Hide control text visually, but have it available for screenreaders */
|
||||
.vjs-default-skin .vjs-control-text {
|
||||
/* hide-visually */
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
/* Play/Pause
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin .vjs-play-control {
|
||||
width: 5em;
|
||||
cursor: pointer;
|
||||
}
|
||||
.vjs-default-skin .vjs-play-control:before {
|
||||
content: "\e001";
|
||||
}
|
||||
.vjs-default-skin.vjs-playing .vjs-play-control:before {
|
||||
content: "\e002";
|
||||
}
|
||||
/* Playback toggle
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value {
|
||||
font-size: 1.5em;
|
||||
line-height: 2;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content {
|
||||
width: 4em;
|
||||
left: -2em;
|
||||
list-style: none;
|
||||
}
|
||||
/* Volume/Mute
|
||||
-------------------------------------------------------------------------------- */
|
||||
.vjs-default-skin .vjs-mute-control,
|
||||
.vjs-default-skin .vjs-volume-menu-button {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
}
|
||||
.vjs-default-skin .vjs-mute-control:before,
|
||||
.vjs-default-skin .vjs-volume-menu-button:before {
|
||||
content: "\e006";
|
||||
}
|
||||
.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,
|
||||
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before {
|
||||
content: "\e003";
|
||||
}
|
||||
.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,
|
||||
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before {
|
||||
content: "\e004";
|
||||
}
|
||||
.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,
|
||||
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before {
|
||||
content: "\e005";
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-control {
|
||||
width: 5em;
|
||||
float: right;
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-bar {
|
||||
width: 5em;
|
||||
height: 0.6em;
|
||||
margin: 1.1em auto 0;
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-level {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 0.5em;
|
||||
/* assuming volume starts at 1.0 */
|
||||
|
||||
width: 100%;
|
||||
background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-bar .vjs-volume-handle {
|
||||
width: 0.5em;
|
||||
height: 0.5em;
|
||||
/* Assumes volume starts at 1.0. If you change the size of the
|
||||
handle relative to the volume bar, you'll need to update this value
|
||||
too. */
|
||||
|
||||
left: 4.5em;
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-handle:before {
|
||||
font-size: 0.9em;
|
||||
top: -0.2em;
|
||||
left: -0.2em;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
}
|
||||
/* The volume menu button is like menu buttons (captions/subtitles) but works
|
||||
a little differently. It needs to be possible to tab to the volume slider
|
||||
without hitting space bar on the menu button. To do this we're not using
|
||||
display:none to hide the slider menu by default, and instead setting the
|
||||
width and height to zero. */
|
||||
.vjs-default-skin .vjs-volume-menu-button .vjs-menu {
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top-color: transparent;
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content {
|
||||
height: 0;
|
||||
width: 0;
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,
|
||||
.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing {
|
||||
border-top-color: rgba(7, 40, 50, 0.5);
|
||||
/* Same as ul background */
|
||||
|
||||
}
|
||||
.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,
|
||||
.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content {
|
||||
height: 2.9em;
|
||||
width: 10em;
|
||||
}
|
||||
/* Progress
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin .vjs-progress-control {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: auto;
|
||||
font-size: 0.3em;
|
||||
height: 1em;
|
||||
/* Set above the rest of the controls. */
|
||||
top: -1em;
|
||||
/* Shrink the bar slower than it grows. */
|
||||
/* transition */
|
||||
-webkit-transition: all 0.4s;
|
||||
-moz-transition: all 0.4s;
|
||||
-o-transition: all 0.4s;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
/* On hover, make the progress bar grow to something that's more clickable.
|
||||
This simply changes the overall font for the progress bar, and this
|
||||
updates both the em-based widths and heights, as wells as the icon font */
|
||||
.vjs-default-skin:hover .vjs-progress-control {
|
||||
font-size: .9em;
|
||||
/* Even though we're not changing the top/height, we need to include them in
|
||||
the transition so they're handled correctly. */
|
||||
|
||||
/* transition */
|
||||
-webkit-transition: all 0.2s;
|
||||
-moz-transition: all 0.2s;
|
||||
-o-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
/* Box containing play and load progresses. Also acts as seek scrubber. */
|
||||
.vjs-default-skin .vjs-progress-holder {
|
||||
height: 100%;
|
||||
}
|
||||
/* Progress Bars */
|
||||
.vjs-default-skin .vjs-progress-holder .vjs-play-progress,
|
||||
.vjs-default-skin .vjs-progress-holder .vjs-load-progress,
|
||||
.vjs-default-skin .vjs-progress-holder .vjs-load-progress div {
|
||||
position: absolute;
|
||||
display: block;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
/* updated by javascript during playback */
|
||||
|
||||
width: 0;
|
||||
/* Needed for IE6 */
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.vjs-default-skin .vjs-play-progress {
|
||||
/*
|
||||
Using a data URI to create the white diagonal lines with a transparent
|
||||
background. Surprisingly works in IE8.
|
||||
Created using http://www.patternify.com
|
||||
Changing the first color value will change the bar color.
|
||||
Also using a paralax effect to make the lines move backwards.
|
||||
The -50% left position makes that happen.
|
||||
*/
|
||||
|
||||
background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;
|
||||
}
|
||||
.vjs-default-skin .vjs-load-progress {
|
||||
background: #646464 /* IE8- Fallback */;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
/* there are child elements of the load progress bar that represent the
|
||||
specific time ranges that have been buffered */
|
||||
.vjs-default-skin .vjs-load-progress div {
|
||||
background: #787878 /* IE8- Fallback */;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.vjs-default-skin .vjs-seek-handle {
|
||||
width: 1.5em;
|
||||
height: 100%;
|
||||
}
|
||||
.vjs-default-skin .vjs-seek-handle:before {
|
||||
padding-top: 0.1em /* Minor adjustment */;
|
||||
}
|
||||
/* Live Mode
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin.vjs-live .vjs-time-controls,
|
||||
.vjs-default-skin.vjs-live .vjs-time-divider,
|
||||
.vjs-default-skin.vjs-live .vjs-progress-control {
|
||||
display: none;
|
||||
}
|
||||
.vjs-default-skin.vjs-live .vjs-live-display {
|
||||
display: block;
|
||||
}
|
||||
/* Live Display
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin .vjs-live-display {
|
||||
display: none;
|
||||
font-size: 1em;
|
||||
line-height: 3em;
|
||||
}
|
||||
/* Time Display
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin .vjs-time-controls {
|
||||
font-size: 1em;
|
||||
/* Align vertically by making the line height the same as the control bar */
|
||||
line-height: 3em;
|
||||
}
|
||||
.vjs-default-skin .vjs-current-time {
|
||||
float: left;
|
||||
}
|
||||
.vjs-default-skin .vjs-duration {
|
||||
float: left;
|
||||
}
|
||||
/* Remaining time is in the HTML, but not included in default design */
|
||||
.vjs-default-skin .vjs-remaining-time {
|
||||
display: none;
|
||||
float: left;
|
||||
}
|
||||
.vjs-time-divider {
|
||||
float: left;
|
||||
line-height: 3em;
|
||||
}
|
||||
/* Fullscreen
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin .vjs-fullscreen-control {
|
||||
width: 3.8em;
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
}
|
||||
.vjs-default-skin .vjs-fullscreen-control:before {
|
||||
content: "\e000";
|
||||
}
|
||||
/* Switch to the exit icon when the player is in fullscreen */
|
||||
.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before {
|
||||
content: "\e00b";
|
||||
}
|
||||
/* Big Play Button (play button at start)
|
||||
--------------------------------------------------------------------------------
|
||||
Positioning of the play button in the center or other corners can be done more
|
||||
easily in the skin designer. http://designer.videojs.com/
|
||||
*/
|
||||
.vjs-default-skin .vjs-big-play-button {
|
||||
left: 0.5em;
|
||||
top: 0.5em;
|
||||
font-size: 3em;
|
||||
display: block;
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
width: 4em;
|
||||
height: 2.6em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
opacity: 1;
|
||||
/* Need a slightly gray bg so it can be seen on black backgrounds */
|
||||
/* background-color-with-alpha */
|
||||
background-color: #07141e;
|
||||
background-color: rgba(7, 20, 30, 0.7);
|
||||
border: 0.1em solid #3b4249;
|
||||
/* border-radius */
|
||||
-webkit-border-radius: 0.8em;
|
||||
-moz-border-radius: 0.8em;
|
||||
border-radius: 0.8em;
|
||||
/* box-shadow */
|
||||
-webkit-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);
|
||||
-moz-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);
|
||||
box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);
|
||||
/* transition */
|
||||
-webkit-transition: all 0.4s;
|
||||
-moz-transition: all 0.4s;
|
||||
-o-transition: all 0.4s;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
/* Optionally center */
|
||||
.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button {
|
||||
/* Center it horizontally */
|
||||
left: 50%;
|
||||
margin-left: -2.1em;
|
||||
/* Center it vertically */
|
||||
top: 50%;
|
||||
margin-top: -1.4000000000000001em;
|
||||
}
|
||||
/* Hide if controls are disabled */
|
||||
.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button {
|
||||
display: none;
|
||||
}
|
||||
/* Hide when video starts playing */
|
||||
.vjs-default-skin.vjs-has-started .vjs-big-play-button {
|
||||
display: none;
|
||||
}
|
||||
/* Hide on mobile devices. Remove when we stop using native controls
|
||||
by default on mobile */
|
||||
.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button {
|
||||
display: none;
|
||||
}
|
||||
.vjs-default-skin:hover .vjs-big-play-button,
|
||||
.vjs-default-skin .vjs-big-play-button:focus {
|
||||
outline: 0;
|
||||
border-color: #fff;
|
||||
/* IE8 needs a non-glow hover state */
|
||||
background-color: #505050;
|
||||
background-color: rgba(50, 50, 50, 0.75);
|
||||
/* box-shadow */
|
||||
-webkit-box-shadow: 0 0 3em #ffffff;
|
||||
-moz-box-shadow: 0 0 3em #ffffff;
|
||||
box-shadow: 0 0 3em #ffffff;
|
||||
/* transition */
|
||||
-webkit-transition: all 0s;
|
||||
-moz-transition: all 0s;
|
||||
-o-transition: all 0s;
|
||||
transition: all 0s;
|
||||
}
|
||||
.vjs-default-skin .vjs-big-play-button:before {
|
||||
content: "\e001";
|
||||
font-family: VideoJS;
|
||||
/* In order to center the play icon vertically we need to set the line height
|
||||
to the same as the button height */
|
||||
|
||||
line-height: 2.6em;
|
||||
text-shadow: 0.05em 0.05em 0.1em #000;
|
||||
text-align: center /* Needed for IE8 */;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.vjs-error .vjs-big-play-button {
|
||||
display: none;
|
||||
}
|
||||
/* Error Display
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-error-display {
|
||||
display: none;
|
||||
}
|
||||
.vjs-error .vjs-error-display {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.vjs-error .vjs-error-display:before {
|
||||
content: 'X';
|
||||
font-family: Arial;
|
||||
font-size: 4em;
|
||||
color: #666666;
|
||||
/* In order to center the play icon vertically we need to set the line height
|
||||
to the same as the button height */
|
||||
|
||||
line-height: 1;
|
||||
text-shadow: 0.05em 0.05em 0.1em #000;
|
||||
text-align: center /* Needed for IE8 */;
|
||||
vertical-align: middle;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
margin-top: -0.5em;
|
||||
width: 100%;
|
||||
}
|
||||
.vjs-error-display div {
|
||||
position: absolute;
|
||||
bottom: 1em;
|
||||
right: 0;
|
||||
left: 0;
|
||||
font-size: 1.4em;
|
||||
text-align: center;
|
||||
padding: 3px;
|
||||
background: #000000;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.vjs-error-display a,
|
||||
.vjs-error-display a:visited {
|
||||
color: #F4A460;
|
||||
}
|
||||
/* Loading Spinner
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-loading-spinner {
|
||||
/* Should be hidden by default */
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
font-size: 4em;
|
||||
line-height: 1;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
margin-left: -0.5em;
|
||||
margin-top: -0.5em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
/* Show the spinner when waiting for data and seeking to a new time */
|
||||
.vjs-waiting .vjs-loading-spinner,
|
||||
.vjs-seeking .vjs-loading-spinner {
|
||||
display: block;
|
||||
/* only animate when showing because it can be processor heavy */
|
||||
/* animation */
|
||||
-webkit-animation: spin 1.5s infinite linear;
|
||||
-moz-animation: spin 1.5s infinite linear;
|
||||
-o-animation: spin 1.5s infinite linear;
|
||||
animation: spin 1.5s infinite linear;
|
||||
}
|
||||
/* Errors are unrecoverable without user interaction so hide the spinner */
|
||||
.vjs-error .vjs-loading-spinner {
|
||||
display: none;
|
||||
/* ensure animation doesn't continue while hidden */
|
||||
/* animation */
|
||||
-webkit-animation: none;
|
||||
-moz-animation: none;
|
||||
-o-animation: none;
|
||||
animation: none;
|
||||
}
|
||||
.vjs-default-skin .vjs-loading-spinner:before {
|
||||
content: "\e01e";
|
||||
font-family: VideoJS;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
text-align: center;
|
||||
text-shadow: 0em 0em 0.1em #000;
|
||||
}
|
||||
@-moz-keyframes spin {
|
||||
0% {
|
||||
-moz-transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-moz-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@-o-keyframes spin {
|
||||
0% {
|
||||
-o-transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-o-transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
/* Menu Buttons (Captions/Subtitles/etc.)
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
.vjs-default-skin .vjs-menu-button {
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
}
|
||||
.vjs-default-skin .vjs-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0em;
|
||||
/* (Width of vjs-menu - width of button) / 2 */
|
||||
|
||||
width: 0em;
|
||||
height: 0em;
|
||||
margin-bottom: 3em;
|
||||
border-left: 2em solid transparent;
|
||||
border-right: 2em solid transparent;
|
||||
border-top: 1.55em solid #000000;
|
||||
/* Same width top as ul bottom */
|
||||
|
||||
border-top-color: rgba(7, 40, 50, 0.5);
|
||||
/* Same as ul background */
|
||||
|
||||
}
|
||||
/* Button Pop-up Menu */
|
||||
.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content {
|
||||
display: block;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
width: 10em;
|
||||
bottom: 1.5em;
|
||||
/* Same bottom as vjs-menu border-top */
|
||||
|
||||
max-height: 15em;
|
||||
overflow: auto;
|
||||
left: -5em;
|
||||
/* Width of menu - width of button / 2 */
|
||||
|
||||
/* background-color-with-alpha */
|
||||
background-color: #07141e;
|
||||
background-color: rgba(7, 20, 30, 0.7);
|
||||
/* box-shadow */
|
||||
-webkit-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);
|
||||
-moz-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);
|
||||
box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,
|
||||
.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing {
|
||||
display: block;
|
||||
}
|
||||
.vjs-default-skin .vjs-menu-button ul li {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0.3em 0 0.3em 0;
|
||||
line-height: 1.4em;
|
||||
font-size: 1.2em;
|
||||
text-align: center;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
.vjs-default-skin .vjs-menu-button ul li.vjs-selected {
|
||||
background-color: #000;
|
||||
}
|
||||
.vjs-default-skin .vjs-menu-button ul li:focus,
|
||||
.vjs-default-skin .vjs-menu-button ul li:hover,
|
||||
.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,
|
||||
.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover {
|
||||
outline: 0;
|
||||
color: #111;
|
||||
/* background-color-with-alpha */
|
||||
background-color: #ffffff;
|
||||
background-color: rgba(255, 255, 255, 0.75);
|
||||
/* box-shadow */
|
||||
-webkit-box-shadow: 0 0 1em #ffffff;
|
||||
-moz-box-shadow: 0 0 1em #ffffff;
|
||||
box-shadow: 0 0 1em #ffffff;
|
||||
}
|
||||
.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title {
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
font-size: 1em;
|
||||
line-height: 2em;
|
||||
padding: 0;
|
||||
margin: 0 0 0.3em 0;
|
||||
font-weight: bold;
|
||||
cursor: default;
|
||||
}
|
||||
/* Subtitles Button */
|
||||
.vjs-default-skin .vjs-subtitles-button:before {
|
||||
content: "\e00c";
|
||||
}
|
||||
/* Captions Button */
|
||||
.vjs-default-skin .vjs-captions-button:before {
|
||||
content: "\e008";
|
||||
}
|
||||
/* Chapters Button */
|
||||
.vjs-default-skin .vjs-chapters-button:before {
|
||||
content: "\e00c";
|
||||
}
|
||||
.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content {
|
||||
width: 24em;
|
||||
left: -12em;
|
||||
}
|
||||
/* Replacement for focus outline */
|
||||
.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,
|
||||
.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before {
|
||||
/* box-shadow */
|
||||
-webkit-box-shadow: 0 0 1em #ffffff;
|
||||
-moz-box-shadow: 0 0 1em #ffffff;
|
||||
box-shadow: 0 0 1em #ffffff;
|
||||
}
|
||||
/*
|
||||
REQUIRED STYLES (be careful overriding)
|
||||
================================================================================
|
||||
When loading the player, the video tag is replaced with a DIV,
|
||||
that will hold the video tag or object tag for other playback methods.
|
||||
The div contains the video playback element (Flash or HTML5) and controls,
|
||||
and sets the width and height of the video.
|
||||
|
||||
** If you want to add some kind of border/padding (e.g. a frame), or special
|
||||
positioning, use another containing element. Otherwise you risk messing up
|
||||
control positioning and full window mode. **
|
||||
*/
|
||||
.video-js {
|
||||
background-color: #000;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
/* Start with 10px for base font size so other dimensions can be em based and
|
||||
easily calculable. */
|
||||
|
||||
font-size: 10px;
|
||||
/* Allow poster to be vertially aligned. */
|
||||
|
||||
vertical-align: middle;
|
||||
/* display: table-cell; */
|
||||
/*This works in Safari but not Firefox.*/
|
||||
|
||||
/* Provide some basic defaults for fonts */
|
||||
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
/* Avoiding helvetica: issue #376 */
|
||||
|
||||
font-family: Arial, sans-serif;
|
||||
/* Turn off user selection (text highlighting) by default.
|
||||
The majority of player components will not be text blocks.
|
||||
Text areas will need to turn user selection back on. */
|
||||
|
||||
/* user-select */
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
/* Playback technology elements expand to the width/height of the containing div
|
||||
<video> or <object> */
|
||||
.video-js .vjs-tech {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
/* Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when
|
||||
checking fullScreenEnabled. */
|
||||
.video-js:-moz-full-screen {
|
||||
position: absolute;
|
||||
}
|
||||
/* Fullscreen Styles */
|
||||
body.vjs-full-window {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
/* Fix for IE6 full-window. http://www.cssplay.co.uk/layouts/fixed.html */
|
||||
overflow-y: auto;
|
||||
}
|
||||
.video-js.vjs-fullscreen {
|
||||
position: fixed;
|
||||
overflow: hidden;
|
||||
z-index: 1000;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
/* IE6 full-window (underscore hack) */
|
||||
_position: absolute;
|
||||
}
|
||||
.video-js:-webkit-full-screen {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.video-js.vjs-fullscreen.vjs-user-inactive {
|
||||
cursor: none;
|
||||
}
|
||||
/* Poster Styles */
|
||||
.vjs-poster {
|
||||
background-repeat: no-repeat;
|
||||
background-position: 50% 50%;
|
||||
background-size: contain;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
.vjs-poster img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
max-height: 100%;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
/* Hide the poster after the video has started playing */
|
||||
.video-js.vjs-has-started .vjs-poster {
|
||||
display: none;
|
||||
}
|
||||
/* Don't hide the poster if we're playing audio */
|
||||
.video-js.vjs-audio.vjs-has-started .vjs-poster {
|
||||
display: block;
|
||||
}
|
||||
/* Hide the poster when controls are disabled because it's clickable
|
||||
and the native poster can take over */
|
||||
.video-js.vjs-controls-disabled .vjs-poster {
|
||||
display: none;
|
||||
}
|
||||
/* Hide the poster when native controls are used otherwise it covers them */
|
||||
.video-js.vjs-using-native-controls .vjs-poster {
|
||||
display: none;
|
||||
}
|
||||
/* Text Track Styles */
|
||||
/* Overall track holder for both captions and subtitles */
|
||||
.video-js .vjs-text-track-display {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 4em;
|
||||
/* Leave padding on left and right */
|
||||
left: 1em;
|
||||
right: 1em;
|
||||
}
|
||||
/* Move captions down when controls aren't being shown */
|
||||
.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display {
|
||||
bottom: 1em;
|
||||
}
|
||||
/* Individual tracks */
|
||||
.video-js .vjs-text-track {
|
||||
display: none;
|
||||
font-size: 1.4em;
|
||||
text-align: center;
|
||||
margin-bottom: 0.1em;
|
||||
/* Transparent black background, or fallback to all black (oldIE) */
|
||||
/* background-color-with-alpha */
|
||||
background-color: #000000;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.video-js .vjs-subtitles {
|
||||
color: #ffffff /* Subtitles are white */;
|
||||
}
|
||||
.video-js .vjs-captions {
|
||||
color: #ffcc66 /* Captions are yellow */;
|
||||
}
|
||||
.vjs-tt-cue {
|
||||
display: block;
|
||||
}
|
||||
/* Increase font-size when fullscreen */
|
||||
.video-js.vjs-fullscreen .vjs-text-track {
|
||||
font-size: 3em;
|
||||
}
|
||||
/* Hide disabled or unsupported controls */
|
||||
.vjs-default-skin .vjs-hidden {
|
||||
display: none;
|
||||
}
|
||||
.vjs-lock-showing {
|
||||
display: block !important;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
/* In IE8 w/ no JavaScript (no HTML5 shim), the video tag doesn't register.
|
||||
The .video-js classname on the video tag also isn't considered.
|
||||
This optional paragraph inside the video tag can provide a message to users
|
||||
about what's required to play video. */
|
||||
.vjs-no-js {
|
||||
padding: 20px;
|
||||
color: #ccc;
|
||||
background-color: #333;
|
||||
font-size: 18px;
|
||||
font-family: Arial, sans-serif;
|
||||
text-align: center;
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.vjs-no-js a,
|
||||
.vjs-no-js a:visited {
|
||||
color: #F4A460;
|
||||
}
|
||||
/* -----------------------------------------------------------------------------
|
||||
The original source of this file lives at
|
||||
https://github.com/videojs/video.js/blob/master/src/css/video-js.less */
|
||||
externo
-1177
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
externo
-5
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
externo
BIN
Arquivo binário não exibido.
externo
-8567
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
externo
-167
@@ -1,167 +0,0 @@
|
||||
/*! Video.js v4.10.1 Copyright 2014 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE */
|
||||
(function() {var b=void 0,f=!0,k=null,l=!1;function m(){return function(){}}function p(a){return function(){return this[a]}}function q(a){return function(){return a}}var s;document.createElement("video");document.createElement("audio");document.createElement("track");function t(a,c,d){if("string"===typeof a){0===a.indexOf("#")&&(a=a.slice(1));if(t.Ca[a])return t.Ca[a];a=t.w(a)}if(!a||!a.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return a.player||new t.Player(a,c,d)}
|
||||
var videojs=window.videojs=t;t.Vb="4.10";t.Vc="https:"==document.location.protocol?"https://":"http://";
|
||||
t.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,playbackRates:[],inactivityTimeout:2E3,children:{mediaLoader:{},posterImage:{},textTrackDisplay:{},loadingSpinner:{},bigPlayButton:{},controlBar:{},errorDisplay:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.languages&&navigator.languages[0]||navigator.ze||navigator.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this video."};
|
||||
"GENERATED_CDN_VSN"!==t.Vb&&(videojs.options.flash.swf=t.Vc+"vjs.zencdn.net/"+t.Vb+"/video-js.swf");t.hd=function(a,c){t.options.languages[a]=t.options.languages[a]!==b?t.ga.Va(t.options.languages[a],c):c;return t.options.languages};t.Ca={};"function"===typeof define&&define.amd?define([],function(){return videojs}):"object"===typeof exports&&"object"===typeof module&&(module.exports=videojs);t.qa=t.CoreObject=m();
|
||||
t.qa.extend=function(a){var c,d;a=a||{};c=a.init||a.i||this.prototype.init||this.prototype.i||m();d=function(){c.apply(this,arguments)};d.prototype=t.g.create(this.prototype);d.prototype.constructor=d;d.extend=t.qa.extend;d.create=t.qa.create;for(var e in a)a.hasOwnProperty(e)&&(d.prototype[e]=a[e]);return d};t.qa.create=function(){var a=t.g.create(this.prototype);this.apply(a,arguments);return a};
|
||||
t.c=function(a,c,d){if(t.g.isArray(c))return u(t.c,a,c,d);var e=t.getData(a);e.C||(e.C={});e.C[c]||(e.C[c]=[]);d.r||(d.r=t.r++);e.C[c].push(d);e.W||(e.disabled=l,e.W=function(c){if(!e.disabled){c=t.rc(c);var d=e.C[c.type];if(d)for(var d=d.slice(0),j=0,n=d.length;j<n&&!c.zc();j++)d[j].call(a,c)}});1==e.C[c].length&&(a.addEventListener?a.addEventListener(c,e.W,l):a.attachEvent&&a.attachEvent("on"+c,e.W))};
|
||||
t.j=function(a,c,d){if(t.uc(a)){var e=t.getData(a);if(e.C){if(t.g.isArray(c))return u(t.j,a,c,d);if(c){var g=e.C[c];if(g){if(d){if(d.r)for(e=0;e<g.length;e++)g[e].r===d.r&&g.splice(e--,1)}else e.C[c]=[];t.kc(a,c)}}else for(g in e.C)c=g,e.C[c]=[],t.kc(a,c)}}};t.kc=function(a,c){var d=t.getData(a);0===d.C[c].length&&(delete d.C[c],a.removeEventListener?a.removeEventListener(c,d.W,l):a.detachEvent&&a.detachEvent("on"+c,d.W));t.Ib(d.C)&&(delete d.C,delete d.W,delete d.disabled);t.Ib(d)&&t.Ic(a)};
|
||||
t.rc=function(a){function c(){return f}function d(){return l}if(!a||!a.Jb){var e=a||window.event;a={};for(var g in e)"layerX"!==g&&("layerY"!==g&&"keyLocation"!==g)&&("returnValue"==g&&e.preventDefault||(a[g]=e[g]));a.target||(a.target=a.srcElement||document);a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;a.preventDefault=function(){e.preventDefault&&e.preventDefault();a.returnValue=l;a.Cd=c;a.defaultPrevented=f};a.Cd=d;a.defaultPrevented=l;a.stopPropagation=function(){e.stopPropagation&&
|
||||
e.stopPropagation();a.cancelBubble=f;a.Jb=c};a.Jb=d;a.stopImmediatePropagation=function(){e.stopImmediatePropagation&&e.stopImmediatePropagation();a.zc=c;a.stopPropagation()};a.zc=d;if(a.clientX!=k){g=document.documentElement;var h=document.body;a.pageX=a.clientX+(g&&g.scrollLeft||h&&h.scrollLeft||0)-(g&&g.clientLeft||h&&h.clientLeft||0);a.pageY=a.clientY+(g&&g.scrollTop||h&&h.scrollTop||0)-(g&&g.clientTop||h&&h.clientTop||0)}a.which=a.charCode||a.keyCode;a.button!=k&&(a.button=a.button&1?0:a.button&
|
||||
4?1:a.button&2?2:0)}return a};t.l=function(a,c){var d=t.uc(a)?t.getData(a):{},e=a.parentNode||a.ownerDocument;"string"===typeof c&&(c={type:c,target:a});c=t.rc(c);d.W&&d.W.call(a,c);if(e&&!c.Jb()&&c.bubbles!==l)t.l(e,c);else if(!e&&!c.defaultPrevented&&(d=t.getData(c.target),c.target[c.type])){d.disabled=f;if("function"===typeof c.target[c.type])c.target[c.type]();d.disabled=l}return!c.defaultPrevented};
|
||||
t.R=function(a,c,d){function e(){t.j(a,c,e);d.apply(this,arguments)}if(t.g.isArray(c))return u(t.R,a,c,d);e.r=d.r=d.r||t.r++;t.c(a,c,e)};function u(a,c,d,e){t.ic.forEach(d,function(d){a(c,d,e)})}var v=Object.prototype.hasOwnProperty;t.e=function(a,c){var d;c=c||{};d=document.createElement(a||"div");t.g.X(c,function(a,c){-1!==a.indexOf("aria-")||"role"==a?d.setAttribute(a,c):d[a]=c});return d};t.ba=function(a){return a.charAt(0).toUpperCase()+a.slice(1)};t.g={};
|
||||
t.g.create=Object.create||function(a){function c(){}c.prototype=a;return new c};t.g.X=function(a,c,d){for(var e in a)v.call(a,e)&&c.call(d||this,e,a[e])};t.g.z=function(a,c){if(!c)return a;for(var d in c)v.call(c,d)&&(a[d]=c[d]);return a};t.g.qd=function(a,c){var d,e,g;a=t.g.copy(a);for(d in c)v.call(c,d)&&(e=a[d],g=c[d],a[d]=t.g.Ta(e)&&t.g.Ta(g)?t.g.qd(e,g):c[d]);return a};t.g.copy=function(a){return t.g.z({},a)};
|
||||
t.g.Ta=function(a){return!!a&&"object"===typeof a&&"[object Object]"===a.toString()&&a.constructor===Object};t.g.isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};t.Ed=function(a){return a!==a};t.bind=function(a,c,d){function e(){return c.apply(a,arguments)}c.r||(c.r=t.r++);e.r=d?d+"_"+c.r:c.r;return e};t.va={};t.r=1;t.expando="vdata"+(new Date).getTime();t.getData=function(a){var c=a[t.expando];c||(c=a[t.expando]=t.r++,t.va[c]={});return t.va[c]};
|
||||
t.uc=function(a){a=a[t.expando];return!(!a||t.Ib(t.va[a]))};t.Ic=function(a){var c=a[t.expando];if(c){delete t.va[c];try{delete a[t.expando]}catch(d){a.removeAttribute?a.removeAttribute(t.expando):a[t.expando]=k}}};t.Ib=function(a){for(var c in a)if(a[c]!==k)return l;return f};t.Sa=function(a,c){return-1!==(" "+a.className+" ").indexOf(" "+c+" ")};t.n=function(a,c){t.Sa(a,c)||(a.className=""===a.className?c:a.className+" "+c)};
|
||||
t.p=function(a,c){var d,e;if(t.Sa(a,c)){d=a.className.split(" ");for(e=d.length-1;0<=e;e--)d[e]===c&&d.splice(e,1);a.className=d.join(" ")}};t.A=t.e("video");t.O=navigator.userAgent;t.bd=/iPhone/i.test(t.O);t.ad=/iPad/i.test(t.O);t.cd=/iPod/i.test(t.O);t.$c=t.bd||t.ad||t.cd;var aa=t,x;var y=t.O.match(/OS (\d+)_/i);x=y&&y[1]?y[1]:b;aa.oe=x;t.Yc=/Android/i.test(t.O);var ba=t,z;var A=t.O.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i),B,C;
|
||||
A?(B=A[1]&&parseFloat(A[1]),C=A[2]&&parseFloat(A[2]),z=B&&C?parseFloat(A[1]+"."+A[2]):B?B:k):z=k;ba.Ub=z;t.dd=t.Yc&&/webkit/i.test(t.O)&&2.3>t.Ub;t.Zc=/Firefox/i.test(t.O);t.pe=/Chrome/i.test(t.O);t.ec=!!("ontouchstart"in window||window.Xc&&document instanceof window.Xc);t.Wc="backgroundSize"in t.A.style;t.Kc=function(a,c){t.g.X(c,function(c,e){e===k||"undefined"===typeof e||e===l?a.removeAttribute(c):a.setAttribute(c,e===f?"":e)})};
|
||||
t.Aa=function(a){var c,d,e,g;c={};if(a&&a.attributes&&0<a.attributes.length){d=a.attributes;for(var h=d.length-1;0<=h;h--){e=d[h].name;g=d[h].value;if("boolean"===typeof a[e]||-1!==",autoplay,controls,loop,muted,default,".indexOf(","+e+","))g=g!==k?f:l;c[e]=g}}return c};
|
||||
t.ve=function(a,c){var d="";document.defaultView&&document.defaultView.getComputedStyle?d=document.defaultView.getComputedStyle(a,"").getPropertyValue(c):a.currentStyle&&(d=a["client"+c.substr(0,1).toUpperCase()+c.substr(1)]+"px");return d};t.Hb=function(a,c){c.firstChild?c.insertBefore(a,c.firstChild):c.appendChild(a)};t.Oa={};t.w=function(a){0===a.indexOf("#")&&(a=a.slice(1));return document.getElementById(a)};
|
||||
t.za=function(a,c){c=c||a;var d=Math.floor(a%60),e=Math.floor(a/60%60),g=Math.floor(a/3600),h=Math.floor(c/60%60),j=Math.floor(c/3600);if(isNaN(a)||Infinity===a)g=e=d="-";g=0<g||0<j?g+":":"";return g+(((g||10<=h)&&10>e?"0"+e:e)+":")+(10>d?"0"+d:d)};t.kd=function(){document.body.focus();document.onselectstart=q(l)};t.ke=function(){document.onselectstart=q(f)};t.trim=function(a){return(a+"").replace(/^\s+|\s+$/g,"")};t.round=function(a,c){c||(c=0);return Math.round(a*Math.pow(10,c))/Math.pow(10,c)};
|
||||
t.zb=function(a,c){return{length:1,start:function(){return a},end:function(){return c}}};
|
||||
t.get=function(a,c,d,e){var g,h,j,n;d=d||m();"undefined"===typeof XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");});h=new XMLHttpRequest;j=t.Xd(a);n=window.location;j.protocol+j.host!==n.protocol+n.host&&window.XDomainRequest&&!("withCredentials"in
|
||||
h)?(h=new window.XDomainRequest,h.onload=function(){c(h.responseText)},h.onerror=d,h.onprogress=m(),h.ontimeout=d):(g="file:"==j.protocol||"file:"==n.protocol,h.onreadystatechange=function(){4===h.readyState&&(200===h.status||g&&0===h.status?c(h.responseText):d(h.responseText))});try{h.open("GET",a,f),e&&(h.withCredentials=f)}catch(r){d(r);return}try{h.send()}catch(w){d(w)}};
|
||||
t.ae=function(a){try{var c=window.localStorage||l;c&&(c.volume=a)}catch(d){22==d.code||1014==d.code?t.log("LocalStorage Full (VideoJS)",d):18==d.code?t.log("LocalStorage not allowed (VideoJS)",d):t.log("LocalStorage Error (VideoJS)",d)}};t.tc=function(a){a.match(/^https?:\/\//)||(a=t.e("div",{innerHTML:'<a href="'+a+'">x</a>'}).firstChild.href);return a};
|
||||
t.Xd=function(a){var c,d,e,g;g="protocol hostname port pathname search hash host".split(" ");d=t.e("a",{href:a});if(e=""===d.host&&"file:"!==d.protocol)c=t.e("div"),c.innerHTML='<a href="'+a+'"></a>',d=c.firstChild,c.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(c);a={};for(var h=0;h<g.length;h++)a[g[h]]=d[g[h]];e&&document.body.removeChild(c);return a};
|
||||
function D(a,c){var d,e;d=Array.prototype.slice.call(c);e=m();e=window.console||{log:e,warn:e,error:e};a?d.unshift(a.toUpperCase()+":"):a="log";t.log.history.push(d);d.unshift("VIDEOJS:");if(e[a].apply)e[a].apply(e,d);else e[a](d.join(" "))}t.log=function(){D(k,arguments)};t.log.history=[];t.log.error=function(){D("error",arguments)};t.log.warn=function(){D("warn",arguments)};
|
||||
t.xd=function(a){var c,d;a.getBoundingClientRect&&a.parentNode&&(c=a.getBoundingClientRect());if(!c)return{left:0,top:0};a=document.documentElement;d=document.body;return{left:t.round(c.left+(window.pageXOffset||d.scrollLeft)-(a.clientLeft||d.clientLeft||0)),top:t.round(c.top+(window.pageYOffset||d.scrollTop)-(a.clientTop||d.clientTop||0))}};t.ic={};t.ic.forEach=function(a,c,d){if(t.g.isArray(a)&&c instanceof Function)for(var e=0,g=a.length;e<g;++e)c.call(d||t,a[e],e,a);return a};t.ga={};
|
||||
t.ga.Va=function(a,c){var d,e,g;a=t.g.copy(a);for(d in c)c.hasOwnProperty(d)&&(e=a[d],g=c[d],a[d]=t.g.Ta(e)&&t.g.Ta(g)?t.ga.Va(e,g):c[d]);return a};
|
||||
t.a=t.qa.extend({i:function(a,c,d){this.d=a;this.m=t.g.copy(this.m);c=this.options(c);this.L=c.id||c.el&&c.el.id;this.L||(this.L=(a.id&&a.id()||"no_player")+"_component_"+t.r++);this.Kd=c.name||k;this.b=c.el||this.e();this.P=[];this.Pa={};this.Qa={};this.wc();this.K(d);if(c.Jc!==l){var e,g;this.k().reportUserActivity&&(e=t.bind(this.k(),this.k().reportUserActivity),this.c("touchstart",function(){e();clearInterval(g);g=setInterval(e,250)}),a=function(){e();clearInterval(g)},this.c("touchmove",e),this.c("touchend",
|
||||
a),this.c("touchcancel",a))}}});s=t.a.prototype;s.dispose=function(){this.l({type:"dispose",bubbles:l});if(this.P)for(var a=this.P.length-1;0<=a;a--)this.P[a].dispose&&this.P[a].dispose();this.Qa=this.Pa=this.P=k;this.j();this.b.parentNode&&this.b.parentNode.removeChild(this.b);t.Ic(this.b);this.b=k};s.d=f;s.k=p("d");s.options=function(a){return a===b?this.m:this.m=t.ga.Va(this.m,a)};s.e=function(a,c){return t.e(a,c)};
|
||||
s.t=function(a){var c=this.d.language(),d=this.d.languages();return d&&d[c]&&d[c][a]?d[c][a]:a};s.w=p("b");s.ja=function(){return this.v||this.b};s.id=p("L");s.name=p("Kd");s.children=p("P");s.zd=function(a){return this.Pa[a]};s.ka=function(a){return this.Qa[a]};
|
||||
s.V=function(a,c){var d,e;"string"===typeof a?(e=a,c=c||{},d=c.componentClass||t.ba(e),c.name=e,d=new window.videojs[d](this.d||this,c)):d=a;this.P.push(d);"function"===typeof d.id&&(this.Pa[d.id()]=d);(e=e||d.name&&d.name())&&(this.Qa[e]=d);"function"===typeof d.el&&d.el()&&this.ja().appendChild(d.el());return d};
|
||||
s.removeChild=function(a){"string"===typeof a&&(a=this.ka(a));if(a&&this.P){for(var c=l,d=this.P.length-1;0<=d;d--)if(this.P[d]===a){c=f;this.P.splice(d,1);break}c&&(this.Pa[a.id]=k,this.Qa[a.name]=k,(c=a.w())&&c.parentNode===this.ja()&&this.ja().removeChild(a.w()))}};
|
||||
s.wc=function(){var a,c,d,e,g,h;a=this;c=a.options();if(d=c.children)if(h=function(d,e){c[d]&&(e=c[d]);e!==l&&(a[d]=a.V(d,e))},t.g.isArray(d))for(var j=0;j<d.length;j++)e=d[j],"string"==typeof e?(g=e,e={}):g=e.name,h(g,e);else t.g.X(d,h)};s.T=q("");
|
||||
s.c=function(a,c,d){var e,g,h;"string"===typeof a||t.g.isArray(a)?t.c(this.b,a,t.bind(this,c)):(e=t.bind(this,d),h=this,g=function(){h.j(a,c,e)},g.r=e.r,this.c("dispose",g),d=function(){h.j("dispose",g)},d.r=e.r,a.nodeName?(t.c(a,c,e),t.c(a,"dispose",d)):"function"===typeof a.c&&(a.c(c,e),a.c("dispose",d)));return this};
|
||||
s.j=function(a,c,d){!a||"string"===typeof a||t.g.isArray(a)?t.j(this.b,a,c):(d=t.bind(this,d),this.j("dispose",d),a.nodeName?(t.j(a,c,d),t.j(a,"dispose",d)):(a.j(c,d),a.j("dispose",d)));return this};s.R=function(a,c,d){var e,g,h;"string"===typeof a||t.g.isArray(a)?t.R(this.b,a,t.bind(this,c)):(e=t.bind(this,d),g=this,h=function(){g.j(a,c,h);e.apply(this,arguments)},h.r=e.r,this.c(a,c,h));return this};s.l=function(a){t.l(this.b,a);return this};
|
||||
s.K=function(a){a&&(this.la?a.call(this):(this.ab===b&&(this.ab=[]),this.ab.push(a)));return this};s.Ga=function(){this.la=f;var a=this.ab;if(a&&0<a.length){for(var c=0,d=a.length;c<d;c++)a[c].call(this);this.ab=[];this.l("ready")}};s.Sa=function(a){return t.Sa(this.b,a)};s.n=function(a){t.n(this.b,a);return this};s.p=function(a){t.p(this.b,a);return this};s.show=function(){this.b.style.display="block";return this};s.Y=function(){this.b.style.display="none";return this};
|
||||
function E(a){a.p("vjs-lock-showing")}s.disable=function(){this.Y();this.show=m()};s.width=function(a,c){return F(this,"width",a,c)};s.height=function(a,c){return F(this,"height",a,c)};s.td=function(a,c){return this.width(a,f).height(c)};
|
||||
function F(a,c,d,e){if(d!==b){if(d===k||t.Ed(d))d=0;a.b.style[c]=-1!==(""+d).indexOf("%")||-1!==(""+d).indexOf("px")?d:"auto"===d?"":d+"px";e||a.l("resize");return a}if(!a.b)return 0;d=a.b.style[c];e=d.indexOf("px");return-1!==e?parseInt(d.slice(0,e),10):parseInt(a.b["offset"+t.ba(c)],10)}
|
||||
function G(a){var c,d,e,g,h,j,n,r;c=0;d=k;a.c("touchstart",function(a){1===a.touches.length&&(d=a.touches[0],c=(new Date).getTime(),g=f)});a.c("touchmove",function(a){1<a.touches.length?g=l:d&&(j=a.touches[0].pageX-d.pageX,n=a.touches[0].pageY-d.pageY,r=Math.sqrt(j*j+n*n),22<r&&(g=l))});h=function(){g=l};a.c("touchleave",h);a.c("touchcancel",h);a.c("touchend",function(a){d=k;g===f&&(e=(new Date).getTime()-c,250>e&&(a.preventDefault(),this.l("tap")))})}
|
||||
t.u=t.a.extend({i:function(a,c){t.a.call(this,a,c);G(this);this.c("tap",this.s);this.c("click",this.s);this.c("focus",this.Ya);this.c("blur",this.Xa)}});s=t.u.prototype;
|
||||
s.e=function(a,c){var d;c=t.g.z({className:this.T(),role:"button","aria-live":"polite",tabIndex:0},c);d=t.a.prototype.e.call(this,a,c);c.innerHTML||(this.v=t.e("div",{className:"vjs-control-content"}),this.xb=t.e("span",{className:"vjs-control-text",innerHTML:this.t(this.ua)||"Need Text"}),this.v.appendChild(this.xb),d.appendChild(this.v));return d};s.T=function(){return"vjs-control "+t.a.prototype.T.call(this)};s.s=m();s.Ya=function(){t.c(document,"keydown",t.bind(this,this.Z))};
|
||||
s.Z=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.s()};s.Xa=function(){t.j(document,"keydown",t.bind(this,this.Z))};
|
||||
t.S=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.jd=this.ka(this.m.barName);this.handle=this.ka(this.m.handleName);this.c("mousedown",this.Za);this.c("touchstart",this.Za);this.c("focus",this.Ya);this.c("blur",this.Xa);this.c("click",this.s);this.c(a,"controlsvisible",this.update);this.c(a,this.Ec,this.update);this.F={};this.F.move=t.bind(this,this.$a);this.F.end=t.bind(this,this.Mb)}});s=t.S.prototype;
|
||||
s.dispose=function(){t.j(document,"mousemove",this.F.move,l);t.j(document,"mouseup",this.F.end,l);t.j(document,"touchmove",this.F.move,l);t.j(document,"touchend",this.F.end,l);t.j(document,"keyup",t.bind(this,this.Z));t.a.prototype.dispose.call(this)};s.e=function(a,c){c=c||{};c.className+=" vjs-slider";c=t.g.z({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},c);return t.a.prototype.e.call(this,a,c)};
|
||||
s.Za=function(a){a.preventDefault();t.kd();this.n("vjs-sliding");t.c(document,"mousemove",this.F.move);t.c(document,"mouseup",this.F.end);t.c(document,"touchmove",this.F.move);t.c(document,"touchend",this.F.end);this.$a(a)};s.$a=m();s.Mb=function(){t.ke();this.p("vjs-sliding");t.j(document,"mousemove",this.F.move,l);t.j(document,"mouseup",this.F.end,l);t.j(document,"touchmove",this.F.move,l);t.j(document,"touchend",this.F.end,l);this.update()};
|
||||
s.update=function(){if(this.b){var a,c=this.Gb(),d=this.handle,e=this.jd;isNaN(c)&&(c=0);a=c;if(d){a=this.b.offsetWidth;var g=d.w().offsetWidth;a=g?g/a:0;c*=1-a;a=c+a/2;d.w().style.left=t.round(100*c,2)+"%"}e&&(e.w().style.width=t.round(100*a,2)+"%")}};
|
||||
function H(a,c){var d,e,g,h;d=a.b;e=t.xd(d);h=g=d.offsetWidth;d=a.handle;if(a.options().vertical)return h=e.top,e=c.changedTouches?c.changedTouches[0].pageY:c.pageY,d&&(d=d.w().offsetHeight,h+=d/2,g-=d),Math.max(0,Math.min(1,(h-e+g)/g));g=e.left;e=c.changedTouches?c.changedTouches[0].pageX:c.pageX;d&&(d=d.w().offsetWidth,g+=d/2,h-=d);return Math.max(0,Math.min(1,(e-g)/h))}s.Ya=function(){t.c(document,"keyup",t.bind(this,this.Z))};
|
||||
s.Z=function(a){if(37==a.which||40==a.which)a.preventDefault(),this.Nc();else if(38==a.which||39==a.which)a.preventDefault(),this.Oc()};s.Xa=function(){t.j(document,"keyup",t.bind(this,this.Z))};s.s=function(a){a.stopImmediatePropagation();a.preventDefault()};t.$=t.a.extend();t.$.prototype.defaultValue=0;
|
||||
t.$.prototype.e=function(a,c){c=c||{};c.className+=" vjs-slider-handle";c=t.g.z({innerHTML:'<span class="vjs-control-text">'+this.defaultValue+"</span>"},c);return t.a.prototype.e.call(this,"div",c)};t.ha=t.a.extend();function ca(a,c){a.V(c);c.c("click",t.bind(a,function(){E(this)}))}
|
||||
t.ha.prototype.e=function(){var a=this.options().lc||"ul";this.v=t.e(a,{className:"vjs-menu-content"});a=t.a.prototype.e.call(this,"div",{append:this.v,className:"vjs-menu"});a.appendChild(this.v);t.c(a,"click",function(a){a.preventDefault();a.stopImmediatePropagation()});return a};t.J=t.u.extend({i:function(a,c){t.u.call(this,a,c);this.selected(c.selected)}});t.J.prototype.e=function(a,c){return t.u.prototype.e.call(this,"li",t.g.z({className:"vjs-menu-item",innerHTML:this.m.label},c))};
|
||||
t.J.prototype.s=function(){this.selected(f)};t.J.prototype.selected=function(a){a?(this.n("vjs-selected"),this.b.setAttribute("aria-selected",f)):(this.p("vjs-selected"),this.b.setAttribute("aria-selected",l))};t.N=t.u.extend({i:function(a,c){t.u.call(this,a,c);this.Ba=this.xa();this.V(this.Ba);this.Q&&0===this.Q.length&&this.Y();this.c("keyup",this.Z);this.b.setAttribute("aria-haspopup",f);this.b.setAttribute("role","button")}});s=t.N.prototype;s.ta=l;
|
||||
s.xa=function(){var a=new t.ha(this.d);this.options().title&&a.ja().appendChild(t.e("li",{className:"vjs-menu-title",innerHTML:t.ba(this.options().title),he:-1}));if(this.Q=this.createItems())for(var c=0;c<this.Q.length;c++)ca(a,this.Q[c]);return a};s.wa=m();s.T=function(){return this.className+" vjs-menu-button "+t.u.prototype.T.call(this)};s.Ya=m();s.Xa=m();s.s=function(){this.R("mouseout",t.bind(this,function(){E(this.Ba);this.b.blur()}));this.ta?I(this):J(this)};
|
||||
s.Z=function(a){a.preventDefault();32==a.which||13==a.which?this.ta?I(this):J(this):27==a.which&&this.ta&&I(this)};function J(a){a.ta=f;a.Ba.n("vjs-lock-showing");a.b.setAttribute("aria-pressed",f);a.Q&&0<a.Q.length&&a.Q[0].w().focus()}function I(a){a.ta=l;E(a.Ba);a.b.setAttribute("aria-pressed",l)}t.D=function(a){"number"===typeof a?this.code=a:"string"===typeof a?this.message=a:"object"===typeof a&&t.g.z(this,a);this.message||(this.message=t.D.rd[this.code]||"")};t.D.prototype.code=0;
|
||||
t.D.prototype.message="";t.D.prototype.status=k;t.D.Ra="MEDIA_ERR_CUSTOM MEDIA_ERR_ABORTED MEDIA_ERR_NETWORK MEDIA_ERR_DECODE MEDIA_ERR_SRC_NOT_SUPPORTED MEDIA_ERR_ENCRYPTED".split(" ");
|
||||
t.D.rd={1:"You aborted the video playback",2:"A network error caused the video download to fail part-way.",3:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.",4:"The video could not be loaded, either because the server or network failed or because the format is not supported.",5:"The video is encrypted and we do not have the keys to decrypt it."};for(var K=0;K<t.D.Ra.length;K++)t.D[t.D.Ra[K]]=K,t.D.prototype[t.D.Ra[K]]=K;
|
||||
var L,M,N,O;
|
||||
L=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "),"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "),"webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "),"mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "),"msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ")];
|
||||
M=L[0];for(O=0;O<L.length;O++)if(L[O][1]in document){N=L[O];break}if(N){t.Oa.Fb={};for(O=0;O<N.length;O++)t.Oa.Fb[M[O]]=N[O]}
|
||||
t.Player=t.a.extend({i:function(a,c,d){this.I=a;a.id=a.id||"vjs_video_"+t.r++;this.ie=a&&t.Aa(a);c=t.g.z(da(a),c);this.Ua=c.language||t.options.language;this.Id=c.languages||t.options.languages;this.G={};this.Fc=c.poster||"";this.yb=!!c.controls;a.controls=l;c.Jc=l;P(this,"audio"===this.I.nodeName.toLowerCase());t.a.call(this,this,c,d);this.controls()?this.n("vjs-controls-enabled"):this.n("vjs-controls-disabled");P(this)&&this.n("vjs-audio");t.Ca[this.L]=this;c.plugins&&t.g.X(c.plugins,function(a,
|
||||
c){this[a](c)},this);var e,g,h,j,n,r;e=t.bind(this,this.reportUserActivity);this.c("mousedown",function(){e();clearInterval(g);g=setInterval(e,250)});this.c("mousemove",function(a){if(a.screenX!=n||a.screenY!=r)n=a.screenX,r=a.screenY,e()});this.c("mouseup",function(){e();clearInterval(g)});this.c("keydown",e);this.c("keyup",e);h=setInterval(t.bind(this,function(){if(this.pa){this.pa=l;this.userActive(f);clearTimeout(j);var a=this.options().inactivityTimeout;0<a&&(j=setTimeout(t.bind(this,function(){this.pa||
|
||||
this.userActive(l)}),a))}}),250);this.c("dispose",function(){clearInterval(h);clearTimeout(j)})}});s=t.Player.prototype;s.language=function(a){if(a===b)return this.Ua;this.Ua=a;return this};s.languages=p("Id");s.m=t.options;s.dispose=function(){this.l("dispose");this.j("dispose");t.Ca[this.L]=k;this.I&&this.I.player&&(this.I.player=k);this.b&&this.b.player&&(this.b.player=k);this.o&&this.o.dispose();t.a.prototype.dispose.call(this)};
|
||||
function da(a){var c,d,e={sources:[],tracks:[]};c=t.Aa(a);d=c["data-setup"];d!==k&&t.g.z(c,t.JSON.parse(d||"{}"));t.g.z(e,c);if(a.hasChildNodes()){var g,h;a=a.childNodes;g=0;for(h=a.length;g<h;g++)c=a[g],d=c.nodeName.toLowerCase(),"source"===d?e.sources.push(t.Aa(c)):"track"===d&&e.tracks.push(t.Aa(c))}return e}
|
||||
s.e=function(){var a=this.b=t.a.prototype.e.call(this,"div"),c=this.I,d;c.removeAttribute("width");c.removeAttribute("height");if(c.hasChildNodes()){var e,g,h,j,n;e=c.childNodes;g=e.length;for(n=[];g--;)h=e[g],j=h.nodeName.toLowerCase(),"track"===j&&n.push(h);for(e=0;e<n.length;e++)c.removeChild(n[e])}d=t.Aa(c);t.g.X(d,function(c){"class"==c?a.className=d[c]:a.setAttribute(c,d[c])});c.id+="_html5_api";c.className="vjs-tech";c.player=a.player=this;this.n("vjs-paused");this.width(this.m.width,f);this.height(this.m.height,
|
||||
f);c.Bd=c.networkState;c.parentNode&&c.parentNode.insertBefore(a,c);t.Hb(c,a);this.b=a;this.c("loadstart",this.Pd);this.c("waiting",this.Vd);this.c(["canplay","canplaythrough","playing","ended"],this.Ud);this.c("seeking",this.Sd);this.c("seeked",this.Rd);this.c("ended",this.Ld);this.c("play",this.Ob);this.c("firstplay",this.Nd);this.c("pause",this.Nb);this.c("progress",this.Qd);this.c("durationchange",this.Cc);this.c("fullscreenchange",this.Od);return a};
|
||||
function Q(a,c,d){a.o&&(a.la=l,a.o.dispose(),a.o=l);"Html5"!==c&&a.I&&(t.h.Bb(a.I),a.I=k);a.eb=c;a.la=l;var e=t.g.z({source:d,parentEl:a.b},a.m[c.toLowerCase()]);d&&(a.nc=d.type,d.src==a.G.src&&0<a.G.currentTime&&(e.startTime=a.G.currentTime),a.G.src=d.src);a.o=new window.videojs[c](a,e);a.o.K(function(){this.d.Ga()})}s.Pd=function(){this.error(k);this.paused()?(R(this,l),this.R("play",function(){R(this,f)})):this.l("firstplay")};s.vc=l;
|
||||
function R(a,c){c!==b&&a.vc!==c&&((a.vc=c)?(a.n("vjs-has-started"),a.l("firstplay")):a.p("vjs-has-started"))}s.Ob=function(){this.p("vjs-paused");this.n("vjs-playing")};s.Vd=function(){this.n("vjs-waiting")};s.Ud=function(){this.p("vjs-waiting")};s.Sd=function(){this.n("vjs-seeking")};s.Rd=function(){this.p("vjs-seeking")};s.Nd=function(){this.m.starttime&&this.currentTime(this.m.starttime);this.n("vjs-has-started")};s.Nb=function(){this.p("vjs-playing");this.n("vjs-paused")};
|
||||
s.Qd=function(){1==this.bufferedPercent()&&this.l("loadedalldata")};s.Ld=function(){this.m.loop?(this.currentTime(0),this.play()):this.paused()||this.pause()};s.Cc=function(){var a=S(this,"duration");a&&(0>a&&(a=Infinity),this.duration(a),Infinity===a?this.n("vjs-live"):this.p("vjs-live"))};s.Od=function(){this.isFullscreen()?this.n("vjs-fullscreen"):this.p("vjs-fullscreen")};function T(a,c,d){if(a.o&&!a.o.la)a.o.K(function(){this[c](d)});else try{a.o[c](d)}catch(e){throw t.log(e),e;}}
|
||||
function S(a,c){if(a.o&&a.o.la)try{return a.o[c]()}catch(d){throw a.o[c]===b?t.log("Video.js: "+c+" method not defined for "+a.eb+" playback technology.",d):"TypeError"==d.name?(t.log("Video.js: "+c+" unavailable on "+a.eb+" playback technology element.",d),a.o.la=l):t.log(d),d;}}s.play=function(){T(this,"play");return this};s.pause=function(){T(this,"pause");return this};s.paused=function(){return S(this,"paused")===l?l:f};
|
||||
s.currentTime=function(a){return a!==b?(T(this,"setCurrentTime",a),this):this.G.currentTime=S(this,"currentTime")||0};s.duration=function(a){if(a!==b)return this.G.duration=parseFloat(a),this;this.G.duration===b&&this.Cc();return this.G.duration||0};s.remainingTime=function(){return this.duration()-this.currentTime()};s.buffered=function(){var a=S(this,"buffered");if(!a||!a.length)a=t.zb(0,0);return a};
|
||||
s.bufferedPercent=function(){var a=this.duration(),c=this.buffered(),d=0,e,g;if(!a)return 0;for(var h=0;h<c.length;h++)e=c.start(h),g=c.end(h),g>a&&(g=a),d+=g-e;return d/a};s.volume=function(a){if(a!==b)return a=Math.max(0,Math.min(1,parseFloat(a))),this.G.volume=a,T(this,"setVolume",a),t.ae(a),this;a=parseFloat(S(this,"volume"));return isNaN(a)?1:a};s.muted=function(a){return a!==b?(T(this,"setMuted",a),this):S(this,"muted")||l};s.Ea=function(){return S(this,"supportsFullScreen")||l};s.yc=l;
|
||||
s.isFullscreen=function(a){return a!==b?(this.yc=!!a,this):this.yc};s.isFullScreen=function(a){t.log.warn('player.isFullScreen() has been deprecated, use player.isFullscreen() with a lowercase "s")');return this.isFullscreen(a)};
|
||||
s.requestFullscreen=function(){var a=t.Oa.Fb;this.isFullscreen(f);a?(t.c(document,a.fullscreenchange,t.bind(this,function(c){this.isFullscreen(document[a.fullscreenElement]);this.isFullscreen()===l&&t.j(document,a.fullscreenchange,arguments.callee);this.l("fullscreenchange")})),this.b[a.requestFullscreen]()):this.o.Ea()?T(this,"enterFullScreen"):(this.qc(),this.l("fullscreenchange"));return this};
|
||||
s.requestFullScreen=function(){t.log.warn('player.requestFullScreen() has been deprecated, use player.requestFullscreen() with a lowercase "s")');return this.requestFullscreen()};s.exitFullscreen=function(){var a=t.Oa.Fb;this.isFullscreen(l);if(a)document[a.exitFullscreen]();else this.o.Ea()?T(this,"exitFullScreen"):(this.Cb(),this.l("fullscreenchange"));return this};s.cancelFullScreen=function(){t.log.warn("player.cancelFullScreen() has been deprecated, use player.exitFullscreen()");return this.exitFullscreen()};
|
||||
s.qc=function(){this.Dd=f;this.ud=document.documentElement.style.overflow;t.c(document,"keydown",t.bind(this,this.sc));document.documentElement.style.overflow="hidden";t.n(document.body,"vjs-full-window");this.l("enterFullWindow")};s.sc=function(a){27===a.keyCode&&(this.isFullscreen()===f?this.exitFullscreen():this.Cb())};s.Cb=function(){this.Dd=l;t.j(document,"keydown",this.sc);document.documentElement.style.overflow=this.ud;t.p(document.body,"vjs-full-window");this.l("exitFullWindow")};
|
||||
s.selectSource=function(a){for(var c=0,d=this.m.techOrder;c<d.length;c++){var e=t.ba(d[c]),g=window.videojs[e];if(g){if(g.isSupported())for(var h=0,j=a;h<j.length;h++){var n=j[h];if(g.canPlaySource(n))return{source:n,o:e}}}else t.log.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.')}return l};
|
||||
s.src=function(a){if(a===b)return S(this,"src");t.g.isArray(a)?U(this,a):"string"===typeof a?this.src({src:a}):a instanceof Object&&(a.type&&!window.videojs[this.eb].canPlaySource(a)?U(this,[a]):(this.G.src=a.src,this.nc=a.type||"",this.K(function(){T(this,"src",a.src);"auto"==this.m.preload&&this.load();this.m.autoplay&&this.play()})));return this};
|
||||
function U(a,c){var d=a.selectSource(c),e;d?d.o===a.eb?a.src(d.source):Q(a,d.o,d.source):(e=setTimeout(t.bind(a,function(){this.error({code:4,message:this.t(this.options().notSupportedMessage)})}),0),a.Ga(),a.c("dispose",function(){clearTimeout(e)}))}s.load=function(){T(this,"load");return this};s.currentSrc=function(){return S(this,"currentSrc")||this.G.src||""};s.pd=function(){return this.nc||""};s.Da=function(a){return a!==b?(T(this,"setPreload",a),this.m.preload=a,this):S(this,"preload")};
|
||||
s.autoplay=function(a){return a!==b?(T(this,"setAutoplay",a),this.m.autoplay=a,this):S(this,"autoplay")};s.loop=function(a){return a!==b?(T(this,"setLoop",a),this.m.loop=a,this):S(this,"loop")};s.poster=function(a){if(a===b)return this.Fc;a||(a="");this.Fc=a;T(this,"setPoster",a);this.l("posterchange");return this};
|
||||
s.controls=function(a){return a!==b?(a=!!a,this.yb!==a&&((this.yb=a)?(this.p("vjs-controls-disabled"),this.n("vjs-controls-enabled"),this.l("controlsenabled")):(this.p("vjs-controls-enabled"),this.n("vjs-controls-disabled"),this.l("controlsdisabled"))),this):this.yb};t.Player.prototype.Tb;s=t.Player.prototype;
|
||||
s.usingNativeControls=function(a){return a!==b?(a=!!a,this.Tb!==a&&((this.Tb=a)?(this.n("vjs-using-native-controls"),this.l("usingnativecontrols")):(this.p("vjs-using-native-controls"),this.l("usingcustomcontrols"))),this):this.Tb};s.da=k;s.error=function(a){if(a===b)return this.da;if(a===k)return this.da=a,this.p("vjs-error"),this;this.da=a instanceof t.D?a:new t.D(a);this.l("error");this.n("vjs-error");t.log.error("(CODE:"+this.da.code+" "+t.D.Ra[this.da.code]+")",this.da.message,this.da);return this};
|
||||
s.ended=function(){return S(this,"ended")};s.seeking=function(){return S(this,"seeking")};s.pa=f;s.reportUserActivity=function(){this.pa=f};s.Sb=f;s.userActive=function(a){return a!==b?(a=!!a,a!==this.Sb&&((this.Sb=a)?(this.pa=f,this.p("vjs-user-inactive"),this.n("vjs-user-active"),this.l("useractive")):(this.pa=l,this.o&&this.o.R("mousemove",function(a){a.stopPropagation();a.preventDefault()}),this.p("vjs-user-active"),this.n("vjs-user-inactive"),this.l("userinactive"))),this):this.Sb};
|
||||
s.playbackRate=function(a){return a!==b?(T(this,"setPlaybackRate",a),this):this.o&&this.o.featuresPlaybackRate?S(this,"playbackRate"):1};s.xc=l;function P(a,c){return c!==b?(a.xc=!!c,a):a.xc}t.Ja=t.a.extend();t.Ja.prototype.m={we:"play",children:{playToggle:{},currentTimeDisplay:{},timeDivider:{},durationDisplay:{},remainingTimeDisplay:{},liveDisplay:{},progressControl:{},fullscreenToggle:{},volumeControl:{},muteToggle:{},playbackRateMenuButton:{}}};t.Ja.prototype.e=function(){return t.e("div",{className:"vjs-control-bar"})};
|
||||
t.Yb=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.Yb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-live-controls vjs-control"});this.v=t.e("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.t("Stream Type")+"</span>"+this.t("LIVE"),"aria-live":"off"});a.appendChild(this.v);return a};t.ac=t.u.extend({i:function(a,c){t.u.call(this,a,c);this.c(a,"play",this.Ob);this.c(a,"pause",this.Nb)}});s=t.ac.prototype;s.ua="Play";
|
||||
s.T=function(){return"vjs-play-control "+t.u.prototype.T.call(this)};s.s=function(){this.d.paused()?this.d.play():this.d.pause()};s.Ob=function(){this.p("vjs-paused");this.n("vjs-playing");this.b.children[0].children[0].innerHTML=this.t("Pause")};s.Nb=function(){this.p("vjs-playing");this.n("vjs-paused");this.b.children[0].children[0].innerHTML=this.t("Play")};t.hb=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.c(a,"timeupdate",this.fa)}});
|
||||
t.hb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});this.v=t.e("div",{className:"vjs-current-time-display",innerHTML:'<span class="vjs-control-text">Current Time </span>0:00',"aria-live":"off"});a.appendChild(this.v);return a};t.hb.prototype.fa=function(){var a=this.d.bb?this.d.G.currentTime:this.d.currentTime();this.v.innerHTML='<span class="vjs-control-text">'+this.t("Current Time")+"</span> "+t.za(a,this.d.duration())};
|
||||
t.ib=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.c(a,"timeupdate",this.fa)}});t.ib.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});this.v=t.e("div",{className:"vjs-duration-display",innerHTML:'<span class="vjs-control-text">'+this.t("Duration Time")+"</span> 0:00","aria-live":"off"});a.appendChild(this.v);return a};
|
||||
t.ib.prototype.fa=function(){var a=this.d.duration();a&&(this.v.innerHTML='<span class="vjs-control-text">'+this.t("Duration Time")+"</span> "+t.za(a))};t.gc=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.gc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"<div><span>/</span></div>"})};t.pb=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.c(a,"timeupdate",this.fa)}});
|
||||
t.pb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});this.v=t.e("div",{className:"vjs-remaining-time-display",innerHTML:'<span class="vjs-control-text">'+this.t("Remaining Time")+"</span> -0:00","aria-live":"off"});a.appendChild(this.v);return a};t.pb.prototype.fa=function(){this.d.duration()&&(this.v.innerHTML='<span class="vjs-control-text">'+this.t("Remaining Time")+"</span> -"+t.za(this.d.remainingTime()))};
|
||||
t.Ka=t.u.extend({i:function(a,c){t.u.call(this,a,c)}});t.Ka.prototype.ua="Fullscreen";t.Ka.prototype.T=function(){return"vjs-fullscreen-control "+t.u.prototype.T.call(this)};t.Ka.prototype.s=function(){this.d.isFullscreen()?(this.d.exitFullscreen(),this.xb.innerHTML=this.t("Fullscreen")):(this.d.requestFullscreen(),this.xb.innerHTML=this.t("Non-Fullscreen"))};t.ob=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.ob.prototype.m={children:{seekBar:{}}};
|
||||
t.ob.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.cc=t.S.extend({i:function(a,c){t.S.call(this,a,c);this.c(a,"timeupdate",this.oa);a.K(t.bind(this,this.oa))}});s=t.cc.prototype;s.m={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};s.Ec="timeupdate";s.e=function(){return t.S.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})};
|
||||
s.oa=function(){var a=this.d.bb?this.d.G.currentTime:this.d.currentTime();this.b.setAttribute("aria-valuenow",t.round(100*this.Gb(),2));this.b.setAttribute("aria-valuetext",t.za(a,this.d.duration()))};s.Gb=function(){return this.d.currentTime()/this.d.duration()};s.Za=function(a){t.S.prototype.Za.call(this,a);this.d.bb=f;this.me=!this.d.paused();this.d.pause()};s.$a=function(a){a=H(this,a)*this.d.duration();a==this.d.duration()&&(a-=0.1);this.d.currentTime(a)};
|
||||
s.Mb=function(a){t.S.prototype.Mb.call(this,a);this.d.bb=l;this.me&&this.d.play()};s.Oc=function(){this.d.currentTime(this.d.currentTime()+5)};s.Nc=function(){this.d.currentTime(this.d.currentTime()-5)};t.lb=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.c(a,"progress",this.update)}});t.lb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.t("Loaded")+"</span>: 0%</span>"})};
|
||||
t.lb.prototype.update=function(){var a,c,d,e,g=this.d.buffered();a=this.d.duration();var h,j=this.d;h=j.buffered();j=j.duration();h=h.end(h.length-1);h>j&&(h=j);j=this.b.children;this.b.style.width=100*(h/a||0)+"%";for(a=0;a<g.length;a++)c=g.start(a),d=g.end(a),(e=j[a])||(e=this.b.appendChild(t.e())),e.style.left=100*(c/h||0)+"%",e.style.width=100*((d-c)/h||0)+"%";for(a=j.length;a>g.length;a--)this.b.removeChild(j[a-1])};t.$b=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});
|
||||
t.$b.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.t("Progress")+"</span>: 0%</span>"})};t.La=t.$.extend({i:function(a,c){t.$.call(this,a,c);this.c(a,"timeupdate",this.fa)}});t.La.prototype.defaultValue="00:00";t.La.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})};
|
||||
t.La.prototype.fa=function(){var a=this.d.bb?this.d.G.currentTime:this.d.currentTime();this.b.innerHTML='<span class="vjs-control-text">'+t.za(a,this.d.duration())+"</span>"};t.rb=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.o&&a.o.featuresVolumeControl===l&&this.n("vjs-hidden");this.c(a,"loadstart",function(){a.o.featuresVolumeControl===l?this.n("vjs-hidden"):this.p("vjs-hidden")})}});t.rb.prototype.m={children:{volumeBar:{}}};
|
||||
t.rb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.qb=t.S.extend({i:function(a,c){t.S.call(this,a,c);this.c(a,"volumechange",this.oa);a.K(t.bind(this,this.oa))}});s=t.qb.prototype;s.oa=function(){this.b.setAttribute("aria-valuenow",t.round(100*this.d.volume(),2));this.b.setAttribute("aria-valuetext",t.round(100*this.d.volume(),2)+"%")};s.m={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"};
|
||||
s.Ec="volumechange";s.e=function(){return t.S.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};s.$a=function(a){this.d.muted()&&this.d.muted(l);this.d.volume(H(this,a))};s.Gb=function(){return this.d.muted()?0:this.d.volume()};s.Oc=function(){this.d.volume(this.d.volume()+0.1)};s.Nc=function(){this.d.volume(this.d.volume()-0.1)};t.hc=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});
|
||||
t.hc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})};t.sb=t.$.extend();t.sb.prototype.defaultValue="00:00";t.sb.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-volume-handle"})};
|
||||
t.ia=t.u.extend({i:function(a,c){t.u.call(this,a,c);this.c(a,"volumechange",this.update);a.o&&a.o.featuresVolumeControl===l&&this.n("vjs-hidden");this.c(a,"loadstart",function(){a.o.featuresVolumeControl===l?this.n("vjs-hidden"):this.p("vjs-hidden")})}});t.ia.prototype.e=function(){return t.u.prototype.e.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.t("Mute")+"</span></div>"})};
|
||||
t.ia.prototype.s=function(){this.d.muted(this.d.muted()?l:f)};t.ia.prototype.update=function(){var a=this.d.volume(),c=3;0===a||this.d.muted()?c=0:0.33>a?c=1:0.67>a&&(c=2);this.d.muted()?this.b.children[0].children[0].innerHTML!=this.t("Unmute")&&(this.b.children[0].children[0].innerHTML=this.t("Unmute")):this.b.children[0].children[0].innerHTML!=this.t("Mute")&&(this.b.children[0].children[0].innerHTML=this.t("Mute"));for(a=0;4>a;a++)t.p(this.b,"vjs-vol-"+a);t.n(this.b,"vjs-vol-"+c)};
|
||||
t.sa=t.N.extend({i:function(a,c){t.N.call(this,a,c);this.c(a,"volumechange",this.update);a.o&&a.o.featuresVolumeControl===l&&this.n("vjs-hidden");this.c(a,"loadstart",function(){a.o.featuresVolumeControl===l?this.n("vjs-hidden"):this.p("vjs-hidden")});this.n("vjs-menu-button")}});t.sa.prototype.xa=function(){var a=new t.ha(this.d,{lc:"div"}),c=new t.qb(this.d,this.m.Ae);c.c("focus",function(){a.n("vjs-lock-showing")});c.c("blur",function(){E(a)});a.V(c);return a};
|
||||
t.sa.prototype.s=function(){t.ia.prototype.s.call(this);t.N.prototype.s.call(this)};t.sa.prototype.e=function(){return t.u.prototype.e.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.t("Mute")+"</span></div>"})};t.sa.prototype.update=t.ia.prototype.update;t.bc=t.N.extend({i:function(a,c){t.N.call(this,a,c);this.Tc();this.Sc();this.c(a,"loadstart",this.Tc);this.c(a,"ratechange",this.Sc)}});s=t.bc.prototype;
|
||||
s.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-playback-rate vjs-menu-button vjs-control",innerHTML:'<div class="vjs-control-content"><span class="vjs-control-text">'+this.t("Playback Rate")+"</span></div>"});this.Ac=t.e("div",{className:"vjs-playback-rate-value",innerHTML:1});a.appendChild(this.Ac);return a};s.xa=function(){var a=new t.ha(this.k()),c=this.k().options().playbackRates;if(c)for(var d=c.length-1;0<=d;d--)a.V(new t.nb(this.k(),{rate:c[d]+"x"}));return a};
|
||||
s.oa=function(){this.w().setAttribute("aria-valuenow",this.k().playbackRate())};s.s=function(){for(var a=this.k().playbackRate(),c=this.k().options().playbackRates,d=c[0],e=0;e<c.length;e++)if(c[e]>a){d=c[e];break}this.k().playbackRate(d)};function ea(a){return a.k().o&&a.k().o.featuresPlaybackRate&&a.k().options().playbackRates&&0<a.k().options().playbackRates.length}s.Tc=function(){ea(this)?this.p("vjs-hidden"):this.n("vjs-hidden")};
|
||||
s.Sc=function(){ea(this)&&(this.Ac.innerHTML=this.k().playbackRate()+"x")};t.nb=t.J.extend({lc:"button",i:function(a,c){var d=this.label=c.rate,e=this.Hc=parseFloat(d,10);c.label=d;c.selected=1===e;t.J.call(this,a,c);this.c(a,"ratechange",this.update)}});t.nb.prototype.s=function(){t.J.prototype.s.call(this);this.k().playbackRate(this.Hc)};t.nb.prototype.update=function(){this.selected(this.k().playbackRate()==this.Hc)};
|
||||
t.ra=t.u.extend({i:function(a,c){t.u.call(this,a,c);this.update();a.c("posterchange",t.bind(this,this.update))}});t.ra.prototype.dispose=function(){this.k().j("posterchange",this.update);t.u.prototype.dispose.call(this)};t.ra.prototype.e=function(){var a=t.e("div",{className:"vjs-poster",tabIndex:-1});t.Wc||(this.Db=t.e("img"),a.appendChild(this.Db));return a};
|
||||
t.ra.prototype.update=function(){var a=this.k().poster(),c;this.Db?this.Db.src=a:(c="",a&&(c='url("'+a+'")'),this.b.style.backgroundImage=c);a?this.b.style.display="":this.Y()};t.ra.prototype.s=function(){this.d.play()};t.Zb=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.Zb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-loading-spinner"})};t.fb=t.u.extend();
|
||||
t.fb.prototype.e=function(){return t.u.prototype.e.call(this,"div",{className:"vjs-big-play-button",innerHTML:'<span aria-hidden="true"></span>',"aria-label":"play video"})};t.fb.prototype.s=function(){this.d.play()};t.jb=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.update();this.c(a,"error",this.update)}});t.jb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-error-display"});this.v=t.e("div");a.appendChild(this.v);return a};
|
||||
t.jb.prototype.update=function(){this.k().error()&&(this.v.innerHTML=this.t(this.k().error().message))};
|
||||
t.q=t.a.extend({i:function(a,c,d){c=c||{};c.Jc=l;t.a.call(this,a,c,d);this.featuresProgressEvents||(this.Bc=f,this.Gc=setInterval(t.bind(this,function(){var a=this.k().bufferedPercent();this.ld!=a&&this.k().l("progress");this.ld=a;1===a&&clearInterval(this.Gc)}),500));this.featuresTimeupdateEvents||(a=this.d,this.Lb=f,this.c(a,"play",this.Rc),this.c(a,"pause",this.cb),this.R("timeupdate",function(){this.featuresTimeupdateEvents=f;fa(this)}));var e;e=this.k();a=function(){if(e.controls()&&!e.usingNativeControls()){var a;
|
||||
this.c("mousedown",this.s);this.c("touchstart",function(){a=this.d.userActive()});this.c("touchmove",function(){a&&this.k().reportUserActivity()});this.c("touchend",function(a){a.preventDefault()});G(this);this.c("tap",this.Td)}};this.K(a);this.c(e,"controlsenabled",a);this.c(e,"controlsdisabled",this.Zd);this.K(function(){this.networkState&&0<this.networkState()&&this.k().l("loadstart")})}});s=t.q.prototype;
|
||||
s.Zd=function(){this.j("tap");this.j("touchstart");this.j("touchmove");this.j("touchleave");this.j("touchcancel");this.j("touchend");this.j("click");this.j("mousedown")};s.s=function(a){0===a.button&&this.k().controls()&&(this.k().paused()?this.k().play():this.k().pause())};s.Td=function(){this.k().userActive(!this.k().userActive())};function fa(a){a.Lb=l;a.cb();a.j("play",a.Rc);a.j("pause",a.cb)}
|
||||
s.Rc=function(){this.mc&&this.cb();this.mc=setInterval(t.bind(this,function(){this.k().l("timeupdate")}),250)};s.cb=function(){clearInterval(this.mc);this.k().l("timeupdate")};s.dispose=function(){this.Bc&&(this.Bc=l,clearInterval(this.Gc));this.Lb&&fa(this);t.a.prototype.dispose.call(this)};s.Qb=function(){this.Lb&&this.k().l("timeupdate")};s.Lc=m();t.q.prototype.featuresVolumeControl=f;t.q.prototype.featuresFullscreenResize=l;t.q.prototype.featuresPlaybackRate=l;
|
||||
t.q.prototype.featuresProgressEvents=l;t.q.prototype.featuresTimeupdateEvents=l;t.media={};
|
||||
t.h=t.q.extend({i:function(a,c,d){this.featuresVolumeControl=t.h.nd();this.featuresPlaybackRate=t.h.md();this.movingMediaElementInDOM=!t.$c;this.featuresProgressEvents=this.featuresFullscreenResize=f;t.q.call(this,a,c,d);for(d=t.h.kb.length-1;0<=d;d--)this.c(t.h.kb[d],this.vd);if((c=c.source)&&this.b.currentSrc!==c.src||a.I&&3===a.I.Bd)this.b.src=c.src;if(t.ec&&a.options().nativeControlsForTouch===f){var e,g,h,j;e=this;g=this.k();c=g.controls();e.b.controls=!!c;h=function(){e.b.controls=f};j=function(){e.b.controls=
|
||||
l};g.c("controlsenabled",h);g.c("controlsdisabled",j);c=function(){g.j("controlsenabled",h);g.j("controlsdisabled",j)};e.c("dispose",c);g.c("usingcustomcontrols",c);g.usingNativeControls(f)}a.K(function(){this.I&&(this.m.autoplay&&this.paused())&&(delete this.I.poster,this.play())});this.Ga()}});s=t.h.prototype;s.dispose=function(){t.h.Bb(this.b);t.q.prototype.dispose.call(this)};
|
||||
s.e=function(){var a=this.d,c=a.I,d;if(!c||this.movingMediaElementInDOM===l)c?(d=c.cloneNode(l),t.h.Bb(c),c=d,a.I=k):(c=t.e("video"),t.Kc(c,t.g.z(a.ie||{},{id:a.id()+"_html5_api","class":"vjs-tech"}))),c.player=a,t.Hb(c,a.w());d=["autoplay","preload","loop","muted"];for(var e=d.length-1;0<=e;e--){var g=d[e],h={};"undefined"!==typeof a.m[g]&&(h[g]=a.m[g]);t.Kc(c,h)}return c};s.vd=function(a){"error"==a.type&&this.error()?this.k().error(this.error().code):(a.bubbles=l,this.k().l(a))};s.play=function(){this.b.play()};
|
||||
s.pause=function(){this.b.pause()};s.paused=function(){return this.b.paused};s.currentTime=function(){return this.b.currentTime};s.Qb=function(a){try{this.b.currentTime=a}catch(c){t.log(c,"Video is not ready. (Video.js)")}};s.duration=function(){return this.b.duration||0};s.buffered=function(){return this.b.buffered};s.volume=function(){return this.b.volume};s.fe=function(a){this.b.volume=a};s.muted=function(){return this.b.muted};s.ce=function(a){this.b.muted=a};s.width=function(){return this.b.offsetWidth};
|
||||
s.height=function(){return this.b.offsetHeight};s.Ea=function(){return"function"==typeof this.b.webkitEnterFullScreen&&(/Android/.test(t.O)||!/Chrome|Mac OS X 10.5/.test(t.O))?f:l};
|
||||
s.pc=function(){var a=this.b;"webkitDisplayingFullscreen"in a&&this.R("webkitbeginfullscreen",function(){this.d.isFullscreen(f);this.R("webkitendfullscreen",function(){this.d.isFullscreen(l);this.d.l("fullscreenchange")});this.d.l("fullscreenchange")});a.paused&&a.networkState<=a.ne?(this.b.play(),setTimeout(function(){a.pause();a.webkitEnterFullScreen()},0)):a.webkitEnterFullScreen()};s.wd=function(){this.b.webkitExitFullScreen()};s.src=function(a){if(a===b)return this.b.src;this.b.src=a};
|
||||
s.load=function(){this.b.load()};s.currentSrc=function(){return this.b.currentSrc};s.poster=function(){return this.b.poster};s.Lc=function(a){this.b.poster=a};s.Da=function(){return this.b.Da};s.ee=function(a){this.b.Da=a};s.autoplay=function(){return this.b.autoplay};s.$d=function(a){this.b.autoplay=a};s.controls=function(){return this.b.controls};s.loop=function(){return this.b.loop};s.be=function(a){this.b.loop=a};s.error=function(){return this.b.error};s.seeking=function(){return this.b.seeking};
|
||||
s.ended=function(){return this.b.ended};s.playbackRate=function(){return this.b.playbackRate};s.de=function(a){this.b.playbackRate=a};s.networkState=function(){return this.b.networkState};t.h.isSupported=function(){try{t.A.volume=0.5}catch(a){return l}return!!t.A.canPlayType};t.h.vb=function(a){try{return!!t.A.canPlayType(a.type)}catch(c){return""}};t.h.nd=function(){var a=t.A.volume;t.A.volume=a/2+0.1;return a!==t.A.volume};
|
||||
t.h.md=function(){var a=t.A.playbackRate;t.A.playbackRate=a/2+0.1;return a!==t.A.playbackRate};var V,ga=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,ha=/^video\/mp4/i;t.h.Dc=function(){4<=t.Ub&&(V||(V=t.A.constructor.prototype.canPlayType),t.A.constructor.prototype.canPlayType=function(a){return a&&ga.test(a)?"maybe":V.call(this,a)});t.dd&&(V||(V=t.A.constructor.prototype.canPlayType),t.A.constructor.prototype.canPlayType=function(a){return a&&ha.test(a)?"maybe":V.call(this,a)})};
|
||||
t.h.le=function(){var a=t.A.constructor.prototype.canPlayType;t.A.constructor.prototype.canPlayType=V;V=k;return a};t.h.Dc();t.h.kb="loadstart suspend abort error emptied stalled loadedmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate progress play pause ratechange volumechange".split(" ");
|
||||
t.h.Bb=function(a){if(a){a.player=k;for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src");if("function"===typeof a.load)try{a.load()}catch(c){}}};
|
||||
t.f=t.q.extend({i:function(a,c,d){t.q.call(this,a,c,d);var e=c.source;d=c.parentEl;var g=this.b=t.e("div",{id:a.id()+"_temp_flash"}),h=a.id()+"_flash_api",j=a.m,j=t.g.z({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:j.autoplay,preload:j.Da,loop:j.loop,muted:j.muted},c.flashVars),n=t.g.z({wmode:"opaque",bgcolor:"#000000"},c.params),h=t.g.z({id:h,name:h,"class":"vjs-tech"},c.attributes);e&&(e.type&&t.f.Gd(e.type)?
|
||||
(e=t.f.Pc(e.src),j.rtmpConnection=encodeURIComponent(e.wb),j.rtmpStream=encodeURIComponent(e.Rb)):j.src=encodeURIComponent(t.tc(e.src)));t.Hb(g,d);c.startTime&&this.K(function(){this.load();this.play();this.currentTime(c.startTime)});t.Zc&&this.K(function(){this.c("mousemove",function(){this.k().l({type:"mousemove",bubbles:l})})});a.c("stageclick",a.reportUserActivity);this.b=t.f.oc(c.swf,g,j,n,h)}});t.f.prototype.dispose=function(){t.q.prototype.dispose.call(this)};t.f.prototype.play=function(){this.b.vjs_play()};
|
||||
t.f.prototype.pause=function(){this.b.vjs_pause()};t.f.prototype.src=function(a){if(a===b)return this.currentSrc();t.f.Fd(a)?(a=t.f.Pc(a),this.xe(a.wb),this.ye(a.Rb)):(a=t.tc(a),this.b.vjs_src(a));if(this.d.autoplay()){var c=this;setTimeout(function(){c.play()},0)}};t.f.prototype.setCurrentTime=function(a){this.Jd=a;this.b.vjs_setProperty("currentTime",a);t.q.prototype.Qb.call(this)};t.f.prototype.currentTime=function(){return this.seeking()?this.Jd||0:this.b.vjs_getProperty("currentTime")};
|
||||
t.f.prototype.currentSrc=function(){var a=this.b.vjs_getProperty("currentSrc");if(a==k){var c=this.rtmpConnection(),d=this.rtmpStream();c&&d&&(a=t.f.ge(c,d))}return a};t.f.prototype.load=function(){this.b.vjs_load()};t.f.prototype.poster=function(){this.b.vjs_getProperty("poster")};t.f.prototype.setPoster=m();t.f.prototype.buffered=function(){return t.zb(0,this.b.vjs_getProperty("buffered"))};t.f.prototype.Ea=q(l);t.f.prototype.pc=q(l);
|
||||
function ia(){var a=W[X],c=a.charAt(0).toUpperCase()+a.slice(1);ja["set"+c]=function(c){return this.b.vjs_setProperty(a,c)}}function ka(a){ja[a]=function(){return this.b.vjs_getProperty(a)}}
|
||||
var ja=t.f.prototype,W="rtmpConnection rtmpStream preload defaultPlaybackRate playbackRate autoplay loop mediaGroup controller controls volume muted defaultMuted".split(" "),la="error networkState readyState seeking initialTime duration startOffsetTime paused played seekable ended videoTracks audioTracks videoWidth videoHeight textTracks".split(" "),X;for(X=0;X<W.length;X++)ka(W[X]),ia();for(X=0;X<la.length;X++)ka(la[X]);t.f.isSupported=function(){return 10<=t.f.version()[0]};
|
||||
t.f.vb=function(a){if(!a.type)return"";a=a.type.replace(/;.*/,"").toLowerCase();if(a in t.f.yd||a in t.f.Qc)return"maybe"};t.f.yd={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"};t.f.Qc={"rtmp/mp4":"MP4","rtmp/flv":"FLV"};t.f.onReady=function(a){var c;if(c=(a=t.w(a))&&a.parentNode&&a.parentNode.player)a.player=c,t.f.checkReady(c.o)};t.f.checkReady=function(a){a.w()&&(a.w().vjs_getProperty?a.Ga():setTimeout(function(){t.f.checkReady(a)},50))};t.f.onEvent=function(a,c){t.w(a).player.l(c)};
|
||||
t.f.onError=function(a,c){var d=t.w(a).player,e="FLASH: "+c;"srcnotfound"==c?d.error({code:4,message:e}):d.error(e)};t.f.version=function(){var a="0,0,0";try{a=(new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(c){try{navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(a=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(d){}}return a.split(",")};
|
||||
t.f.oc=function(a,c,d,e,g){a=t.f.Ad(a,d,e,g);a=t.e("div",{innerHTML:a}).childNodes[0];d=c.parentNode;c.parentNode.replaceChild(a,c);var h=d.childNodes[0];setTimeout(function(){h.style.display="block"},1E3);return a};
|
||||
t.f.Ad=function(a,c,d,e){var g="",h="",j="";c&&t.g.X(c,function(a,c){g+=a+"="+c+"&"});d=t.g.z({movie:a,flashvars:g,allowScriptAccess:"always",allowNetworking:"all"},d);t.g.X(d,function(a,c){h+='<param name="'+a+'" value="'+c+'" />'});e=t.g.z({data:a,width:"100%",height:"100%"},e);t.g.X(e,function(a,c){j+=a+'="'+c+'" '});return'<object type="application/x-shockwave-flash"'+j+">"+h+"</object>"};t.f.ge=function(a,c){return a+"&"+c};
|
||||
t.f.Pc=function(a){var c={wb:"",Rb:""};if(!a)return c;var d=a.indexOf("&"),e;-1!==d?e=d+1:(d=e=a.lastIndexOf("/")+1,0===d&&(d=e=a.length));c.wb=a.substring(0,d);c.Rb=a.substring(e,a.length);return c};t.f.Gd=function(a){return a in t.f.Qc};t.f.fd=/^rtmp[set]?:\/\//i;t.f.Fd=function(a){return t.f.fd.test(a)};
|
||||
t.ed=t.a.extend({i:function(a,c,d){t.a.call(this,a,c,d);if(!a.m.sources||0===a.m.sources.length){c=0;for(d=a.m.techOrder;c<d.length;c++){var e=t.ba(d[c]),g=window.videojs[e];if(g&&g.isSupported()){Q(a,e);break}}}else a.src(a.m.sources)}});t.Player.prototype.textTracks=function(){return this.Fa=this.Fa||[]};
|
||||
function ma(a,c,d,e,g){var h=a.Fa=a.Fa||[];g=g||{};g.kind=c;g.label=d;g.language=e;c=t.ba(c||"subtitles");var j=new window.videojs[c+"Track"](a,g);h.push(j);j.Ab()&&a.K(function(){setTimeout(function(){Y(j.k(),j.id())},0)})}function Y(a,c,d){for(var e=a.Fa,g=0,h=e.length,j,n;g<h;g++)j=e[g],j.id()===c?(j.show(),n=j):d&&(j.M()==d&&0<j.mode())&&j.disable();(c=n?n.M():d?d:l)&&a.l(c+"trackchange")}
|
||||
t.B=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.L=c.id||"vjs_"+c.kind+"_"+c.language+"_"+t.r++;this.Mc=c.src;this.sd=c["default"]||c.dflt;this.je=c.title;this.Ua=c.srclang;this.Hd=c.label;this.ca=[];this.tb=[];this.ma=this.na=0}});s=t.B.prototype;s.M=p("H");s.src=p("Mc");s.Ab=p("sd");s.title=p("je");s.language=p("Ua");s.label=p("Hd");s.od=p("ca");s.gd=p("tb");s.readyState=p("na");s.mode=p("ma");s.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-"+this.H+" vjs-text-track"})};
|
||||
s.show=function(){na(this);this.ma=2;t.a.prototype.show.call(this)};s.Y=function(){na(this);this.ma=1;t.a.prototype.Y.call(this)};s.disable=function(){2==this.ma&&this.Y();this.d.j("timeupdate",t.bind(this,this.update,this.L));this.d.j("ended",t.bind(this,this.reset,this.L));this.reset();this.d.ka("textTrackDisplay").removeChild(this);this.ma=0};
|
||||
function na(a){0===a.na&&a.load();0===a.ma&&(a.d.c("timeupdate",t.bind(a,a.update,a.L)),a.d.c("ended",t.bind(a,a.reset,a.L)),("captions"===a.H||"subtitles"===a.H)&&a.d.ka("textTrackDisplay").V(a))}s.load=function(){0===this.na&&(this.na=1,t.get(this.Mc,t.bind(this,this.Wd),t.bind(this,this.Md)))};s.Md=function(a){this.error=a;this.na=3;this.l("error")};
|
||||
s.Wd=function(a){var c,d;a=a.split("\n");for(var e="",g=1,h=a.length;g<h;g++)if(e=t.trim(a[g])){-1==e.indexOf("--\x3e")?(c=e,e=t.trim(a[++g])):c=this.ca.length;c={id:c,index:this.ca.length};d=e.split(/[\t ]+/);c.startTime=oa(d[0]);c.ya=oa(d[2]);for(d=[];a[++g]&&(e=t.trim(a[g]));)d.push(e);c.text=d.join("<br/>");this.ca.push(c)}this.na=2;this.l("loaded")};
|
||||
function oa(a){var c=a.split(":");a=0;var d,e,g;3==c.length?(d=c[0],e=c[1],c=c[2]):(d=0,e=c[0],c=c[1]);c=c.split(/\s+/);c=c.splice(0,1)[0];c=c.split(/\.|,/);g=parseFloat(c[1]);c=c[0];a+=3600*parseFloat(d);a+=60*parseFloat(e);a+=parseFloat(c);g&&(a+=g/1E3);return a}
|
||||
s.update=function(){if(0<this.ca.length){var a=this.d.options().trackTimeOffset||0,a=this.d.currentTime()+a;if(this.Pb===b||a<this.Pb||this.Wa<=a){var c=this.ca,d=this.d.duration(),e=0,g=l,h=[],j,n,r,w;a>=this.Wa||this.Wa===b?w=this.Eb!==b?this.Eb:0:(g=f,w=this.Kb!==b?this.Kb:c.length-1);for(;;){r=c[w];if(r.ya<=a)e=Math.max(e,r.ya),r.Na&&(r.Na=l);else if(a<r.startTime){if(d=Math.min(d,r.startTime),r.Na&&(r.Na=l),!g)break}else g?(h.splice(0,0,r),n===b&&(n=w),j=w):(h.push(r),j===b&&(j=w),n=w),d=Math.min(d,
|
||||
r.ya),e=Math.max(e,r.startTime),r.Na=f;if(g)if(0===w)break;else w--;else if(w===c.length-1)break;else w++}this.tb=h;this.Wa=d;this.Pb=e;this.Eb=j;this.Kb=n;j=this.tb;n="";a=0;for(c=j.length;a<c;a++)n+='<span class="vjs-tt-cue">'+j[a].text+"</span>";this.b.innerHTML=n;this.l("cuechange")}}};s.reset=function(){this.Wa=0;this.Pb=this.d.duration();this.Kb=this.Eb=0};t.Wb=t.B.extend();t.Wb.prototype.H="captions";t.dc=t.B.extend();t.dc.prototype.H="subtitles";t.Xb=t.B.extend();t.Xb.prototype.H="chapters";
|
||||
t.fc=t.a.extend({i:function(a,c,d){t.a.call(this,a,c,d);if(a.m.tracks&&0<a.m.tracks.length){c=this.d;a=a.m.tracks;for(var e=0;e<a.length;e++)d=a[e],ma(c,d.kind,d.label,d.language,d)}}});t.fc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-text-track-display"})};t.aa=t.J.extend({i:function(a,c){var d=this.ea=c.track;c.label=d.label();c.selected=d.Ab();t.J.call(this,a,c);this.c(a,d.M()+"trackchange",this.update)}});
|
||||
t.aa.prototype.s=function(){t.J.prototype.s.call(this);Y(this.d,this.ea.L,this.ea.M())};t.aa.prototype.update=function(){this.selected(2==this.ea.mode())};t.mb=t.aa.extend({i:function(a,c){c.track={M:function(){return c.kind},k:a,label:function(){return c.kind+" off"},Ab:q(l),mode:q(l)};t.aa.call(this,a,c);this.selected(f)}});t.mb.prototype.s=function(){t.aa.prototype.s.call(this);Y(this.d,this.ea.L,this.ea.M())};
|
||||
t.mb.prototype.update=function(){for(var a=this.d.textTracks(),c=0,d=a.length,e,g=f;c<d;c++)e=a[c],e.M()==this.ea.M()&&2==e.mode()&&(g=l);this.selected(g)};t.U=t.N.extend({i:function(a,c){t.N.call(this,a,c);1>=this.Q.length&&this.Y()}});t.U.prototype.wa=function(){var a=[],c;a.push(new t.mb(this.d,{kind:this.H}));for(var d=0;d<this.d.textTracks().length;d++)c=this.d.textTracks()[d],c.M()===this.H&&a.push(new t.aa(this.d,{track:c}));return a};
|
||||
t.Ha=t.U.extend({i:function(a,c,d){t.U.call(this,a,c,d);this.b.setAttribute("aria-label","Captions Menu")}});t.Ha.prototype.H="captions";t.Ha.prototype.ua="Captions";t.Ha.prototype.className="vjs-captions-button";t.Ma=t.U.extend({i:function(a,c,d){t.U.call(this,a,c,d);this.b.setAttribute("aria-label","Subtitles Menu")}});t.Ma.prototype.H="subtitles";t.Ma.prototype.ua="Subtitles";t.Ma.prototype.className="vjs-subtitles-button";
|
||||
t.Ia=t.U.extend({i:function(a,c,d){t.U.call(this,a,c,d);this.b.setAttribute("aria-label","Chapters Menu")}});s=t.Ia.prototype;s.H="chapters";s.ua="Chapters";s.className="vjs-chapters-button";s.wa=function(){for(var a=[],c,d=0;d<this.d.textTracks().length;d++)c=this.d.textTracks()[d],c.M()===this.H&&a.push(new t.aa(this.d,{track:c}));return a};
|
||||
s.xa=function(){for(var a=this.d.textTracks(),c=0,d=a.length,e,g,h=this.Q=[];c<d;c++)if(e=a[c],e.M()==this.H)if(0===e.readyState())e.load(),e.c("loaded",t.bind(this,this.xa));else{g=e;break}a=this.Ba;a===b&&(a=new t.ha(this.d),a.ja().appendChild(t.e("li",{className:"vjs-menu-title",innerHTML:t.ba(this.H),he:-1})));if(g){e=g.ca;for(var j,c=0,d=e.length;c<d;c++)j=e[c],j=new t.gb(this.d,{track:g,cue:j}),h.push(j),a.V(j);this.V(a)}0<this.Q.length&&this.show();return a};
|
||||
t.gb=t.J.extend({i:function(a,c){var d=this.ea=c.track,e=this.cue=c.cue,g=a.currentTime();c.label=e.text;c.selected=e.startTime<=g&&g<e.ya;t.J.call(this,a,c);d.c("cuechange",t.bind(this,this.update))}});t.gb.prototype.s=function(){t.J.prototype.s.call(this);this.d.currentTime(this.cue.startTime);this.update(this.cue.startTime)};t.gb.prototype.update=function(){var a=this.cue,c=this.d.currentTime();this.selected(a.startTime<=c&&c<a.ya)};
|
||||
t.g.z(t.Ja.prototype.m.children,{subtitlesButton:{},captionsButton:{},chaptersButton:{}});
|
||||
if("undefined"!==typeof window.JSON&&"function"===typeof window.JSON.parse)t.JSON=window.JSON;else{t.JSON={};var Z=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;t.JSON.parse=function(a,c){function d(a,e){var j,n,r=a[e];if(r&&"object"===typeof r)for(j in r)Object.prototype.hasOwnProperty.call(r,j)&&(n=d(r,j),n!==b?r[j]=n:delete r[j]);return c.call(a,e,r)}var e;a=String(a);Z.lastIndex=0;Z.test(a)&&(a=a.replace(Z,function(a){return"\\u"+("0000"+
|
||||
a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse(): invalid or malformed JSON data");}}
|
||||
t.jc=function(){var a,c,d,e;a=document.getElementsByTagName("video");c=document.getElementsByTagName("audio");var g=[];if(a&&0<a.length){d=0;for(e=a.length;d<e;d++)g.push(a[d])}if(c&&0<c.length){d=0;for(e=c.length;d<e;d++)g.push(c[d])}if(g&&0<g.length){d=0;for(e=g.length;d<e;d++)if((c=g[d])&&c.getAttribute)c.player===b&&(a=c.getAttribute("data-setup"),a!==k&&videojs(c));else{t.ub();break}}else t.Uc||t.ub()};t.ub=function(){setTimeout(t.jc,1)};
|
||||
"complete"===document.readyState?t.Uc=f:t.R(window,"load",function(){t.Uc=f});t.ub();t.Yd=function(a,c){t.Player.prototype[a]=c};var pa=this;function $(a,c){var d=a.split("."),e=pa;!(d[0]in e)&&e.execScript&&e.execScript("var "+d[0]);for(var g;d.length&&(g=d.shift());)!d.length&&c!==b?e[g]=c:e=e[g]?e[g]:e[g]={}};$("videojs",t);$("_V_",t);$("videojs.options",t.options);$("videojs.players",t.Ca);$("videojs.TOUCH_ENABLED",t.ec);$("videojs.cache",t.va);$("videojs.Component",t.a);t.a.prototype.player=t.a.prototype.k;t.a.prototype.options=t.a.prototype.options;t.a.prototype.init=t.a.prototype.i;t.a.prototype.dispose=t.a.prototype.dispose;t.a.prototype.createEl=t.a.prototype.e;t.a.prototype.contentEl=t.a.prototype.ja;t.a.prototype.el=t.a.prototype.w;t.a.prototype.addChild=t.a.prototype.V;
|
||||
t.a.prototype.getChild=t.a.prototype.ka;t.a.prototype.getChildById=t.a.prototype.zd;t.a.prototype.children=t.a.prototype.children;t.a.prototype.initChildren=t.a.prototype.wc;t.a.prototype.removeChild=t.a.prototype.removeChild;t.a.prototype.on=t.a.prototype.c;t.a.prototype.off=t.a.prototype.j;t.a.prototype.one=t.a.prototype.R;t.a.prototype.trigger=t.a.prototype.l;t.a.prototype.triggerReady=t.a.prototype.Ga;t.a.prototype.show=t.a.prototype.show;t.a.prototype.hide=t.a.prototype.Y;
|
||||
t.a.prototype.width=t.a.prototype.width;t.a.prototype.height=t.a.prototype.height;t.a.prototype.dimensions=t.a.prototype.td;t.a.prototype.ready=t.a.prototype.K;t.a.prototype.addClass=t.a.prototype.n;t.a.prototype.removeClass=t.a.prototype.p;t.a.prototype.buildCSSClass=t.a.prototype.T;t.a.prototype.localize=t.a.prototype.t;t.Player.prototype.ended=t.Player.prototype.ended;t.Player.prototype.enterFullWindow=t.Player.prototype.qc;t.Player.prototype.exitFullWindow=t.Player.prototype.Cb;
|
||||
t.Player.prototype.preload=t.Player.prototype.Da;t.Player.prototype.remainingTime=t.Player.prototype.remainingTime;t.Player.prototype.supportsFullScreen=t.Player.prototype.Ea;t.Player.prototype.currentType=t.Player.prototype.pd;t.Player.prototype.requestFullScreen=t.Player.prototype.requestFullScreen;t.Player.prototype.requestFullscreen=t.Player.prototype.requestFullscreen;t.Player.prototype.cancelFullScreen=t.Player.prototype.cancelFullScreen;t.Player.prototype.exitFullscreen=t.Player.prototype.exitFullscreen;
|
||||
t.Player.prototype.isFullScreen=t.Player.prototype.isFullScreen;t.Player.prototype.isFullscreen=t.Player.prototype.isFullscreen;$("videojs.MediaLoader",t.ed);$("videojs.TextTrackDisplay",t.fc);$("videojs.ControlBar",t.Ja);$("videojs.Button",t.u);$("videojs.PlayToggle",t.ac);$("videojs.FullscreenToggle",t.Ka);$("videojs.BigPlayButton",t.fb);$("videojs.LoadingSpinner",t.Zb);$("videojs.CurrentTimeDisplay",t.hb);$("videojs.DurationDisplay",t.ib);$("videojs.TimeDivider",t.gc);
|
||||
$("videojs.RemainingTimeDisplay",t.pb);$("videojs.LiveDisplay",t.Yb);$("videojs.ErrorDisplay",t.jb);$("videojs.Slider",t.S);$("videojs.ProgressControl",t.ob);$("videojs.SeekBar",t.cc);$("videojs.LoadProgressBar",t.lb);$("videojs.PlayProgressBar",t.$b);$("videojs.SeekHandle",t.La);$("videojs.VolumeControl",t.rb);$("videojs.VolumeBar",t.qb);$("videojs.VolumeLevel",t.hc);$("videojs.VolumeMenuButton",t.sa);$("videojs.VolumeHandle",t.sb);$("videojs.MuteToggle",t.ia);$("videojs.PosterImage",t.ra);
|
||||
$("videojs.Menu",t.ha);$("videojs.MenuItem",t.J);$("videojs.MenuButton",t.N);$("videojs.PlaybackRateMenuButton",t.bc);t.N.prototype.createItems=t.N.prototype.wa;t.U.prototype.createItems=t.U.prototype.wa;t.Ia.prototype.createItems=t.Ia.prototype.wa;$("videojs.SubtitlesButton",t.Ma);$("videojs.CaptionsButton",t.Ha);$("videojs.ChaptersButton",t.Ia);$("videojs.MediaTechController",t.q);t.q.prototype.featuresVolumeControl=t.q.prototype.ue;t.q.prototype.featuresFullscreenResize=t.q.prototype.qe;
|
||||
t.q.prototype.featuresPlaybackRate=t.q.prototype.re;t.q.prototype.featuresProgressEvents=t.q.prototype.se;t.q.prototype.featuresTimeupdateEvents=t.q.prototype.te;t.q.prototype.setPoster=t.q.prototype.Lc;$("videojs.Html5",t.h);t.h.Events=t.h.kb;t.h.isSupported=t.h.isSupported;t.h.canPlaySource=t.h.vb;t.h.patchCanPlayType=t.h.Dc;t.h.unpatchCanPlayType=t.h.le;t.h.prototype.setCurrentTime=t.h.prototype.Qb;t.h.prototype.setVolume=t.h.prototype.fe;t.h.prototype.setMuted=t.h.prototype.ce;
|
||||
t.h.prototype.setPreload=t.h.prototype.ee;t.h.prototype.setAutoplay=t.h.prototype.$d;t.h.prototype.setLoop=t.h.prototype.be;t.h.prototype.enterFullScreen=t.h.prototype.pc;t.h.prototype.exitFullScreen=t.h.prototype.wd;t.h.prototype.playbackRate=t.h.prototype.playbackRate;t.h.prototype.setPlaybackRate=t.h.prototype.de;$("videojs.Flash",t.f);t.f.isSupported=t.f.isSupported;t.f.canPlaySource=t.f.vb;t.f.onReady=t.f.onReady;t.f.embed=t.f.oc;t.f.version=t.f.version;$("videojs.TextTrack",t.B);
|
||||
t.B.prototype.label=t.B.prototype.label;t.B.prototype.kind=t.B.prototype.M;t.B.prototype.mode=t.B.prototype.mode;t.B.prototype.cues=t.B.prototype.od;t.B.prototype.activeCues=t.B.prototype.gd;$("videojs.CaptionsTrack",t.Wb);$("videojs.SubtitlesTrack",t.dc);$("videojs.ChaptersTrack",t.Xb);$("videojs.autoSetup",t.jc);$("videojs.plugin",t.Yd);$("videojs.createTimeRange",t.zb);$("videojs.util",t.ga);t.ga.mergeOptions=t.ga.Va;t.addLanguage=t.hd;})();
|
||||
@@ -1,602 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.BigPlayButton
|
||||
|
||||
__EXTENDS__: [vjs.Button](vjs.Button.md)
|
||||
__DEFINED IN__: [src/js/big-play-button.js#L11](https://github.com/videojs/video.js/blob/master/src/js/big-play-button.js#L11)
|
||||
|
||||
Initial play button. Shows before the video has played. The hiding of the
|
||||
big play button is done via CSS and player states.
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [init](#init-player-options-ready-) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
> the constructor function for the class
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_inherited from_: [src/js/button.js#L15](https://github.com/videojs/video.js/blob/master/src/js/button.js#L15)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,601 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.Button
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/button.js#L10](https://github.com/videojs/video.js/blob/master/src/js/button.js#L10)
|
||||
|
||||
Base class for all buttons
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
> the constructor function for the class
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/button.js#L15](https://github.com/videojs/video.js/blob/master/src/js/button.js#L15)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,605 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.CaptionsButton
|
||||
|
||||
__EXTENDS__: [vjs.TextTrackButton](vjs.TextTrackButton.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L856](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L856)
|
||||
|
||||
The button component for toggling and selecting captions
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [createItems](#createitems) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
_inherited from_: [src/js/menu.js#L157](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L157)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### createItems()
|
||||
> Create the list of menu items. Specific to each subclass.
|
||||
|
||||
_inherited from_: [src/js/menu.js#L154](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L154)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/tracks.js#L858](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L858)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,735 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.CaptionsTrack
|
||||
|
||||
__EXTENDS__: [vjs.TextTrack](vjs.TextTrack.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L668](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L668)
|
||||
|
||||
The track component for managing the hiding and showing of captions
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [activate](#activate) _`inherited`_
|
||||
- [activeCues](#activecues) _`inherited`_
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel) _`inherited`_
|
||||
- [cues](#cues) _`inherited`_
|
||||
- [deactivate](#deactivate) _`inherited`_
|
||||
- [dflt](#dflt) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [disable](#disable) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [init](#init-player-options-) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [kind](#kind) _`inherited`_
|
||||
- [label](#label) _`inherited`_
|
||||
- [language](#language) _`inherited`_
|
||||
- [mode](#mode) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [readyState](#readystate) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [src](#src) _`inherited`_
|
||||
- [title](#title) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### activate()
|
||||
> Turn on cue tracking. Tracks that are showing OR hidden are active.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L373](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L373)
|
||||
|
||||
---
|
||||
|
||||
### activeCues()
|
||||
> Get the track active cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L268](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L268)
|
||||
|
||||
---
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl()
|
||||
> Create basic div to hold cue text
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L313](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### cues()
|
||||
> Get the track cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L253](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L253)
|
||||
|
||||
---
|
||||
|
||||
### deactivate()
|
||||
> Turn off cue tracking.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L396](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L396)
|
||||
|
||||
---
|
||||
|
||||
### dflt()
|
||||
> Get the track default value. ('default' is a reserved keyword)
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L194](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L194)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### disable()
|
||||
> Disable: Mode Off/Disable (0)
|
||||
> Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track.
|
||||
> No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L359](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L359)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide: Mode Hidden (1)
|
||||
> Indicates that the text track is active, but that the user agent is not actively displaying the cues.
|
||||
> If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily.
|
||||
> The user agent is maintaining a list of which cues are active, and events are being fired accordingly.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L344](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L344)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L134](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L134)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### kind()
|
||||
> Get the track kind value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L165](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L165)
|
||||
|
||||
---
|
||||
|
||||
### label()
|
||||
> Get the track label value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L238](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L238)
|
||||
|
||||
---
|
||||
|
||||
### language()
|
||||
> Get the track language value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L223](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L223)
|
||||
|
||||
---
|
||||
|
||||
### mode()
|
||||
> Get the track mode
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L305](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L305)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### readyState()
|
||||
> Get the track readyState
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L287](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L287)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show: Mode Showing (2)
|
||||
> Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily.
|
||||
> The user agent is maintaining a list of which cues are active, and events are being fired accordingly.
|
||||
> In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate;
|
||||
> for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion;
|
||||
> and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue.
|
||||
> The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute.
|
||||
> This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L329](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L329)
|
||||
|
||||
---
|
||||
|
||||
### src()
|
||||
> Get the track src value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L179](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### title()
|
||||
> Get the track title value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L208](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L208)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,605 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ChaptersButton
|
||||
|
||||
__EXTENDS__: [vjs.TextTrackButton](vjs.TextTrackButton.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L890](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L890)
|
||||
|
||||
The button component for toggling and selecting chapters
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [createItems](#createitems) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
_inherited from_: [src/js/menu.js#L157](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L157)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### createItems()
|
||||
> Create the list of menu items. Specific to each subclass.
|
||||
|
||||
_inherited from_: [src/js/menu.js#L154](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L154)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/tracks.js#L892](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L892)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,735 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ChaptersTrack
|
||||
|
||||
__EXTENDS__: [vjs.TextTrack](vjs.TextTrack.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L686](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L686)
|
||||
|
||||
The track component for managing the hiding and showing of chapters
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [activate](#activate) _`inherited`_
|
||||
- [activeCues](#activecues) _`inherited`_
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel) _`inherited`_
|
||||
- [cues](#cues) _`inherited`_
|
||||
- [deactivate](#deactivate) _`inherited`_
|
||||
- [dflt](#dflt) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [disable](#disable) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [init](#init-player-options-) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [kind](#kind) _`inherited`_
|
||||
- [label](#label) _`inherited`_
|
||||
- [language](#language) _`inherited`_
|
||||
- [mode](#mode) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [readyState](#readystate) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [src](#src) _`inherited`_
|
||||
- [title](#title) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### activate()
|
||||
> Turn on cue tracking. Tracks that are showing OR hidden are active.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L373](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L373)
|
||||
|
||||
---
|
||||
|
||||
### activeCues()
|
||||
> Get the track active cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L268](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L268)
|
||||
|
||||
---
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl()
|
||||
> Create basic div to hold cue text
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L313](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### cues()
|
||||
> Get the track cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L253](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L253)
|
||||
|
||||
---
|
||||
|
||||
### deactivate()
|
||||
> Turn off cue tracking.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L396](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L396)
|
||||
|
||||
---
|
||||
|
||||
### dflt()
|
||||
> Get the track default value. ('default' is a reserved keyword)
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L194](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L194)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### disable()
|
||||
> Disable: Mode Off/Disable (0)
|
||||
> Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track.
|
||||
> No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L359](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L359)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide: Mode Hidden (1)
|
||||
> Indicates that the text track is active, but that the user agent is not actively displaying the cues.
|
||||
> If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily.
|
||||
> The user agent is maintaining a list of which cues are active, and events are being fired accordingly.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L344](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L344)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L134](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L134)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### kind()
|
||||
> Get the track kind value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L165](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L165)
|
||||
|
||||
---
|
||||
|
||||
### label()
|
||||
> Get the track label value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L238](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L238)
|
||||
|
||||
---
|
||||
|
||||
### language()
|
||||
> Get the track language value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L223](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L223)
|
||||
|
||||
---
|
||||
|
||||
### mode()
|
||||
> Get the track mode
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L305](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L305)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### readyState()
|
||||
> Get the track readyState
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L287](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L287)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show: Mode Showing (2)
|
||||
> Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily.
|
||||
> The user agent is maintaining a list of which cues are active, and events are being fired accordingly.
|
||||
> In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate;
|
||||
> for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion;
|
||||
> and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue.
|
||||
> The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute.
|
||||
> This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L329](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L329)
|
||||
|
||||
---
|
||||
|
||||
### src()
|
||||
> Get the track src value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L179](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### title()
|
||||
> Get the track title value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L208](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L208)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,613 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ChaptersTrackMenuItem
|
||||
|
||||
__EXTENDS__: [vjs.MenuItem](vjs.MenuItem.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L978](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L978)
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [onClick](#onclick) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [selected](#selected-selected-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
_inherited from_: [src/js/menu.js#L64](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L64)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/tracks.js#L980](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L980)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick()
|
||||
> Handle a click on the menu item, and set it to selected
|
||||
|
||||
_inherited from_: [src/js/menu.js#L74](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L74)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### selected( selected )
|
||||
> Set this menu item as selected or not
|
||||
|
||||
##### PARAMETERS:
|
||||
* __selected__ `Boolean`
|
||||
|
||||
_inherited from_: [src/js/menu.js#L82](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L82)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,621 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.Component
|
||||
|
||||
__EXTENDS__: [vjs.CoreObject](vjs.CoreObject.md)
|
||||
__DEFINED IN__: [src/js/component.js#L35](https://github.com/videojs/video.js/blob/master/src/js/component.js#L35)
|
||||
|
||||
Base UI Component class
|
||||
|
||||
Components are embeddable UI objects that are represented by both a
|
||||
javascript object and an element in the DOM. They can be children of other
|
||||
components, and can have many children themselves.
|
||||
|
||||
// adding a button to the player
|
||||
var button = player.addChild('button');
|
||||
button.el(); // -> button element
|
||||
|
||||
<div class="video-js">
|
||||
<div class="vjs-button">Button</div>
|
||||
</div>
|
||||
|
||||
Components are also event emitters.
|
||||
|
||||
button.on('click', function(){
|
||||
console.log('Button Clicked!');
|
||||
});
|
||||
|
||||
button.trigger('customevent');
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [addChild](#addchild-child-options-)
|
||||
- [addClass](#addclass-classtoadd-)
|
||||
- [buildCSSClass](#buildcssclass)
|
||||
- [children](#children)
|
||||
- [contentEl](#contentel)
|
||||
- [createEl](#createel-tagname-attributes-)
|
||||
- [dimensions](#dimensions-width-height-)
|
||||
- [dispose](#dispose)
|
||||
- [el](#el)
|
||||
- [enableTouchActivity](#enabletouchactivity)
|
||||
- [getChild](#getchild-name-)
|
||||
- [getChildById](#getchildbyid-id-)
|
||||
- [hasClass](#hasclass-classtocheck-)
|
||||
- [height](#height-num-skiplisteners-)
|
||||
- [hide](#hide)
|
||||
- [id](#id)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [initChildren](#initchildren)
|
||||
- [name](#name)
|
||||
- [off](#off-first-second-third-)
|
||||
- [on](#on-first-second-third-)
|
||||
- [one](#one-first-second-third-)
|
||||
- [options](#options-obj-)
|
||||
- [player](#player)
|
||||
- [ready](#ready-fn-)
|
||||
- [removeChild](#removechild-component-)
|
||||
- [removeClass](#removeclass-classtoremove-)
|
||||
- [show](#show)
|
||||
- [trigger](#trigger-event-)
|
||||
- [triggerReady](#triggerready)
|
||||
- [width](#width-num-skiplisteners-)
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event)
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_defined in_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_defined in_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_defined in_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_defined in_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_defined in_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_defined in_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_defined in_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_defined in_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_defined in_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_defined in_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_defined in_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
> the constructor function for the class
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_defined in_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_defined in_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_defined in_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_defined in_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_defined in_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_defined in_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_defined in_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_defined in_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_defined in_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_defined in_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,601 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ControlBar
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/control-bar.js#L9](https://github.com/videojs/video.js/blob/master/src/js/control-bar/control-bar.js#L9)
|
||||
|
||||
Container of main controls
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [init](#init-player-options-ready-) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
> the constructor function for the class
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_inherited from_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.CoreObject
|
||||
|
||||
__DEFINED IN__: [src/js/core-object.js#L52](https://github.com/videojs/video.js/blob/master/src/js/core-object.js#L52)
|
||||
|
||||
Core Object/Class for objects that use inheritance + contstructors
|
||||
|
||||
To create a class that can be subclassed itself, extend the CoreObject class.
|
||||
|
||||
var Animal = CoreObject.extend();
|
||||
var Horse = Animal.extend();
|
||||
|
||||
The constructor can be defined through the init property of an object argument.
|
||||
|
||||
var Animal = CoreObject.extend({
|
||||
init: function(name, sound){
|
||||
this.name = name;
|
||||
}
|
||||
});
|
||||
|
||||
Other methods and properties can be added the same way, or directly to the
|
||||
prototype.
|
||||
|
||||
var Animal = CoreObject.extend({
|
||||
init: function(name){
|
||||
this.name = name;
|
||||
},
|
||||
getName: function(){
|
||||
return this.name;
|
||||
},
|
||||
sound: '...'
|
||||
});
|
||||
|
||||
Animal.prototype.makeSound = function(){
|
||||
alert(this.sound);
|
||||
};
|
||||
|
||||
To create an instance of a class, use the create method.
|
||||
|
||||
var fluffy = Animal.create('Fluffy');
|
||||
fluffy.getName(); // -> Fluffy
|
||||
|
||||
Methods and properties can be overridden in subclasses.
|
||||
|
||||
var Horse = Animal.extend({
|
||||
sound: 'Neighhhhh!'
|
||||
});
|
||||
|
||||
var horsey = Horse.create('Horsey');
|
||||
horsey.getName(); // -> Horsey
|
||||
horsey.makeSound(); // -> Alert: Neighhhhh!
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [create](#create-static)
|
||||
- [extend](#extend-props--static)
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### create() `STATIC`
|
||||
> Create a new instace of this Object class
|
||||
>
|
||||
> var myAnimal = Animal.create();
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.CoreObject` An instance of a CoreObject subclass
|
||||
|
||||
_defined in_: [src/js/core-object.js#L120](https://github.com/videojs/video.js/blob/master/src/js/core-object.js#L120)
|
||||
|
||||
---
|
||||
|
||||
### extend( props ) `STATIC`
|
||||
> Create a new object that inherits from this Object
|
||||
>
|
||||
> var Animal = CoreObject.extend();
|
||||
> var Horse = Animal.extend();
|
||||
|
||||
##### PARAMETERS:
|
||||
* __props__ `Object` Functions and properties to be applied to the
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.CoreObject` An object that inherits from CoreObject
|
||||
|
||||
_defined in_: [src/js/core-object.js#L70](https://github.com/videojs/video.js/blob/master/src/js/core-object.js#L70)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.CurrentTimeDisplay
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/time-display.js#L7](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L7)
|
||||
|
||||
Displays the current time
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/time-display.js#L9](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L9)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.DurationDisplay
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/time-display.js#L43](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L43)
|
||||
|
||||
Displays the duration
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/time-display.js#L45](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L45)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,665 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.Flash
|
||||
|
||||
__EXTENDS__: [vjs.MediaTechController](vjs.MediaTechController.md)
|
||||
__DEFINED IN__: [src/js/media/flash.js#L15](https://github.com/videojs/video.js/blob/master/src/js/media/flash.js#L15)
|
||||
|
||||
Flash Media Controller - Wrapper for fallback SWF API
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [initControlsListeners](#initcontrolslisteners) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [onClick](#onclick-event-) _`inherited`_
|
||||
- [onTap](#ontap) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [removeControlsListeners](#removecontrolslisteners) _`inherited`_
|
||||
- [setPoster](#setposter) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/media/flash.js#L17](https://github.com/videojs/video.js/blob/master/src/js/media/flash.js#L17)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### initControlsListeners()
|
||||
> Set up click and touch listeners for the playback element
|
||||
> On desktops, a click on the video itself will toggle playback,
|
||||
> on a mobile device a click on the video toggles controls.
|
||||
> (toggling controls is done by toggling the user state between active and
|
||||
> inactive)
|
||||
>
|
||||
> A tap can signal that a user has become active, or has become inactive
|
||||
> e.g. a quick tap on an iPhone movie should reveal the controls. Another
|
||||
> quick tap should hide them again (signaling the user is in an inactive
|
||||
> viewing state)
|
||||
>
|
||||
> In addition to this, we still want the user to be considered inactive after
|
||||
> a few seconds of inactivity.
|
||||
>
|
||||
> Note: the only part of iOS interaction we can't mimic with this setup
|
||||
> is a touch and hold on the video element counting as activity in order to
|
||||
> keep the controls showing, but that shouldn't be an issue. A touch and hold on
|
||||
> any controls will still keep the user active
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L55](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L55)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick( event )
|
||||
> Handle a click on the media element. By default will play/pause the media.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L139](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L139)
|
||||
|
||||
---
|
||||
|
||||
### onTap()
|
||||
> Handle a tap on the media element. By default it will toggle the user
|
||||
> activity state, which hides and shows the controls.
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L159](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L159)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### removeControlsListeners()
|
||||
> Remove the listeners used for click and tap controls. This is needed for
|
||||
> toggling to controls disabled, where a tap/touch should do nothing.
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L123](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L123)
|
||||
|
||||
---
|
||||
|
||||
### setPoster()
|
||||
> Provide a default setPoster method for techs
|
||||
>
|
||||
> Poster support for techs should be optional, so we don't want techs to
|
||||
> break if they don't have a way to set a poster.
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L261](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L261)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.FullscreenToggle
|
||||
|
||||
__EXTENDS__: [vjs.Button](vjs.Button.md)
|
||||
__DEFINED IN__: [src/js/control-bar/fullscreen-toggle.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/fullscreen-toggle.js#L8)
|
||||
|
||||
Toggle fullscreen video
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/fullscreen-toggle.js#L14](https://github.com/videojs/video.js/blob/master/src/js/control-bar/fullscreen-toggle.js#L14)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,665 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.Html5
|
||||
|
||||
__EXTENDS__: [vjs.MediaTechController](vjs.MediaTechController.md)
|
||||
__DEFINED IN__: [src/js/media/html5.js#L12](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L12)
|
||||
|
||||
HTML5 Media Controller - Wrapper for HTML5 Media API
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [initControlsListeners](#initcontrolslisteners) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [onClick](#onclick-event-) _`inherited`_
|
||||
- [onTap](#ontap) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [removeControlsListeners](#removecontrolslisteners) _`inherited`_
|
||||
- [setPoster](#setposter) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/media/html5.js#L14](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L14)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### initControlsListeners()
|
||||
> Set up click and touch listeners for the playback element
|
||||
> On desktops, a click on the video itself will toggle playback,
|
||||
> on a mobile device a click on the video toggles controls.
|
||||
> (toggling controls is done by toggling the user state between active and
|
||||
> inactive)
|
||||
>
|
||||
> A tap can signal that a user has become active, or has become inactive
|
||||
> e.g. a quick tap on an iPhone movie should reveal the controls. Another
|
||||
> quick tap should hide them again (signaling the user is in an inactive
|
||||
> viewing state)
|
||||
>
|
||||
> In addition to this, we still want the user to be considered inactive after
|
||||
> a few seconds of inactivity.
|
||||
>
|
||||
> Note: the only part of iOS interaction we can't mimic with this setup
|
||||
> is a touch and hold on the video element counting as activity in order to
|
||||
> keep the controls showing, but that shouldn't be an issue. A touch and hold on
|
||||
> any controls will still keep the user active
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L55](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L55)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick( event )
|
||||
> Handle a click on the media element. By default will play/pause the media.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L139](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L139)
|
||||
|
||||
---
|
||||
|
||||
### onTap()
|
||||
> Handle a tap on the media element. By default it will toggle the user
|
||||
> activity state, which hides and shows the controls.
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L159](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L159)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### removeControlsListeners()
|
||||
> Remove the listeners used for click and tap controls. This is needed for
|
||||
> toggling to controls disabled, where a tap/touch should do nothing.
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L123](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L123)
|
||||
|
||||
---
|
||||
|
||||
### setPoster()
|
||||
> Provide a default setPoster method for techs
|
||||
>
|
||||
> Poster support for techs should be optional, so we don't want techs to
|
||||
> break if they don't have a way to set a poster.
|
||||
|
||||
_inherited from_: [src/js/media/media.js#L261](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L261)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.JSON
|
||||
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [parse](#parse-text-reviver-)
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### parse( text, [reviver] )
|
||||
> parse the json
|
||||
|
||||
##### PARAMETERS:
|
||||
* __text__ `String` The JSON string to parse
|
||||
* __reviver__ `Function` _(OPTIONAL)_ Optional function that can transform the results
|
||||
|
||||
##### RETURNS:
|
||||
* `Object|Array` The parsed JSON
|
||||
|
||||
_defined in_: [src/js/json.js#L34](https://github.com/videojs/video.js/blob/master/src/js/json.js#L34)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.LoadProgressBar
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/progress-control.js#L117](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L117)
|
||||
|
||||
Shows load progress
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/progress-control.js#L119](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L119)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.LoadingSpinner
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/loading-spinner.js#L10](https://github.com/videojs/video.js/blob/master/src/js/loading-spinner.js#L10)
|
||||
|
||||
Loading spinner for waiting events
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/loading-spinner.js#L12](https://github.com/videojs/video.js/blob/master/src/js/loading-spinner.js#L12)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,601 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.MediaLoader
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/media/loader.js#L7](https://github.com/videojs/video.js/blob/master/src/js/media/loader.js#L7)
|
||||
|
||||
The Media Loader is the component that decides which playback technology to load
|
||||
when the player is initialized.
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/media/loader.js#L9](https://github.com/videojs/video.js/blob/master/src/js/media/loader.js#L9)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,665 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.MediaTechController
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/media/media.js#L12](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L12)
|
||||
|
||||
Base class for media (HTML5 Video, Flash) controllers
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [initControlsListeners](#initcontrolslisteners)
|
||||
- [onClick](#onclick-event-)
|
||||
- [onTap](#ontap)
|
||||
- [removeControlsListeners](#removecontrolslisteners)
|
||||
- [setPoster](#setposter)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_defined in_: [src/js/media/media.js#L14](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L14)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### initControlsListeners()
|
||||
> Set up click and touch listeners for the playback element
|
||||
> On desktops, a click on the video itself will toggle playback,
|
||||
> on a mobile device a click on the video toggles controls.
|
||||
> (toggling controls is done by toggling the user state between active and
|
||||
> inactive)
|
||||
>
|
||||
> A tap can signal that a user has become active, or has become inactive
|
||||
> e.g. a quick tap on an iPhone movie should reveal the controls. Another
|
||||
> quick tap should hide them again (signaling the user is in an inactive
|
||||
> viewing state)
|
||||
>
|
||||
> In addition to this, we still want the user to be considered inactive after
|
||||
> a few seconds of inactivity.
|
||||
>
|
||||
> Note: the only part of iOS interaction we can't mimic with this setup
|
||||
> is a touch and hold on the video element counting as activity in order to
|
||||
> keep the controls showing, but that shouldn't be an issue. A touch and hold on
|
||||
> any controls will still keep the user active
|
||||
|
||||
_defined in_: [src/js/media/media.js#L55](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L55)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick( event )
|
||||
> Handle a click on the media element. By default will play/pause the media.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__
|
||||
|
||||
_defined in_: [src/js/media/media.js#L139](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L139)
|
||||
|
||||
---
|
||||
|
||||
### onTap()
|
||||
> Handle a tap on the media element. By default it will toggle the user
|
||||
> activity state, which hides and shows the controls.
|
||||
|
||||
_defined in_: [src/js/media/media.js#L159](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L159)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### removeControlsListeners()
|
||||
> Remove the listeners used for click and tap controls. This is needed for
|
||||
> toggling to controls disabled, where a tap/touch should do nothing.
|
||||
|
||||
_defined in_: [src/js/media/media.js#L123](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L123)
|
||||
|
||||
---
|
||||
|
||||
### setPoster()
|
||||
> Provide a default setPoster method for techs
|
||||
>
|
||||
> Poster support for techs should be optional, so we don't want techs to
|
||||
> break if they don't have a way to set a poster.
|
||||
|
||||
_defined in_: [src/js/media/media.js#L261](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L261)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,610 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.Menu
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/menu.js#L12](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L12)
|
||||
|
||||
The Menu component is used to build pop up menus, including subtitle and
|
||||
captions selection menus.
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [addItem](#additem-component-)
|
||||
- [createEl](#createel-tagname-attributes-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [init](#init-player-options-ready-) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### addItem( component )
|
||||
> Add a menu item to the menu
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `Object|String` Component or component type to add
|
||||
|
||||
_defined in_: [src/js/menu.js#L18](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L18)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
_defined in_: [src/js/menu.js#L26](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L26)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options, ready )
|
||||
> the constructor function for the class
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
* __ready__
|
||||
|
||||
_inherited from_: [src/js/component.js#L41](https://github.com/videojs/video.js/blob/master/src/js/component.js#L41)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,604 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.MenuButton
|
||||
|
||||
__EXTENDS__: [vjs.Button](vjs.Button.md)
|
||||
__DEFINED IN__: [src/js/menu.js#L99](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L99)
|
||||
|
||||
A button class with a popup menu
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [buildCSSClass](#buildcssclass)
|
||||
- [createItems](#createitems)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
_defined in_: [src/js/menu.js#L157](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L157)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### createItems()
|
||||
> Create the list of menu items. Specific to each subclass.
|
||||
|
||||
_defined in_: [src/js/menu.js#L154](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L154)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/menu.js#L101](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L101)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,615 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.MenuItem
|
||||
|
||||
__EXTENDS__: [vjs.Button](vjs.Button.md)
|
||||
__DEFINED IN__: [src/js/menu.js#L55](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L55)
|
||||
|
||||
The component for a menu item. `<li>`
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [createEl](#createel-tagname-attributes-)
|
||||
- [init](#init-player-options-)
|
||||
- [onClick](#onclick)
|
||||
- [selected](#selected-selected-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
_defined in_: [src/js/menu.js#L64](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L64)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/menu.js#L57](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L57)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick()
|
||||
> Handle a click on the menu item, and set it to selected
|
||||
|
||||
_defined in_: [src/js/menu.js#L74](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L74)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### selected( selected )
|
||||
> Set this menu item as selected or not
|
||||
|
||||
##### PARAMETERS:
|
||||
* __selected__ `Boolean`
|
||||
|
||||
_defined in_: [src/js/menu.js#L82](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L82)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.MuteToggle
|
||||
|
||||
__EXTENDS__: [vjs.Button](vjs.Button.md)
|
||||
__DEFINED IN__: [src/js/control-bar/mute-toggle.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/mute-toggle.js#L8)
|
||||
|
||||
A button component for muting the audio
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/mute-toggle.js#L10](https://github.com/videojs/video.js/blob/master/src/js/control-bar/mute-toggle.js#L10)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,615 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.OffTextTrackMenuItem
|
||||
|
||||
__EXTENDS__: [vjs.TextTrackMenuItem](vjs.TextTrackMenuItem.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L754](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L754)
|
||||
|
||||
A special menu item for turning of a specific type of text track
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [onClick](#onclick) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [selected](#selected-selected-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
_inherited from_: [src/js/menu.js#L64](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L64)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/tracks.js#L756](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L756)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick()
|
||||
> Handle a click on the menu item, and set it to selected
|
||||
|
||||
_inherited from_: [src/js/menu.js#L74](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L74)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### selected( selected )
|
||||
> Set this menu item as selected or not
|
||||
|
||||
##### PARAMETERS:
|
||||
* __selected__ `Boolean`
|
||||
|
||||
_inherited from_: [src/js/menu.js#L82](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L82)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.PlayProgressBar
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/progress-control.js#L175](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L175)
|
||||
|
||||
Shows play progress
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/progress-control.js#L177](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L177)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.PlayToggle
|
||||
|
||||
__EXTENDS__: [vjs.Button](vjs.Button.md)
|
||||
__DEFINED IN__: [src/js/control-bar/play-toggle.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/play-toggle.js#L8)
|
||||
|
||||
Button to toggle between play and pause
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/play-toggle.js#L10](https://github.com/videojs/video.js/blob/master/src/js/control-bar/play-toggle.js#L10)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,622 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.PosterImage
|
||||
|
||||
__EXTENDS__: [vjs.Button](vjs.Button.md)
|
||||
__DEFINED IN__: [src/js/poster.js#L10](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L10)
|
||||
|
||||
The component that handles showing the poster image.
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [createEl](#createel)
|
||||
- [dispose](#dispose)
|
||||
- [init](#init-player-options-)
|
||||
- [onClick](#onclick)
|
||||
- [setSrc](#setsrc-url-)
|
||||
- [update](#update)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl()
|
||||
> Create the poster image element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_defined in_: [src/js/poster.js#L32](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L32)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Clean up the poster image
|
||||
|
||||
_defined in_: [src/js/poster.js#L23](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L23)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/poster.js#L12](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L12)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick()
|
||||
> Event handler for clicks on the poster image
|
||||
|
||||
_defined in_: [src/js/poster.js#L95](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L95)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### setSrc( url )
|
||||
> Set the poster source depending on the display method
|
||||
|
||||
##### PARAMETERS:
|
||||
* __url__
|
||||
|
||||
_defined in_: [src/js/poster.js#L75](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L75)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### update()
|
||||
> Event handler for updates to the player's poster source
|
||||
|
||||
_defined in_: [src/js/poster.js#L55](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L55)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,600 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ProgressControl
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/progress-control.js#L9](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L9)
|
||||
|
||||
The Progress Control component contains the seek bar, load progress,
|
||||
and play progress
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/progress-control.js#L11](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L11)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,599 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.RemainingTimeDisplay
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/time-display.js#L108](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L108)
|
||||
|
||||
Displays the time left in the video
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/time-display.js#L110](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L110)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,611 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.SeekBar
|
||||
|
||||
__EXTENDS__: [vjs.Slider](vjs.Slider.md)
|
||||
__DEFINED IN__: [src/js/control-bar/progress-control.js#L35](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L35)
|
||||
|
||||
Seek Bar and holder for the progress bars
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [contentEl](#contentel) _`inherited`_
|
||||
- [createEl](#createel-tagname-attributes-) _`inherited`_
|
||||
- [dimensions](#dimensions-width-height-) _`inherited`_
|
||||
- [dispose](#dispose) _`inherited`_
|
||||
- [el](#el) _`inherited`_
|
||||
- [enableTouchActivity](#enabletouchactivity) _`inherited`_
|
||||
- [getChild](#getchild-name-) _`inherited`_
|
||||
- [getChildById](#getchildbyid-id-) _`inherited`_
|
||||
- [hasClass](#hasclass-classtocheck-) _`inherited`_
|
||||
- [height](#height-num-skiplisteners-) _`inherited`_
|
||||
- [hide](#hide) _`inherited`_
|
||||
- [id](#id) _`inherited`_
|
||||
- [initChildren](#initchildren) _`inherited`_
|
||||
- [name](#name) _`inherited`_
|
||||
- [off](#off-first-second-third-) _`inherited`_
|
||||
- [on](#on-first-second-third-) _`inherited`_
|
||||
- [onClick](#onclick-event-) _`inherited`_
|
||||
- [one](#one-first-second-third-) _`inherited`_
|
||||
- [options](#options-obj-) _`inherited`_
|
||||
- [player](#player) _`inherited`_
|
||||
- [ready](#ready-fn-) _`inherited`_
|
||||
- [removeChild](#removechild-component-) _`inherited`_
|
||||
- [removeClass](#removeclass-classtoremove-) _`inherited`_
|
||||
- [show](#show) _`inherited`_
|
||||
- [trigger](#trigger-event-) _`inherited`_
|
||||
- [triggerReady](#triggerready) _`inherited`_
|
||||
- [width](#width-num-skiplisteners-) _`inherited`_
|
||||
|
||||
- [EVENTS](#events)
|
||||
- [resize](#resize-event) _`inherited`_
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addChild( child, [options] )
|
||||
> Adds a child component inside this component
|
||||
>
|
||||
> myComponent.el();
|
||||
> // -> <div class='my-component'></div>
|
||||
> myComonent.children();
|
||||
> // [empty array]
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton');
|
||||
> // -> <div class='my-component'><div class="my-button">myButton<div></div>
|
||||
> // -> myButton === myComonent.children()[0];
|
||||
>
|
||||
> Pass in options for child constructors and options for children of the child
|
||||
>
|
||||
> var myButton = myComponent.addChild('MyButton', {
|
||||
> text: 'Press Me',
|
||||
> children: {
|
||||
> buttonChildExample: {
|
||||
> buttonChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
|
||||
##### PARAMETERS:
|
||||
* __child__ `String|vjs.Component` The class name or instance of a child to add
|
||||
* __options__ `Object` _(OPTIONAL)_ Options, including options to be passed to children of the child.
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The child component (created by this process if a string was used)
|
||||
|
||||
_inherited from_: [src/js/component.js#L362](https://github.com/videojs/video.js/blob/master/src/js/component.js#L362)
|
||||
|
||||
---
|
||||
|
||||
### addClass( classToAdd )
|
||||
> Add a CSS class name to the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToAdd__ `String` Classname to add
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L826](https://github.com/videojs/video.js/blob/master/src/js/component.js#L826)
|
||||
|
||||
---
|
||||
|
||||
### buildCSSClass()
|
||||
> Allows sub components to stack CSS class names
|
||||
|
||||
##### RETURNS:
|
||||
* `String` The constructed class name
|
||||
|
||||
_inherited from_: [src/js/component.js#L536](https://github.com/videojs/video.js/blob/master/src/js/component.js#L536)
|
||||
|
||||
---
|
||||
|
||||
### children()
|
||||
> Get an array of all child components
|
||||
>
|
||||
> var kids = myComponent.children();
|
||||
|
||||
##### RETURNS:
|
||||
* `Array` The children
|
||||
|
||||
_inherited from_: [src/js/component.js#L296](https://github.com/videojs/video.js/blob/master/src/js/component.js#L296)
|
||||
|
||||
---
|
||||
|
||||
### contentEl()
|
||||
> Return the component's DOM element for embedding content.
|
||||
> Will either be el_ or a new element defined in createEl.
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L239](https://github.com/videojs/video.js/blob/master/src/js/component.js#L239)
|
||||
|
||||
---
|
||||
|
||||
### createEl( [tagName], [attributes] )
|
||||
> Create the component's DOM element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __tagName__ `String` _(OPTIONAL)_ Element's node type. e.g. 'div'
|
||||
* __attributes__ `Object` _(OPTIONAL)_ An object of element attributes that should be set on the element
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L200](https://github.com/videojs/video.js/blob/master/src/js/component.js#L200)
|
||||
|
||||
---
|
||||
|
||||
### dimensions( width, height )
|
||||
> Set both width and height at the same time
|
||||
|
||||
##### PARAMETERS:
|
||||
* __width__ `Number|String`
|
||||
* __height__ `Number|String`
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` The component
|
||||
|
||||
_inherited from_: [src/js/component.js#L938](https://github.com/videojs/video.js/blob/master/src/js/component.js#L938)
|
||||
|
||||
---
|
||||
|
||||
### dispose()
|
||||
> Dispose of the component and all child components
|
||||
|
||||
_inherited from_: [src/js/component.js#L84](https://github.com/videojs/video.js/blob/master/src/js/component.js#L84)
|
||||
|
||||
---
|
||||
|
||||
### el()
|
||||
> Get the component's DOM element
|
||||
>
|
||||
> var domEl = myComponent.el();
|
||||
|
||||
##### RETURNS:
|
||||
* `Element`
|
||||
|
||||
_inherited from_: [src/js/component.js#L220](https://github.com/videojs/video.js/blob/master/src/js/component.js#L220)
|
||||
|
||||
---
|
||||
|
||||
### enableTouchActivity()
|
||||
> Report user touch activity when touch events occur
|
||||
>
|
||||
> User activity is used to determine when controls should show/hide. It's
|
||||
> relatively simple when it comes to mouse events, because any mouse event
|
||||
> should show the controls. So we capture mouse events that bubble up to the
|
||||
> player and report activity when that happens.
|
||||
>
|
||||
> With touch events it isn't as easy. We can't rely on touch events at the
|
||||
> player level, because a tap (touchstart + touchend) on the video itself on
|
||||
> mobile devices is meant to turn controls off (and on). User activity is
|
||||
> checked asynchronously, so what could happen is a tap event on the video
|
||||
> turns the controls off, then the touchend event bubbles up to the player,
|
||||
> which if it reported user activity, would turn the controls right back on.
|
||||
> (We also don't want to completely block touch events from bubbling up)
|
||||
>
|
||||
> Also a touchmove, touch+hold, and anything other than a tap is not supposed
|
||||
> to turn the controls back on on a mobile device.
|
||||
>
|
||||
> Here we're setting the default component behavior to report user activity
|
||||
> whenever touch events happen, and this can be turned off by components that
|
||||
> want touch events to act differently.
|
||||
|
||||
_inherited from_: [src/js/component.js#L1120](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1120)
|
||||
|
||||
---
|
||||
|
||||
### getChild( name )
|
||||
> Returns a child component with the provided name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L330](https://github.com/videojs/video.js/blob/master/src/js/component.js#L330)
|
||||
|
||||
---
|
||||
|
||||
### getChildById( id )
|
||||
> Returns a child component with the provided ID
|
||||
|
||||
##### PARAMETERS:
|
||||
* __id__
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L313](https://github.com/videojs/video.js/blob/master/src/js/component.js#L313)
|
||||
|
||||
---
|
||||
|
||||
### hasClass( classToCheck )
|
||||
> Check if a component's element has a CSS class name
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToCheck__ `String` Classname to check
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L816](https://github.com/videojs/video.js/blob/master/src/js/component.js#L816)
|
||||
|
||||
---
|
||||
|
||||
### height( [num], [skipListeners] )
|
||||
> Get or set the height of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ New component height
|
||||
* __skipListeners__ `Boolean` _(OPTIONAL)_ Skip the resize event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the height
|
||||
* `Number|String` The height, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L927](https://github.com/videojs/video.js/blob/master/src/js/component.js#L927)
|
||||
|
||||
---
|
||||
|
||||
### hide()
|
||||
> Hide the component element if currently showing
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L857](https://github.com/videojs/video.js/blob/master/src/js/component.js#L857)
|
||||
|
||||
---
|
||||
|
||||
### id()
|
||||
> Get the component's ID
|
||||
>
|
||||
> var id = myComponent.id();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L258](https://github.com/videojs/video.js/blob/master/src/js/component.js#L258)
|
||||
|
||||
---
|
||||
|
||||
### init( player, options )
|
||||
|
||||
##### PARAMETERS:
|
||||
* __player__
|
||||
* __options__
|
||||
|
||||
_defined in_: [src/js/control-bar/progress-control.js#L37](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L37)
|
||||
|
||||
---
|
||||
|
||||
### initChildren()
|
||||
> Add and initialize default child components from options
|
||||
>
|
||||
> // when an instance of MyComponent is created, all children in options
|
||||
> // will be added to the instance by their name strings and options
|
||||
> MyComponent.prototype.options_.children = {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> // Or when creating the component
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: {
|
||||
> myChildComponent: {
|
||||
> myChildOption: true
|
||||
> }
|
||||
> }
|
||||
> });
|
||||
>
|
||||
> The children option can also be an Array of child names or
|
||||
> child options objects (that also include a 'name' key).
|
||||
>
|
||||
> var myComp = new MyComponent(player, {
|
||||
> children: [
|
||||
> 'button',
|
||||
> {
|
||||
> name: 'button',
|
||||
> someOtherOption: true
|
||||
> }
|
||||
> ]
|
||||
> });
|
||||
|
||||
_inherited from_: [src/js/component.js#L481](https://github.com/videojs/video.js/blob/master/src/js/component.js#L481)
|
||||
|
||||
---
|
||||
|
||||
### name()
|
||||
> Get the component's name. The name is often used to reference the component.
|
||||
>
|
||||
> var name = myComponent.name();
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/component.js#L277](https://github.com/videojs/video.js/blob/master/src/js/component.js#L277)
|
||||
|
||||
---
|
||||
|
||||
### off( [first], [second], [third] )
|
||||
> Remove an event listener from this component's element
|
||||
>
|
||||
> myComponent.off('eventType', myFunc);
|
||||
>
|
||||
> If myFunc is excluded, ALL listeners for the event type will be removed.
|
||||
> If eventType is excluded, ALL listeners will be removed from the component.
|
||||
>
|
||||
> Alternatively you can use `off` to remove listeners that were added to other
|
||||
> elements or components using `myComponent.on(otherComponent...`.
|
||||
> In this case both the event type and listener function are REQUIRED.
|
||||
>
|
||||
> myComponent.off(otherElement, 'eventType', myFunc);
|
||||
> myComponent.off(otherComponent, 'eventType', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` _(OPTIONAL)_ The event type or other component
|
||||
* __second__ `Function|String` _(OPTIONAL)_ The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L646](https://github.com/videojs/video.js/blob/master/src/js/component.js#L646)
|
||||
|
||||
---
|
||||
|
||||
### on( first, second, third )
|
||||
> Add an event listener to this component's element
|
||||
>
|
||||
> var myFunc = function(){
|
||||
> var myComponent = this;
|
||||
> // Do something when the event is fired
|
||||
> };
|
||||
>
|
||||
> myComponent.on('eventType', myFunc);
|
||||
>
|
||||
> The context of myFunc will be myComponent unless previously bound.
|
||||
>
|
||||
> Alternatively, you can add a listener to another element or component.
|
||||
>
|
||||
> myComponent.on(otherElement, 'eventName', myFunc);
|
||||
> myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
>
|
||||
> The benefit of using this over `vjs.on(otherElement, 'eventName', myFunc)`
|
||||
> and `otherComponent.on('eventName', myFunc)` is that this way the listeners
|
||||
> will be automatically cleaned up when either component is diposed.
|
||||
> It will also bind myComponent as the context of myFunc.
|
||||
>
|
||||
> **NOTE**: When using this on elements in the page other than window
|
||||
> and document (both permanent), if you remove the element from the DOM
|
||||
> you need to call `vjs.trigger(el, 'dispose')` on it to clean up
|
||||
> references to it and allow the browser to garbage collect it.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The event handler or event type
|
||||
* __third__ `Function` The event handler
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L577](https://github.com/videojs/video.js/blob/master/src/js/component.js#L577)
|
||||
|
||||
---
|
||||
|
||||
### onClick( event )
|
||||
> Listener for click events on slider, used to prevent clicks
|
||||
> from bubbling up to parent elements like button menus.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Object` Event object
|
||||
|
||||
_inherited from_: [src/js/slider.js#L212](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L212)
|
||||
|
||||
---
|
||||
|
||||
### one( first, second, [third] )
|
||||
> Add an event listener to be triggered only once and then removed
|
||||
>
|
||||
> myComponent.one('eventName', myFunc);
|
||||
>
|
||||
> Alternatively you can add a listener to another element or component
|
||||
> that will be triggered only once.
|
||||
>
|
||||
> myComponent.one(otherElement, 'eventName', myFunc);
|
||||
> myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __first__ `String|vjs.Component` The event type or other component
|
||||
* __second__ `Function|String` The listener function or event type
|
||||
* __third__ `Function` _(OPTIONAL)_ The listener function for other component
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L691](https://github.com/videojs/video.js/blob/master/src/js/component.js#L691)
|
||||
|
||||
---
|
||||
|
||||
### options( obj )
|
||||
> Deep merge of options objects
|
||||
>
|
||||
> Whenever a property is an object on both options objects
|
||||
> the two properties will be merged using vjs.obj.deepMerge.
|
||||
>
|
||||
> This is used for merging options for child components. We
|
||||
> want it to be easy to override individual options on a child
|
||||
> component without having to rewrite all the other default options.
|
||||
>
|
||||
> Parent.prototype.options_ = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
|
||||
> 'childTwo': {},
|
||||
> 'childThree': {}
|
||||
> }
|
||||
> }
|
||||
> newOptions = {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'abc': '123' }
|
||||
> 'childTwo': null,
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
>
|
||||
> this.options(newOptions);
|
||||
>
|
||||
> RESULT
|
||||
>
|
||||
> {
|
||||
> children: {
|
||||
> 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
|
||||
> 'childTwo': null, // Disabled. Won't be initialized.
|
||||
> 'childThree': {},
|
||||
> 'childFour': {}
|
||||
> }
|
||||
> }
|
||||
|
||||
##### PARAMETERS:
|
||||
* __obj__ `Object` Object of new option values
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` A NEW object of this.options_ and obj merged
|
||||
|
||||
_inherited from_: [src/js/component.js#L179](https://github.com/videojs/video.js/blob/master/src/js/component.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### player()
|
||||
> Return the component's player
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Player`
|
||||
|
||||
_inherited from_: [src/js/component.js#L126](https://github.com/videojs/video.js/blob/master/src/js/component.js#L126)
|
||||
|
||||
---
|
||||
|
||||
### ready( fn )
|
||||
> Bind a listener to the component's ready state
|
||||
>
|
||||
> Different from event listeners in that if the ready event has already happend
|
||||
> it will trigger the function immediately.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` Ready listener
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L769](https://github.com/videojs/video.js/blob/master/src/js/component.js#L769)
|
||||
|
||||
---
|
||||
|
||||
### removeChild( component )
|
||||
> Remove a child component from this component's list of children, and the
|
||||
> child component's element from this component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __component__ `vjs.Component` Component to remove
|
||||
|
||||
_inherited from_: [src/js/component.js#L420](https://github.com/videojs/video.js/blob/master/src/js/component.js#L420)
|
||||
|
||||
---
|
||||
|
||||
### removeClass( classToRemove )
|
||||
> Remove a CSS class name from the component's element
|
||||
|
||||
##### PARAMETERS:
|
||||
* __classToRemove__ `String` Classname to remove
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L837](https://github.com/videojs/video.js/blob/master/src/js/component.js#L837)
|
||||
|
||||
---
|
||||
|
||||
### show()
|
||||
> Show the component element if hidden
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L847](https://github.com/videojs/video.js/blob/master/src/js/component.js#L847)
|
||||
|
||||
---
|
||||
|
||||
### trigger( event )
|
||||
> Trigger an event on an element
|
||||
>
|
||||
> myComponent.trigger('eventName');
|
||||
> myComponent.trigger({'type':'eventName'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __event__ `Event|Object|String` A string (the type) or an event object with a type attribute
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` self
|
||||
|
||||
_inherited from_: [src/js/component.js#L724](https://github.com/videojs/video.js/blob/master/src/js/component.js#L724)
|
||||
|
||||
---
|
||||
|
||||
### triggerReady()
|
||||
> Trigger the ready listeners
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component`
|
||||
|
||||
_inherited from_: [src/js/component.js#L788](https://github.com/videojs/video.js/blob/master/src/js/component.js#L788)
|
||||
|
||||
---
|
||||
|
||||
### width( [num], skipListeners )
|
||||
> Set or get the width of the component (CSS values)
|
||||
>
|
||||
> Setting the video tag dimension values only works with values in pixels.
|
||||
> Percent values will not work.
|
||||
> Some percents can be used, but width()/height() will return the number + %,
|
||||
> not the actual computed width/height.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __num__ `Number|String` _(OPTIONAL)_ Optional width number
|
||||
* __skipListeners__ `Boolean` Skip the 'resize' event trigger
|
||||
|
||||
##### RETURNS:
|
||||
* `vjs.Component` This component, when setting the width
|
||||
* `Number|String` The width, when getting
|
||||
|
||||
_inherited from_: [src/js/component.js#L910](https://github.com/videojs/video.js/blob/master/src/js/component.js#L910)
|
||||
|
||||
---
|
||||
|
||||
## EVENTS
|
||||
|
||||
### resize `EVENT`
|
||||
> Fired when the width and/or height of the component changes
|
||||
|
||||
_inherited from_: [src/js/component.js#L1020](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1020)
|
||||
|
||||
---
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário