Comparar commits
1070 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| ec5b60329f | |||
| 0287f6e076 | |||
| 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 | |||
| 69a4884880 | |||
| fbdf7ef041 | |||
| c4717ebed9 | |||
| 652a44026f | |||
| ec53eda738 | |||
| db05a1b90d | |||
| e1c0f9fc35 | |||
| 7bbbf992a9 | |||
| 36956e20df | |||
| c5f5ea419e | |||
| eb597d3660 |
@@ -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
|
||||
+4
-1
@@ -10,7 +10,7 @@ test/*.map
|
||||
.s3config.json
|
||||
|
||||
node_modules
|
||||
npm-debug.log
|
||||
npm-debug.log*
|
||||
|
||||
sandbox/*
|
||||
!sandbox/*.example
|
||||
@@ -28,3 +28,6 @@ test/coverage/*
|
||||
.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
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
{
|
||||
"evil" : true,
|
||||
"validthis": true,
|
||||
"node" : true,
|
||||
"debug" : true,
|
||||
"boss" : true,
|
||||
"expr" : true,
|
||||
"eqnull" : true,
|
||||
"quotmark" : "single",
|
||||
"sub" : true,
|
||||
"trailing" : true,
|
||||
"undef" : true,
|
||||
"laxbreak" : true,
|
||||
"esnext" : true,
|
||||
"eqeqeq" : true,
|
||||
"predef" : [
|
||||
"_V_",
|
||||
"goog",
|
||||
"console",
|
||||
|
||||
"require",
|
||||
"define",
|
||||
"module",
|
||||
"exports",
|
||||
"process",
|
||||
|
||||
"q",
|
||||
"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;
|
||||
+26
-13
@@ -1,24 +1,37 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- iojs
|
||||
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=chromium-browser
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- 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
|
||||
- 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: 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=
|
||||
- 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
|
||||
|
||||
+1285
-4
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 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
|
||||
|
||||
+4
-2
@@ -1,5 +1,7 @@
|
||||
require('babel/register');
|
||||
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) {
|
||||
require('./grunt.js')(grunt);
|
||||
require('./build/grunt.js')(grunt);
|
||||
};
|
||||
|
||||
+104
-33
@@ -1,64 +1,135 @@
|
||||
## Please Note!
|
||||
The master branch is now the development branch for 5.0 and should be considered unstable until the first 5.0 release. If you're looking for the most recent stable release, please refer to the [stable branch](https://github.com/videojs/video.js/tree/stable).
|
||||
![Video.js logo][logo]
|
||||
|
||||
# [Video.js - HTML5 Video Player][vjs]
|
||||
|
||||

|
||||
[![Build Status][travis-icon]][travis-link]
|
||||
[![Coverage Status][coveralls-icon]][coveralls-link]
|
||||
[![Slack Status][slack-icon]][slack-link]
|
||||
|
||||
# [Video.js - HTML5 Video Player](http://videojs.com) [](https://travis-ci.org/videojs/video.js)
|
||||
[![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](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.
|
||||
> 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].
|
||||
|
||||
## 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>`:
|
||||
## 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.12/video-js.css" rel="stylesheet">
|
||||
<script src="http://vjs.zencdn.net/4.12/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](docs/index.md) is the first place to go for more information. Generally the
|
||||
[player API docs](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-2015 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.",
|
||||
"main": [
|
||||
"src/js/video.js",
|
||||
"src/css/video-js.scss"
|
||||
],
|
||||
"moduleType": "es6",
|
||||
"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());
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/**
|
||||
* Google Analytics tracking pixel for the freely hosted version of Video.js
|
||||
* at vjs.zencdn.net. We'll use this data to develop a support matrix of
|
||||
* browsers and devices, and possibly track errors.
|
||||
*
|
||||
* This code generates the GA tracking URL without requiring the GA javascript
|
||||
* library.
|
||||
*
|
||||
* @type {Image}
|
||||
*/
|
||||
;(function(i,w,n,e,l){
|
||||
l=w.location;
|
||||
|
||||
// Google Analytics has a limit of 10 million hits per month for free accounts.
|
||||
// The Video.js CDN goes over this (by a lot) and they've asked us to stop.
|
||||
if (Math.random() > 0.01) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Setting the source of an image will load the URL even without adding to dom
|
||||
// Using //www, still seems to work for https even though ssl.google is used by google
|
||||
i.src='//www.google-analytics.com/__utm.gif'
|
||||
// Version
|
||||
+'?utmwv=5.4.2'
|
||||
// ID
|
||||
+'&utmac=UA-16505296-2'
|
||||
// Sessions
|
||||
// &utms=2
|
||||
// Cache breaker (using utmcc to do this)
|
||||
+'&utmn='+1
|
||||
+'&utmhn='+e(l.hostname)
|
||||
// Encoding
|
||||
// &utmcs=UTF-8
|
||||
+'&utmsr='+w.screen.availWidth+'x'+w.screen.availHeight
|
||||
// Browser window
|
||||
// &utmvp=1057x1105
|
||||
// Color depth
|
||||
// &utmsc=24-bit
|
||||
+'&utmul='+(n.language||n.userLanguage||'').toLowerCase()
|
||||
// Java
|
||||
// &utmje=1
|
||||
// Flash version
|
||||
// &utmfl=11.7%20r700
|
||||
// Page title
|
||||
// &utmdt=HTML5%20Video%20Player%20%7C%20Video.js
|
||||
// Adsense
|
||||
// &utmhid=1112291628
|
||||
// Referrer, '-' is none
|
||||
// Using current page as referrer so stats show up cleaner than "Direct"
|
||||
+'&utmr='+e(l.href)
|
||||
+'&utmp='+e(l.hostname+l.pathname)
|
||||
// Current time stamp
|
||||
// &utmht=1370890439353
|
||||
// ?
|
||||
// &utmu=q
|
||||
// Cookies! Manually setting visitor ID and setting everything else to 1
|
||||
// Random number used as cache buster instead of utmn
|
||||
+'&utmcc=__utma%3D1.'+Math.floor(Math.random()*1e10)+'.1.1.1.1%3B'
|
||||
// Custom Var: vjsv is the variable name and 1.0.0 is the VJS version
|
||||
+'&utme=8(vjsv)9(v0.0.0)'
|
||||
;
|
||||
})(new Image(),window,navigator,encodeURIComponent);
|
||||
@@ -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');
|
||||
};
|
||||
@@ -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');
|
||||
};
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Video.js <%= pkg.version %> <http://videojs.com/>
|
||||
* <%= pkg.copyright %>
|
||||
* 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,7 +1,7 @@
|
||||
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;
|
||||
let version = require('../../package.json').version;
|
||||
|
||||
// remove the patch version to point to the latest patch
|
||||
version = version.replace(/(\d+\.\d+)\.\d+/, '$1');
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
var uglify = require('uglify-js');
|
||||
|
||||
module.exports = function(grunt) {
|
||||
grunt.registerTask('dist-cdn', 'Assembling distribution', function(){
|
||||
let css;
|
||||
let jsmin;
|
||||
let jsdev;
|
||||
let cdnjs;
|
||||
|
||||
// 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);
|
||||
|
||||
// GA Tracking Pixel (manually building the pixel URL)
|
||||
cdnjs = '\n' + uglify.minify('build/cdn.js').code.replace('v0.0.0', 'v' + grunt.vjsVersion.full);
|
||||
|
||||
// Add CDN-specfic JS
|
||||
js = grunt.file.read('dist/cdn/video.js');
|
||||
grunt.file.write('dist/cdn/video.js', js + cdnjs);
|
||||
|
||||
jsmin = grunt.file.read('dist/cdn/video.min.js');
|
||||
grunt.file.write('dist/cdn/video.min.js', jsmin + cdnjs);
|
||||
});
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
module.exports = function(grunt) {
|
||||
grunt.registerTask('saucelabs', function() {
|
||||
const exec = require('child_process').exec;
|
||||
const 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();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
module.exports = function(grunt) {
|
||||
// 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-travis', function() {
|
||||
let tasks = this.args;
|
||||
let tasksMinified;
|
||||
|
||||
// I believe this was done originally because of security implications around running
|
||||
// Saucelabs automatically on PRs.
|
||||
if (!process.env.SAUCE_ACCESS_KEY) {
|
||||
grunt.task.run(['karma:firefox']);
|
||||
} else {
|
||||
grunt.task.run([
|
||||
'karma:chrome_sl',
|
||||
'karma:firefox_sl',
|
||||
'karma:safari_sl',
|
||||
'karma:ipad_sl',
|
||||
'karma:android_sl',
|
||||
'karma:ie_sl'
|
||||
]);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -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": "5.0.0-19",
|
||||
"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"
|
||||
}
|
||||
-368
@@ -1,368 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"org": "videojs",
|
||||
"name": "video.js",
|
||||
"requirements": [
|
||||
{
|
||||
"name": "git",
|
||||
"info": "http://git-scm.com"
|
||||
},
|
||||
{
|
||||
"name": "node.js",
|
||||
"info": "http://nodejs.org"
|
||||
}
|
||||
],
|
||||
"urls": {
|
||||
"repo_api": "https://api.github.com/repos/videojs/video.js",
|
||||
"repo_ui": "https://github.com/videojs/video.js"
|
||||
},
|
||||
"branches": {
|
||||
"development": "master",
|
||||
"release": "stable"
|
||||
}
|
||||
},
|
||||
|
||||
"install": {
|
||||
"desc": "Fork, download, and setup the project",
|
||||
"steps": [
|
||||
{ "prompt": "confirm", "desc": "You will now be taken to Github where you will choose an account to fork the project under. Remember which account you choose." },
|
||||
{ "exec": "open https://github.com/{{meta.org}}/{{meta.name}}/fork" },
|
||||
{ "prompt": "text", "desc": "Which account did you choose? (no '@')", "id": "owner" },
|
||||
{ "exec": "git clone https://github.com/{{ owner }}/{{ meta.name }}.git" },
|
||||
{ "exec": "cd {{ meta.name }}", "desc": "Change to the project directory" },
|
||||
{ "include": "setup" }
|
||||
]
|
||||
},
|
||||
|
||||
"setup": {
|
||||
"desc": "Set up version control and install dependencies",
|
||||
"steps": [
|
||||
[ "git fetch origin", "Get all git branches" ],
|
||||
[ "git checkout -b stable origin/stable", "Create the stable branch for patches" ],
|
||||
[ "git remote add upstream https://github.com/{{meta.org}}/{{meta.name}}.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 {{meta.branches.development}}" },
|
||||
{ "include": "branch start" }
|
||||
]
|
||||
},
|
||||
"save": {
|
||||
"desc": "Save changes to your feature",
|
||||
"steps": [{ "include": "branch save" }]
|
||||
},
|
||||
"submit": {
|
||||
"desc": "Submit a pull request for a feature when it's finished",
|
||||
"steps": [{ "include": "pull_request submit" }]
|
||||
},
|
||||
"delete": {
|
||||
"desc": "Delete the current feature branch",
|
||||
"steps": [{ "include": "branch delete" }]
|
||||
},
|
||||
"review": {
|
||||
"desc": "Review a submitted feature",
|
||||
"steps": [{ "include": "pull_request review" }]
|
||||
},
|
||||
"modify": {
|
||||
"desc": "Modify a submitted feature that you are reviewing",
|
||||
"steps": [{ "include": "pull_request modify" }]
|
||||
},
|
||||
"accept": {
|
||||
"desc": "Merge a submitted feature",
|
||||
"steps": [
|
||||
{ "include": "update {{meta.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 {{meta.branches.release}}" },
|
||||
{ "include": "branch start" }
|
||||
]
|
||||
},
|
||||
"save": {
|
||||
"desc": "Save changes to your feature",
|
||||
"steps": [{ "include": "branch save" }]
|
||||
},
|
||||
"submit": {
|
||||
"desc": "Submit a pull request for a patch when it's finished",
|
||||
"steps": [{ "include": "pull_request submit" }]
|
||||
},
|
||||
"delete": {
|
||||
"desc": "Delete the current patch branch",
|
||||
"steps": [{ "include": "branch delete" }]
|
||||
},
|
||||
"review": {
|
||||
"desc": "Review a submitted patch",
|
||||
"steps": [{ "include": "pull_request review" }]
|
||||
},
|
||||
"modify": {
|
||||
"desc": "Modify a submitted patch that you are reviewing",
|
||||
"steps": [{ "include": "pull_request modify" }]
|
||||
},
|
||||
"accept": {
|
||||
"desc": "Merge a submitted patch",
|
||||
"steps": [
|
||||
{ "include": "update {{meta.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": "{{meta.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": "{{meta.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 releases",
|
||||
|
||||
"patch": {
|
||||
"release_type": "patch",
|
||||
"steps": [{ "include": "release run" }]
|
||||
},
|
||||
"minor": {
|
||||
"release_type": "minor",
|
||||
"steps": [{ "include": "release run" }]
|
||||
},
|
||||
"prerelease": {
|
||||
"release_type": "prerelease",
|
||||
"steps": [
|
||||
[ "git checkout master", "Checkout the developmet branch" ],
|
||||
[ "git pull upstream master", "Update the developmet branch" ],
|
||||
{ "include": "branch check" },
|
||||
[ "git checkout -b temp-release-branch master","Create a temporary branch for the dist" ],
|
||||
[ "grunt version:{{release_type}}", "Bump package versions" ],
|
||||
[ "./build/bin/version", "Return the current VJS Version from the package.json file", "version" ],
|
||||
[ "git commit -am 'v{{version}}'", "Add and commit the package changes" ],
|
||||
[ "git checkout master", "Checkout the developmet branch" ],
|
||||
[ "git merge temp-release-branch", "Merge package changes into the dev brach" ],
|
||||
[ "git push upstream master", "Push the dev branch changes to the repo" ],
|
||||
[ "git checkout temp-release-branch", "Checkout the temp branch again" ],
|
||||
[ "grunt dist", "Build the dist" ],
|
||||
[ "git add dist --force", "Add the (otherwise ignored) release files" ],
|
||||
[ "git commit -m 'v{{version}} dist'", "Commit the dist changes" ],
|
||||
[ "git tag -a v{{version}} -m 'v{{version}}'", "Tag the release" ],
|
||||
[ "git push upstream --tags", "Push the new tag to the repo" ],
|
||||
[ "npm publish --tag next", "Publish to npm as 'next'" ],
|
||||
[ "git checkout master", "Checkout the developmet branch" ],
|
||||
[ "git branch -D temp-release-branch", "Delete the temp release branch" ]
|
||||
]
|
||||
},
|
||||
"run": {
|
||||
"steps": [
|
||||
{ "include": "branch check" },
|
||||
[ "git checkout stable", "Checkout the release branch" ],
|
||||
[ "git pull upstream stable", "Update the release branch" ],
|
||||
[ "npm install", "Ensure dependency updates have been installed" ],
|
||||
[ "grunt test", "Run tests" ],
|
||||
[ "grunt version:{{ release_type }}", "Bump package versions" ],
|
||||
[ "./build/bin/version", "Return the current VJS Version from the package.json file", "version" ],
|
||||
[ "grunt chg-release:{{ version }}", "Update the changelog with the new release" ],
|
||||
[ "grunt clean:dist", "Clean out the dist folder before the build" ],
|
||||
[ "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" ],
|
||||
[ "git commit -am 'Release v{{ version }}'", "Commit the unstaged changes (package.json, changelog, etc)" ],
|
||||
[ "git tag -a v{{version}} -m 'v{{version}}'", "Tag the current version" ],
|
||||
[ "git push upstream stable", "Push changes to the remote" ],
|
||||
[ "git push upstream --tags", "Push tags to the remote" ],
|
||||
[ "npm publish", "Publish to npm" ],
|
||||
[ "grunt github-release", "Create a new release on Github" ],
|
||||
[ "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 again 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", "id": "name", "desc": "Name the branch" },
|
||||
{ "exec": "git checkout -b {{name}} {{baseBranch}}", "desc": "Create the branch" },
|
||||
{ "exec": "git push -u origin {{name}}", "desc": "Push the branch to your remote copy of the project" }
|
||||
]
|
||||
},
|
||||
"save": {
|
||||
"desc": "Commit and push changes made to files in the project",
|
||||
"steps": [
|
||||
{ "include": "branch confirm" },
|
||||
{ "prompt": "text", "id": "message", "desc": "Briefly describe the changes made" },
|
||||
{ "exec": "git add .", "desc": "Add the changes" },
|
||||
{ "exec": "git commit -m '{{message}}'", "desc": "Commit the changes" },
|
||||
{ "exec": "git push origin {{branch_name}}", "desc": "Push the changes to your remote copy of the project" }
|
||||
]
|
||||
},
|
||||
"check": {
|
||||
"private": true,
|
||||
"desc": "Check for unsaved changes",
|
||||
"steps": [
|
||||
{ "exec": "git diff --exit-code", "desc": "Ensure there's no unadded changes", "fail": "Make sure all changes have been saved (added and committed) or stashed" },
|
||||
{ "exec": "git diff --cached --exit-code", "desc": "Ensure there's no uncommitted changes", "fail": "Make sure all changes have been saved (added and committed) or stashed" }
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"private": true,
|
||||
"steps": [
|
||||
{ "exec": "git rev-parse --abbrev-ref HEAD", "desc": "Get the current branch", "id": "branch_name" }
|
||||
]
|
||||
},
|
||||
"confirm": {
|
||||
"private": true,
|
||||
"steps": [
|
||||
{ "include": "branch name" },
|
||||
{ "prompt": "confirm", "desc": "Are you sure *{{branch_name}}* is the correct branch?" }
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"desc": "Delete the current branch",
|
||||
"steps": [
|
||||
{ "include": "branch confirm" },
|
||||
{ "exec": "git checkout master", "desc": "Exit the branch being deleted" },
|
||||
{ "exec": "git branch -D {{branch_name}}", "desc": "Delete the local copy of the branch" },
|
||||
{ "exec": "git push origin :{{branch_name}}", "desc": "Delete the remote copy of the branch" }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"pull_request": {
|
||||
"private": true,
|
||||
"desc": "Pull request related commands",
|
||||
|
||||
"prepare": {
|
||||
"private": true,
|
||||
"steps": [
|
||||
{ "include": "branch check" },
|
||||
{ "include": "branch confirm" },
|
||||
{ "include": "test" },
|
||||
{ "prompt": "text", "desc": "Which github user or org are you submitting from?", "id": "user" }
|
||||
]
|
||||
},
|
||||
"submit": {
|
||||
"desc": "Submit a pull request for when the change is finished",
|
||||
"steps": [
|
||||
{ "include": "pull_request prepare" },
|
||||
{ "open": "{{meta.urls.repo_ui}}/compare/videojs:{{baseBranch}}...{{user}}:{{branch_name}}", "desc": "Open the github pull request page" }
|
||||
]
|
||||
},
|
||||
"review": {
|
||||
"steps": [
|
||||
{ "prompt": "text", "desc": "What is the the pull request number?", "id": "prNum" },
|
||||
{ "get": "{{meta.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 a pull request that you are currently reviewing",
|
||||
"steps": [
|
||||
{ "include": "pull_request prepare" },
|
||||
{ "prompt": "text", "desc": "What is the the pull request number?", "id": "prNum" },
|
||||
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
|
||||
{ "exec": "git push -u origin {{branch_name}}", "desc": "Push the changes to the remote repo" },
|
||||
{ "open": "https://github.com/{{user}}/video.js/compare/{{pr.head.label}}...{{user}}:{{branch_name}}", "desc": "Open the github pull request page" }
|
||||
]
|
||||
},
|
||||
"accept": {
|
||||
"steps": [
|
||||
{ "prompt": "text", "id": "prNum", "desc": "What is the the pull request number?" },
|
||||
{ "get": "{{meta.urls.repo_api}}/pulls/{{prNum}}", "desc": "Get the PR information", "id": "pr" },
|
||||
{ "get": "{{meta.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", "id": "line", "desc": "Describe this change in one 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" ]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,660 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,659 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,10 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.CaptionsButton
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L401](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L401)
|
||||
|
||||
The button component for toggling and selecting captions
|
||||
|
||||
---
|
||||
|
||||
@@ -1,793 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.CaptionsTrack
|
||||
|
||||
__EXTENDS__: [vjs.TextTrack](vjs.TextTrack.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L676](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L676)
|
||||
|
||||
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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375)
|
||||
|
||||
---
|
||||
|
||||
### activeCues()
|
||||
> Get the track active cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181)
|
||||
|
||||
---
|
||||
|
||||
### 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#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315)
|
||||
|
||||
---
|
||||
|
||||
### cues()
|
||||
> Get the track cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255)
|
||||
|
||||
---
|
||||
|
||||
### deactivate()
|
||||
> Turn off cue tracking.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398)
|
||||
|
||||
---
|
||||
|
||||
### dflt()
|
||||
> Get the track default value. ('default' is a reserved keyword)
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196)
|
||||
|
||||
---
|
||||
|
||||
### 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#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361)
|
||||
|
||||
---
|
||||
|
||||
### 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#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346)
|
||||
|
||||
---
|
||||
|
||||
### 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#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167)
|
||||
|
||||
---
|
||||
|
||||
### label()
|
||||
> Get the track label value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240)
|
||||
|
||||
---
|
||||
|
||||
### language()
|
||||
> Get the track language value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225)
|
||||
|
||||
---
|
||||
|
||||
### mode()
|
||||
> Get the track mode
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158)
|
||||
|
||||
---
|
||||
|
||||
### 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#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331)
|
||||
|
||||
---
|
||||
|
||||
### src()
|
||||
> Get the track src value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181)
|
||||
|
||||
---
|
||||
|
||||
### title()
|
||||
> Get the track title value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210)
|
||||
|
||||
---
|
||||
|
||||
### 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,10 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ChaptersButton
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L451](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L451)
|
||||
|
||||
The button component for toggling and selecting chapters
|
||||
|
||||
---
|
||||
|
||||
@@ -1,793 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ChaptersTrack
|
||||
|
||||
__EXTENDS__: [vjs.TextTrack](vjs.TextTrack.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L694](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L694)
|
||||
|
||||
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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375)
|
||||
|
||||
---
|
||||
|
||||
### activeCues()
|
||||
> Get the track active cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181)
|
||||
|
||||
---
|
||||
|
||||
### 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#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315)
|
||||
|
||||
---
|
||||
|
||||
### cues()
|
||||
> Get the track cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255)
|
||||
|
||||
---
|
||||
|
||||
### deactivate()
|
||||
> Turn off cue tracking.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398)
|
||||
|
||||
---
|
||||
|
||||
### dflt()
|
||||
> Get the track default value. ('default' is a reserved keyword)
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196)
|
||||
|
||||
---
|
||||
|
||||
### 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#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361)
|
||||
|
||||
---
|
||||
|
||||
### 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#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346)
|
||||
|
||||
---
|
||||
|
||||
### 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#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167)
|
||||
|
||||
---
|
||||
|
||||
### label()
|
||||
> Get the track label value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240)
|
||||
|
||||
---
|
||||
|
||||
### language()
|
||||
> Get the track language value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225)
|
||||
|
||||
---
|
||||
|
||||
### mode()
|
||||
> Get the track mode
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158)
|
||||
|
||||
---
|
||||
|
||||
### 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#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331)
|
||||
|
||||
---
|
||||
|
||||
### src()
|
||||
> Get the track src value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181)
|
||||
|
||||
---
|
||||
|
||||
### title()
|
||||
> Get the track title value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210)
|
||||
|
||||
---
|
||||
|
||||
### 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,8 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.ChaptersTrackMenuItem
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L550](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L550)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,679 +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)
|
||||
- [clearInterval](#clearinterval-intervalid-)
|
||||
- [clearTimeout](#cleartimeout-timeoutid-)
|
||||
- [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-)
|
||||
- [setInterval](#setinterval-fn-interval-)
|
||||
- [setTimeout](#settimeout-fn-timeout-)
|
||||
- [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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_defined in_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_defined in_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_defined in_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_defined in_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,659 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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 + constructors
|
||||
|
||||
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 instance 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,657 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,56 +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-)
|
||||
|
||||
- [UNDEFINED](#undefined)
|
||||
- [nativeSourceHandler](#nativesourcehandler-static)
|
||||
- [rtmpSourceHandler](#rtmpsourcehandler-static)
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
## UNDEFINED
|
||||
|
||||
### nativeSourceHandler `STATIC`
|
||||
> The default native source handler.
|
||||
> This simply passes the source to the video element. Nothing fancy.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __source__ `Object` The source object
|
||||
* __tech__ `vjs.Flash` The instance of the Flash tech
|
||||
|
||||
_defined in_: [src/js/media/flash.js#L229](https://github.com/videojs/video.js/blob/master/src/js/media/flash.js#L229)
|
||||
|
||||
---
|
||||
|
||||
### rtmpSourceHandler `STATIC`
|
||||
> A source handler for RTMP urls
|
||||
|
||||
_defined in_: [src/js/media/flash.rtmp.js#L58](https://github.com/videojs/video.js/blob/master/src/js/media/flash.rtmp.js#L58)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,657 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,94 +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)
|
||||
- [canControlPlaybackRate](#cancontrolplaybackrate-static)
|
||||
- [canControlVolume](#cancontrolvolume-static)
|
||||
- [init](#init-player-options-ready-)
|
||||
- [isSupported](#issupported-static)
|
||||
- [supportsNativeTextTracks](#supportsnativetexttracks-static)
|
||||
|
||||
- [UNDEFINED](#undefined)
|
||||
- [nativeSourceHandler](#nativesourcehandler-static)
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### canControlPlaybackRate() `STATIC`
|
||||
> Check if playbackRate is supported in this browser/device.
|
||||
|
||||
##### RETURNS:
|
||||
* `[type]` [description]
|
||||
|
||||
_defined in_: [src/js/media/html5.js#L542](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L542)
|
||||
|
||||
---
|
||||
|
||||
### canControlVolume() `STATIC`
|
||||
> Check if the volume can be changed in this browser/device.
|
||||
> Volume cannot be changed in a lot of mobile devices.
|
||||
> Specifically, it can't be changed from 1 on iOS.
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_defined in_: [src/js/media/html5.js#L532](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L532)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### isSupported() `STATIC`
|
||||
> Check if HTML5 video is supported by this browser/device
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_defined in_: [src/js/media/html5.js#L452](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L452)
|
||||
|
||||
---
|
||||
|
||||
### supportsNativeTextTracks() `STATIC`
|
||||
> Check to see if native text tracks are supported by this browser/device
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_defined in_: [src/js/media/html5.js#L552](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L552)
|
||||
|
||||
---
|
||||
|
||||
## UNDEFINED
|
||||
|
||||
### nativeSourceHandler `STATIC`
|
||||
> The default native source handler.
|
||||
> This simply passes the source to the video element. Nothing fancy.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __source__ `Object` The source object
|
||||
* __tech__ `vjs.Html5` The instance of the HTML5 tech
|
||||
|
||||
_defined in_: [src/js/media/html5.js#L472](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L472)
|
||||
|
||||
---
|
||||
|
||||
@@ -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,657 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.LoadProgressBar
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__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)
|
||||
|
||||
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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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#L121](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L121)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,659 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,33 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.MediaTechController
|
||||
|
||||
__DEFINED IN__: [src/js/media/media.js#L14](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L14)
|
||||
|
||||
Base class for media (HTML5 Video, Flash) controllers
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [withSourceHandlers](#withsourcehandlers-tech--static)
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### withSourceHandlers( Tech ) `STATIC`
|
||||
> A functional mixin for techs that want to use the Source Handler pattern.
|
||||
>
|
||||
> ##### EXAMPLE:
|
||||
>
|
||||
> videojs.MediaTechController.withSourceHandlers.call(MyTech);
|
||||
|
||||
##### PARAMETERS:
|
||||
* __Tech__
|
||||
|
||||
_defined in_: [src/js/media/media.js#L428](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L428)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,668 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,662 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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#L166](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L166)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L163](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L163)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,673 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,10 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.OffTextTrackMenuItem
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L296](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L296)
|
||||
|
||||
A special menu item for turning of a specific type of text track
|
||||
|
||||
---
|
||||
|
||||
@@ -1,657 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.PlayProgressBar
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__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)
|
||||
|
||||
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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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#L179](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L179)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,680 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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#L92](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L92)
|
||||
|
||||
---
|
||||
|
||||
### 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setSrc( url )
|
||||
> Set the poster source depending on the display method
|
||||
|
||||
##### PARAMETERS:
|
||||
* __url__
|
||||
|
||||
_defined in_: [src/js/poster.js#L72](https://github.com/videojs/video.js/blob/master/src/js/poster.js#L72)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,658 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,669 +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`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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#L202](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L202)
|
||||
|
||||
---
|
||||
|
||||
### 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.SeekHandle
|
||||
|
||||
__EXTENDS__: [vjs.SliderHandle](vjs.SliderHandle.md)
|
||||
__DEFINED IN__: [src/js/control-bar/progress-control.js#L199](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L199)
|
||||
|
||||
The Seek Handle shows the current position of the playhead during playback,
|
||||
and can be dragged to adjust the playhead.
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [createEl](#createel-tagname-attributes-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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/control-bar/progress-control.js#L215](https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control.js#L215)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,669 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.Slider
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/slider.js#L10](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L10)
|
||||
|
||||
The base functionality for sliders like the volume bar and seek bar
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [onClick](#onclick-event-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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/slider.js#L12](https://github.com/videojs/video.js/blob/master/src/js/slider.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 disposed.
|
||||
> 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
|
||||
|
||||
_defined in_: [src/js/slider.js#L202](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L202)
|
||||
|
||||
---
|
||||
|
||||
### 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.SliderHandle
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/slider.js#L214](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L214)
|
||||
|
||||
SeekBar Behavior includes play progress bar, and seek handle
|
||||
Needed so it can determine seek position based on handle position/size
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [createEl](#createel-tagname-attributes-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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/slider.js#L225](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L225)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,10 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.SubtitlesButton
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L433](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L433)
|
||||
|
||||
The button component for toggling and selecting subtitles
|
||||
|
||||
---
|
||||
|
||||
@@ -1,793 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.SubtitlesTrack
|
||||
|
||||
__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 subtitles
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [activate](#activate) _`inherited`_
|
||||
- [activeCues](#activecues) _`inherited`_
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375)
|
||||
|
||||
---
|
||||
|
||||
### activeCues()
|
||||
> Get the track active cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181)
|
||||
|
||||
---
|
||||
|
||||
### 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#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315)
|
||||
|
||||
---
|
||||
|
||||
### cues()
|
||||
> Get the track cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255)
|
||||
|
||||
---
|
||||
|
||||
### deactivate()
|
||||
> Turn off cue tracking.
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398)
|
||||
|
||||
---
|
||||
|
||||
### dflt()
|
||||
> Get the track default value. ('default' is a reserved keyword)
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196)
|
||||
|
||||
---
|
||||
|
||||
### 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#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361)
|
||||
|
||||
---
|
||||
|
||||
### 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#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346)
|
||||
|
||||
---
|
||||
|
||||
### 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#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167)
|
||||
|
||||
---
|
||||
|
||||
### label()
|
||||
> Get the track label value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240)
|
||||
|
||||
---
|
||||
|
||||
### language()
|
||||
> Get the track language value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225)
|
||||
|
||||
---
|
||||
|
||||
### mode()
|
||||
> Get the track mode
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158)
|
||||
|
||||
---
|
||||
|
||||
### 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#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331)
|
||||
|
||||
---
|
||||
|
||||
### src()
|
||||
> Get the track src value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181)
|
||||
|
||||
---
|
||||
|
||||
### title()
|
||||
> Get the track title value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_inherited from_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210)
|
||||
|
||||
---
|
||||
|
||||
### 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,795 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.TextTrack
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/tracks.js#L132](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L132)
|
||||
|
||||
The base class for all text tracks
|
||||
|
||||
Handles the parsing, hiding, and showing of text track cues
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [activate](#activate)
|
||||
- [activeCues](#activecues)
|
||||
- [createEl](#createel)
|
||||
- [cues](#cues)
|
||||
- [deactivate](#deactivate)
|
||||
- [dflt](#dflt)
|
||||
- [disable](#disable)
|
||||
- [hide](#hide)
|
||||
- [init](#init-player-options-)
|
||||
- [kind](#kind)
|
||||
- [label](#label)
|
||||
- [language](#language)
|
||||
- [mode](#mode)
|
||||
- [readyState](#readystate)
|
||||
- [show](#show)
|
||||
- [src](#src)
|
||||
- [title](#title)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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.
|
||||
|
||||
_defined in_: [src/js/tracks.js#L375](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L375)
|
||||
|
||||
---
|
||||
|
||||
### activeCues()
|
||||
> Get the track active cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L270](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L270)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1219](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1219)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1181](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1181)
|
||||
|
||||
---
|
||||
|
||||
### 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`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L315](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L315)
|
||||
|
||||
---
|
||||
|
||||
### cues()
|
||||
> Get the track cues
|
||||
|
||||
##### RETURNS:
|
||||
* `Array`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L255](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L255)
|
||||
|
||||
---
|
||||
|
||||
### deactivate()
|
||||
> Turn off cue tracking.
|
||||
|
||||
_defined in_: [src/js/tracks.js#L398](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L398)
|
||||
|
||||
---
|
||||
|
||||
### dflt()
|
||||
> Get the track default value. ('default' is a reserved keyword)
|
||||
|
||||
##### RETURNS:
|
||||
* `Boolean`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L196](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L196)
|
||||
|
||||
---
|
||||
|
||||
### 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.
|
||||
|
||||
_defined in_: [src/js/tracks.js#L361](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L361)
|
||||
|
||||
---
|
||||
|
||||
### 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.
|
||||
|
||||
_defined in_: [src/js/tracks.js#L346](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L346)
|
||||
|
||||
---
|
||||
|
||||
### 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#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`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L167](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L167)
|
||||
|
||||
---
|
||||
|
||||
### label()
|
||||
> Get the track label value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L240](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L240)
|
||||
|
||||
---
|
||||
|
||||
### language()
|
||||
> Get the track language value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L225](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L225)
|
||||
|
||||
---
|
||||
|
||||
### mode()
|
||||
> Get the track mode
|
||||
|
||||
##### RETURNS:
|
||||
* `Number`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L307](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L307)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L289](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L289)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1198](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1198)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1158](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1158)
|
||||
|
||||
---
|
||||
|
||||
### 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.
|
||||
|
||||
_defined in_: [src/js/tracks.js#L331](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L331)
|
||||
|
||||
---
|
||||
|
||||
### src()
|
||||
> Get the track src value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L181](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L181)
|
||||
|
||||
---
|
||||
|
||||
### title()
|
||||
> Get the track title value
|
||||
|
||||
##### RETURNS:
|
||||
* `String`
|
||||
|
||||
_defined in_: [src/js/tracks.js#L210](https://github.com/videojs/video.js/blob/master/src/js/tracks.js#L210)
|
||||
|
||||
---
|
||||
|
||||
### 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,10 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.TextTrackButton
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L337](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L337)
|
||||
|
||||
The base class for buttons that toggle specific text track types (e.g. subtitles)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.TextTrackDisplay
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L13](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L13)
|
||||
|
||||
The component for displaying text track cues
|
||||
|
||||
---
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.TextTrackMenuItem
|
||||
|
||||
__DEFINED IN__: [src/js/tracks/text-track-controls.js#L194](https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-controls.js#L194)
|
||||
|
||||
The specific menu item type for selecting a language within a text track kind
|
||||
|
||||
---
|
||||
|
||||
@@ -1,659 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.TimeDivider
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/time-display.js#L88](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L88)
|
||||
|
||||
The separator between the current time and duration
|
||||
|
||||
Can be hidden if it's not needed in the design.
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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#L90](https://github.com/videojs/video.js/blob/master/src/js/control-bar/time-display.js#L90)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,669 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.VolumeBar
|
||||
|
||||
__EXTENDS__: [vjs.Slider](vjs.Slider.md)
|
||||
__DEFINED IN__: [src/js/control-bar/volume-control.js#L46](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L46)
|
||||
|
||||
The bar that contains the volume level and can be clicked on to adjust the level
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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/volume-control.js#L48](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L48)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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#L202](https://github.com/videojs/video.js/blob/master/src/js/slider.js#L202)
|
||||
|
||||
---
|
||||
|
||||
### 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.VolumeControl
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/volume-control.js#L8](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L8)
|
||||
|
||||
The component for controlling the volume level
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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/volume-control.js#L10](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,656 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.VolumeHandle
|
||||
|
||||
__EXTENDS__: [vjs.SliderHandle](vjs.SliderHandle.md)
|
||||
__DEFINED IN__: [src/js/control-bar/volume-control.js#L131](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L131)
|
||||
|
||||
The volume handle can be dragged to adjust the volume level
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [createEl](#createel-tagname-attributes-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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/control-bar/volume-control.js#L136](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L136)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,657 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.VolumeLevel
|
||||
|
||||
__EXTENDS__: [vjs.Component](vjs.Component.md)
|
||||
__DEFINED IN__: [src/js/control-bar/volume-control.js#L110](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L110)
|
||||
|
||||
Shows volume level
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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/volume-control.js#L112](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-control.js#L112)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,662 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.VolumeMenuButton
|
||||
|
||||
__EXTENDS__: [vjs.MenuButton](vjs.MenuButton.md)
|
||||
__DEFINED IN__: [src/js/control-bar/volume-menu-button.js#L5](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-menu-button.js#L5)
|
||||
|
||||
Menu button with a popup for showing the volume slider.
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [init](#init-player-options-)
|
||||
- [addChild](#addchild-child-options-) _`inherited`_
|
||||
- [addClass](#addclass-classtoadd-) _`inherited`_
|
||||
- [buildCSSClass](#buildcssclass) _`inherited`_
|
||||
- [children](#children) _`inherited`_
|
||||
- [clearInterval](#clearinterval-intervalid-) _`inherited`_
|
||||
- [clearTimeout](#cleartimeout-timeoutid-) _`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`_
|
||||
- [setInterval](#setinterval-fn-interval-) _`inherited`_
|
||||
- [setTimeout](#settimeout-fn-timeout-) _`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#L166](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L166)
|
||||
|
||||
---
|
||||
|
||||
### 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)
|
||||
|
||||
---
|
||||
|
||||
### clearInterval( intervalId )
|
||||
> Clears an interval and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __intervalId__ `Number` The id of the interval to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1223](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1223)
|
||||
|
||||
---
|
||||
|
||||
### clearTimeout( timeoutId )
|
||||
> Clears a timeout and removes the associated dispose listener
|
||||
|
||||
##### PARAMETERS:
|
||||
* __timeoutId__ `Number` The id of the timeout to clear
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1185](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1185)
|
||||
|
||||
---
|
||||
|
||||
### 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#L163](https://github.com/videojs/video.js/blob/master/src/js/menu.js#L163)
|
||||
|
||||
---
|
||||
|
||||
### 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#L1124](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1124)
|
||||
|
||||
---
|
||||
|
||||
### 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/volume-menu-button.js#L7](https://github.com/videojs/video.js/blob/master/src/js/control-bar/volume-menu-button.js#L7)
|
||||
|
||||
---
|
||||
|
||||
### 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 disposed.
|
||||
> 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 happened
|
||||
> 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)
|
||||
|
||||
---
|
||||
|
||||
### setInterval( fn, interval )
|
||||
> Creates an interval and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run every N seconds.
|
||||
* __interval__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the interval ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1202](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1202)
|
||||
|
||||
---
|
||||
|
||||
### setTimeout( fn, timeout )
|
||||
> Creates timeout and sets up disposal automatically.
|
||||
|
||||
##### PARAMETERS:
|
||||
* __fn__ `Function` The function to run after the timeout.
|
||||
* __timeout__ `Number` Number of ms to delay before executing specified function.
|
||||
|
||||
##### RETURNS:
|
||||
* `Number` Returns the timeout ID
|
||||
|
||||
_inherited from_: [src/js/component.js#L1162](https://github.com/videojs/video.js/blob/master/src/js/component.js#L1162)
|
||||
|
||||
---
|
||||
|
||||
### 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,183 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs
|
||||
|
||||
__DEFINED IN__: [src/js/core.js#L26](https://github.com/videojs/video.js/blob/master/src/js/core.js#L26)
|
||||
|
||||
Doubles as the main function for users to create a player instance and also
|
||||
the main library object.
|
||||
|
||||
**ALIASES** videojs, _V_ (deprecated)
|
||||
|
||||
The `vjs` function can be used to initialize or retrieve a player.
|
||||
|
||||
var myPlayer = vjs('my_video_id');
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [PROPERTIES](#properties)
|
||||
- [options](#options)
|
||||
- [players](#players)
|
||||
|
||||
- [METHODS](#methods)
|
||||
- [addLanguage](#addlanguage-code-data-)
|
||||
- [parseUrl](#parseurl-url-)
|
||||
- [plugin](#plugin-name-init-)
|
||||
- [xhr](#xhr-options-callback-)
|
||||
|
||||
- CLASSES
|
||||
- [BigPlayButton](vjs.BigPlayButton.md)
|
||||
- [Button](vjs.Button.md)
|
||||
- [CaptionsButton](undefined.md)
|
||||
- [ChaptersButton](undefined.md)
|
||||
- [ChaptersTrackMenuItem](undefined.md)
|
||||
- [Component](vjs.Component.md)
|
||||
- [ControlBar](vjs.ControlBar.md)
|
||||
- [CoreObject](vjs.CoreObject.md)
|
||||
- [CurrentTimeDisplay](vjs.CurrentTimeDisplay.md)
|
||||
- [DurationDisplay](vjs.DurationDisplay.md)
|
||||
- [ErrorDisplay](vjs.ErrorDisplay.md)
|
||||
- [Flash](vjs.Flash.md)
|
||||
- [FullscreenToggle](vjs.FullscreenToggle.md)
|
||||
- [Html5](vjs.Html5.md)
|
||||
- [LiveDisplay](vjs.LiveDisplay.md)
|
||||
- [LoadProgressBar](vjs.LoadProgressBar.md)
|
||||
- [LoadingSpinner](vjs.LoadingSpinner.md)
|
||||
- [MediaError](vjs.MediaError.md)
|
||||
- [MediaLoader](vjs.MediaLoader.md)
|
||||
- [MediaTechController](undefined.md)
|
||||
- [Menu](vjs.Menu.md)
|
||||
- [MenuButton](vjs.MenuButton.md)
|
||||
- [MenuItem](vjs.MenuItem.md)
|
||||
- [MuteToggle](vjs.MuteToggle.md)
|
||||
- [OffTextTrackMenuItem](undefined.md)
|
||||
- [PlayProgressBar](vjs.PlayProgressBar.md)
|
||||
- [PlayToggle](vjs.PlayToggle.md)
|
||||
- [PlaybackRateMenuButton](vjs.PlaybackRateMenuButton.md)
|
||||
- [PlaybackRateMenuItem](vjs.PlaybackRateMenuItem.md)
|
||||
- [Player](vjs.Player.md)
|
||||
- [PosterImage](vjs.PosterImage.md)
|
||||
- [ProgressControl](vjs.ProgressControl.md)
|
||||
- [RemainingTimeDisplay](vjs.RemainingTimeDisplay.md)
|
||||
- [SeekBar](vjs.SeekBar.md)
|
||||
- [SeekHandle](vjs.SeekHandle.md)
|
||||
- [Slider](vjs.Slider.md)
|
||||
- [SliderHandle](vjs.SliderHandle.md)
|
||||
- [SubtitlesButton](undefined.md)
|
||||
- [TextTrackButton](undefined.md)
|
||||
- [TextTrackDisplay](undefined.md)
|
||||
- [TextTrackMenuItem](undefined.md)
|
||||
- [TimeDivider](vjs.TimeDivider.md)
|
||||
- [VolumeBar](vjs.VolumeBar.md)
|
||||
- [VolumeControl](vjs.VolumeControl.md)
|
||||
- [VolumeHandle](vjs.VolumeHandle.md)
|
||||
- [VolumeLevel](vjs.VolumeLevel.md)
|
||||
- [VolumeMenuButton](vjs.VolumeMenuButton.md)
|
||||
|
||||
- NAMESPACES
|
||||
- [log](vjs.log.md)
|
||||
- [util](vjs.util.md)
|
||||
|
||||
---
|
||||
|
||||
## PROPERTIES
|
||||
|
||||
### options
|
||||
> Global Player instance options, surfaced from vjs.Player.prototype.options_
|
||||
> vjs.options = vjs.Player.prototype.options_
|
||||
> All options should use string keys so they avoid
|
||||
> renaming by closure compiler
|
||||
|
||||
_defined in_: [src/js/core.js#L92](https://github.com/videojs/video.js/blob/master/src/js/core.js#L92)
|
||||
|
||||
---
|
||||
|
||||
### players
|
||||
> Global player list
|
||||
|
||||
_defined in_: [src/js/core.js#L164](https://github.com/videojs/video.js/blob/master/src/js/core.js#L164)
|
||||
|
||||
---
|
||||
|
||||
## METHODS
|
||||
|
||||
### addLanguage( code, data )
|
||||
> Utility function for adding languages to the default options. Useful for
|
||||
> amending multiple language support at runtime.
|
||||
>
|
||||
> Example: vjs.addLanguage('es', {'Hello':'Hola'});
|
||||
|
||||
##### PARAMETERS:
|
||||
* __code__ `String` The language code or dictionary property
|
||||
* __data__ `Object` The data values to be translated
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` The resulting global languages dictionary object
|
||||
|
||||
_defined in_: [src/js/core.js#L151](https://github.com/videojs/video.js/blob/master/src/js/core.js#L151)
|
||||
|
||||
---
|
||||
|
||||
### parseUrl( url )
|
||||
> Resolve and parse the elements of a URL
|
||||
|
||||
##### PARAMETERS:
|
||||
* __url__ `String` The url to parse
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` An object of url details
|
||||
|
||||
_defined in_: [src/js/lib.js#L676](https://github.com/videojs/video.js/blob/master/src/js/lib.js#L676)
|
||||
|
||||
---
|
||||
|
||||
### plugin( name, init )
|
||||
> the method for registering a video.js plugin
|
||||
|
||||
##### PARAMETERS:
|
||||
* __name__ `String` The name of the plugin
|
||||
* __init__ `Function` The function that is run when the player inits
|
||||
|
||||
_defined in_: [src/js/plugins.js#L7](https://github.com/videojs/video.js/blob/master/src/js/plugins.js#L7)
|
||||
|
||||
---
|
||||
|
||||
### xhr( options, callback )
|
||||
> Simple http request for retrieving external files (e.g. text tracks)
|
||||
>
|
||||
> ##### Example
|
||||
>
|
||||
> // using url string
|
||||
> videojs.xhr('http://example.com/myfile.vtt', function(error, response, responseBody){});
|
||||
>
|
||||
> // or options block
|
||||
> videojs.xhr({
|
||||
> uri: 'http://example.com/myfile.vtt',
|
||||
> method: 'GET',
|
||||
> responseType: 'text'
|
||||
> }, function(error, response, responseBody){
|
||||
> if (error) {
|
||||
> // log the error
|
||||
> } else {
|
||||
> // successful, do something with the response
|
||||
> }
|
||||
> });
|
||||
>
|
||||
>
|
||||
> API is modeled after the Raynos/xhr, which we hope to use after
|
||||
> getting browserify implemented.
|
||||
> https://github.com/Raynos/xhr/blob/master/index.js
|
||||
|
||||
##### PARAMETERS:
|
||||
* __options__ `Object|String` Options block or URL string
|
||||
* __callback__ `Function` The callback function
|
||||
|
||||
##### RETURNS:
|
||||
* `Object` The request
|
||||
|
||||
_defined in_: [src/js/xhr.js#L31](https://github.com/videojs/video.js/blob/master/src/js/xhr.js#L31)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<!-- GENERATED FROM SOURCE -->
|
||||
|
||||
# vjs.media
|
||||
|
||||
|
||||
---
|
||||
|
||||
## INDEX
|
||||
|
||||
- [UNDEFINED](#undefined)
|
||||
- [ApiMethods](#apimethods)
|
||||
|
||||
---
|
||||
|
||||
## UNDEFINED
|
||||
|
||||
### ApiMethods
|
||||
> List of default API methods for any MediaTechController
|
||||
|
||||
_defined in_: [src/js/media/media.js#L169](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L169)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,330 @@
|
||||
WEBVTT
|
||||
|
||||
1
|
||||
00:00:15.042 --> 00:00:18.625
|
||||
...إلى... إلى الشمال يمكن أن نرى
|
||||
...يمكن أن نرى الـ
|
||||
|
||||
2
|
||||
00:00:18.750 --> 00:00:20.958
|
||||
...إلى اليمين يمكن أن نرى الـ
|
||||
|
||||
3
|
||||
00:00:21.000 --> 00:00:23.125
|
||||
طاحنات الرؤوس...
|
||||
|
||||
4
|
||||
00:00:23.208 --> 00:00:25.208
|
||||
كل شيئ آمن
|
||||
آمن كلية
|
||||
|
||||
5
|
||||
00:00:26.333 --> 00:00:28.333
|
||||
إيمو ؟
|
||||
|
||||
6
|
||||
00:00:28.875 --> 00:00:30.958
|
||||
! حذاري
|
||||
|
||||
7
|
||||
00:00:47.125 --> 00:00:49.167
|
||||
هل أصبت ؟
|
||||
|
||||
8
|
||||
00:00:52.125 --> 00:00:54.833
|
||||
...لا أظن ذلك
|
||||
وأنت ؟
|
||||
|
||||
9
|
||||
00:00:55.625 --> 00:00:57.625
|
||||
أنا بخير
|
||||
|
||||
10
|
||||
00:00:57.667 --> 00:01:01.667
|
||||
،قم يا إيمو
|
||||
المكان هنا غير آمن
|
||||
|
||||
11
|
||||
00:01:02.208 --> 00:01:04.083
|
||||
لنذهب
|
||||
|
||||
12
|
||||
00:01:04.167 --> 00:01:06.167
|
||||
وماذا بعد ؟
|
||||
|
||||
13
|
||||
00:01:06.167 --> 00:01:08.583
|
||||
...سترى... سترى
|
||||
|
||||
14
|
||||
00:01:16.167 --> 00:01:18.375
|
||||
إيمو، من هنا
|
||||
|
||||
15
|
||||
00:01:34.958 --> 00:01:37.000
|
||||
! إتبعني
|
||||
|
||||
16
|
||||
00:02:11.125 --> 00:02:13.625
|
||||
! أسرع يا إيمو
|
||||
|
||||
17
|
||||
00:02:48.375 --> 00:02:50.375
|
||||
! لست منتبها
|
||||
|
||||
18
|
||||
00:02:50.750 --> 00:02:54.500
|
||||
...أريد فقط أن أجيب الـ
|
||||
الهاتف...
|
||||
|
||||
19
|
||||
00:02:55.000 --> 00:02:58.500
|
||||
،إيمو، أنظر
|
||||
أقصد أنصت
|
||||
|
||||
20
|
||||
00:02:59.750 --> 00:03:03.292
|
||||
عليك أن تتعلم الإصغاء
|
||||
|
||||
21
|
||||
00:03:03.625 --> 00:03:05.917
|
||||
هذا ليس ضربا من اللهو
|
||||
|
||||
22
|
||||
00:03:06.083 --> 00:03:09.958
|
||||
...إنك
|
||||
أقصد إننا قد نموت بسهولة في هذا المكان
|
||||
|
||||
23
|
||||
00:03:10.208 --> 00:03:14.125
|
||||
...أنصت
|
||||
أنصت إلى أصوات الآلة
|
||||
|
||||
24
|
||||
00:03:18.333 --> 00:03:20.417
|
||||
أنصت إلى نَفَسِك
|
||||
|
||||
25
|
||||
00:04:27.208 --> 00:04:29.250
|
||||
ألا تمل أبدا من هذا ؟
|
||||
|
||||
26
|
||||
00:04:29.583 --> 00:04:31.583
|
||||
أمل ؟!؟
|
||||
نعم -
|
||||
|
||||
27
|
||||
00:04:31.750 --> 00:04:34.667
|
||||
إيمو؛ الآلة في دقتها... مثل الساعة
|
||||
|
||||
28
|
||||
00:04:35.500 --> 00:04:37.708
|
||||
...حركة ناشزة واحدة قد
|
||||
|
||||
29
|
||||
00:04:37.833 --> 00:04:39.875
|
||||
تطرحك معجونا
|
||||
|
||||
30
|
||||
00:04:41.042 --> 00:04:43.083
|
||||
...أو ليست
|
||||
|
||||
31
|
||||
00:04:43.125 --> 00:04:46.542
|
||||
! عجينة يا إيمو
|
||||
أ هذا ما تريد ؟ أن تصبح عجينة ؟
|
||||
|
||||
32
|
||||
00:04:48.083 --> 00:04:50.083
|
||||
أيمو، أ هذا هدفك في الحياة ؟
|
||||
|
||||
33
|
||||
00:04:50.583 --> 00:04:52.667
|
||||
أن تصير عجينة ؟
|
||||
|
||||
34
|
||||
00:05:41.833 --> 00:05:43.875
|
||||
إيمو، أغمض عينيك
|
||||
|
||||
35
|
||||
00:05:44.917 --> 00:05:47.000
|
||||
لماذا ؟
|
||||
! الآن -
|
||||
|
||||
36
|
||||
00:05:53.750 --> 00:05:56.042
|
||||
حسن
|
||||
|
||||
37
|
||||
00:05:59.542 --> 00:06:02.792
|
||||
ماذا ترى إلى شمالك يا إيمو ؟
|
||||
|
||||
38
|
||||
00:06:04.417 --> 00:06:06.500
|
||||
لا شيئ
|
||||
حقا ؟ -
|
||||
|
||||
39
|
||||
00:06:06.542 --> 00:06:08.625
|
||||
لا، لا شيئ البتة
|
||||
|
||||
40
|
||||
00:06:08.625 --> 00:06:12.417
|
||||
وماذا ترى إلى جهتك اليمنى يا إيمو ؟
|
||||
|
||||
41
|
||||
00:06:13.667 --> 00:06:17.833
|
||||
،نفس الشيئ يا بروغ
|
||||
! نفس الشيئ بالضبط؛ لا شيئ
|
||||
|
||||
42
|
||||
00:06:17.875 --> 00:06:19.917
|
||||
عظيم
|
||||
|
||||
43
|
||||
00:06:40.625 --> 00:06:42.958
|
||||
أنصت يا بروغ ! هل تسمع ذلك ؟
|
||||
|
||||
44
|
||||
00:06:43.625 --> 00:06:45.625
|
||||
هل نستطيع الذهاب إلى هناك ؟
|
||||
|
||||
45
|
||||
00:06:45.708 --> 00:06:47.792
|
||||
هناك ؟
|
||||
نعم -
|
||||
|
||||
46
|
||||
00:06:47.833 --> 00:06:49.833
|
||||
إنه غير آمن يا إيمو
|
||||
|
||||
47
|
||||
00:06:49.917 --> 00:06:52.500
|
||||
صدقني، إنه غير آمن
|
||||
|
||||
48
|
||||
00:06:53.292 --> 00:06:55.375
|
||||
...لكن لعلي أستطيع
|
||||
|
||||
49
|
||||
00:06:55.417 --> 00:06:57.417
|
||||
...لكن
|
||||
! لا -
|
||||
|
||||
50
|
||||
00:06:57.667 --> 00:06:59.667
|
||||
! لا
|
||||
|
||||
51
|
||||
00:07:00.875 --> 00:07:03.750
|
||||
هل من أسئلة أخرى يا إيمو ؟
|
||||
|
||||
52
|
||||
00:07:04.250 --> 00:07:06.333
|
||||
لا
|
||||
|
||||
53
|
||||
00:07:09.458 --> 00:07:11.542
|
||||
...إيمو
|
||||
نعم -
|
||||
|
||||
54
|
||||
00:07:11.875 --> 00:07:13.958
|
||||
...لماذا يا إيمو... لماذا
|
||||
|
||||
55
|
||||
00:07:15.292 --> 00:07:18.792
|
||||
لماذا لا تستطيع أن ترى حُسْن هذا المكان
|
||||
|
||||
56
|
||||
00:07:18.833 --> 00:07:20.833
|
||||
...والطريقة التي يعمل بها
|
||||
|
||||
57
|
||||
00:07:20.875 --> 00:07:24.000
|
||||
وكيف... وكيف أنه غاية في الكمال
|
||||
|
||||
58
|
||||
00:07:24.083 --> 00:07:27.417
|
||||
! لا يا بروغ، لا أرى ذلك
|
||||
|
||||
59
|
||||
00:07:27.542 --> 00:07:30.333
|
||||
لا أرى ذلك لأنه لا يوجد شيئ هناك
|
||||
|
||||
60
|
||||
00:07:31.500 --> 00:07:35.333
|
||||
ثم لماذا يجب علي أن أسلم حياتي
|
||||
لشيئ لا وجود له ؟
|
||||
|
||||
61
|
||||
00:07:35.583 --> 00:07:37.625
|
||||
هل يمكنك أن تخبرني ؟
|
||||
|
||||
62
|
||||
00:07:37.708 --> 00:07:39.750
|
||||
! أجبني
|
||||
|
||||
63
|
||||
00:07:43.208 --> 00:07:47.333
|
||||
...بروغ
|
||||
! أنت معتوه يا هذا
|
||||
|
||||
64
|
||||
00:07:47.375 --> 00:07:49.417
|
||||
! إبعد عني
|
||||
|
||||
65
|
||||
00:07:52.583 --> 00:07:55.083
|
||||
! لا يا إيمو ! إنه فخ
|
||||
|
||||
66
|
||||
00:07:55.833 --> 00:07:57.875
|
||||
...إنه فخ
|
||||
|
||||
67
|
||||
00:07:57.917 --> 00:08:01.750
|
||||
إلى جنبك الأيسر يمكنك أن ترى
|
||||
حدائق بابل المعلقة
|
||||
|
||||
68
|
||||
00:08:02.250 --> 00:08:04.292
|
||||
هل تعجبك كفخ ؟
|
||||
|
||||
69
|
||||
00:08:05.458 --> 00:08:07.542
|
||||
لا يا أيمو
|
||||
|
||||
70
|
||||
00:08:09.417 --> 00:08:12.792
|
||||
...إلى جنبك الأيمن يمكنك رؤية
|
||||
حزر ماذا ؟
|
||||
|
||||
71
|
||||
00:08:13.000 --> 00:08:15.042
|
||||
! عملاق رودس
|
||||
|
||||
72
|
||||
00:08:15.125 --> 00:08:16.417
|
||||
! لا
|
||||
|
||||
73
|
||||
00:08:16.458 --> 00:08:20.500
|
||||
،عملاق رودس
|
||||
وهو هنا خصيصا من أجلك يا بروغ
|
||||
|
||||
74
|
||||
00:08:20.583 --> 00:08:22.583
|
||||
فقط من أجلك
|
||||
|
||||
75
|
||||
00:08:51.333 --> 00:08:53.375
|
||||
إنه هناك
|
||||
|
||||
76
|
||||
00:08:53.417 --> 00:08:55.500
|
||||
أنا أؤكد لك... إيمو
|
||||
|
||||
77
|
||||
00:08:57.333 --> 00:09:00.000
|
||||
...إنه
|
||||
@@ -0,0 +1,334 @@
|
||||
WEBVTT
|
||||
|
||||
1
|
||||
00:00:15.000 --> 00:00:17.951
|
||||
At the left we can see...
|
||||
|
||||
2
|
||||
00:00:18.166 --> 00:00:20.083
|
||||
At the right we can see the...
|
||||
|
||||
3
|
||||
00:00:20.119 --> 00:00:21.962
|
||||
...the head-snarlers
|
||||
|
||||
4
|
||||
00:00:21.999 --> 00:00:24.368
|
||||
Everything is safe.
|
||||
Perfectly safe.
|
||||
|
||||
5
|
||||
00:00:24.582 --> 00:00:27.035
|
||||
Emo?
|
||||
|
||||
6
|
||||
00:00:28.206 --> 00:00:29.996
|
||||
Watch out!
|
||||
|
||||
7
|
||||
00:00:47.037 --> 00:00:48.494
|
||||
Are you hurt?
|
||||
|
||||
8
|
||||
00:00:51.994 --> 00:00:53.949
|
||||
I don't think so.
|
||||
You?
|
||||
|
||||
9
|
||||
00:00:55.160 --> 00:00:56.985
|
||||
I'm Ok.
|
||||
|
||||
10
|
||||
00:00:57.118 --> 00:01:01.111
|
||||
Get up.
|
||||
Emo. it's not safe here.
|
||||
|
||||
11
|
||||
00:01:02.034 --> 00:01:03.573
|
||||
Let's go.
|
||||
|
||||
12
|
||||
00:01:03.610 --> 00:01:05.114
|
||||
What's next?
|
||||
|
||||
13
|
||||
00:01:05.200 --> 00:01:09.146
|
||||
You'll see!
|
||||
|
||||
14
|
||||
00:01:16.032 --> 00:01:18.022
|
||||
Emo.
|
||||
This way.
|
||||
|
||||
15
|
||||
00:01:34.237 --> 00:01:35.481
|
||||
Follow me!
|
||||
|
||||
16
|
||||
00:02:11.106 --> 00:02:12.480
|
||||
Hurry Emo!
|
||||
|
||||
17
|
||||
00:02:48.059 --> 00:02:49.930
|
||||
You're not paying attention!
|
||||
|
||||
18
|
||||
00:02:50.142 --> 00:02:54.052
|
||||
I just want to answer the...
|
||||
...phone.
|
||||
|
||||
19
|
||||
00:02:54.974 --> 00:02:57.972
|
||||
Emo. look.
|
||||
I mean listen.
|
||||
|
||||
20
|
||||
00:02:59.140 --> 00:03:02.008
|
||||
You have to learn to listen.
|
||||
|
||||
21
|
||||
00:03:03.140 --> 00:03:04.965
|
||||
This is not some game.
|
||||
|
||||
22
|
||||
00:03:05.056 --> 00:03:09.345
|
||||
You. I mean we.
|
||||
we could easily die out here.
|
||||
|
||||
23
|
||||
00:03:10.014 --> 00:03:13.959
|
||||
Listen.
|
||||
listen to the sounds of the machine.
|
||||
|
||||
24
|
||||
00:03:18.054 --> 00:03:20.009
|
||||
Listen to your breathing.
|
||||
|
||||
25
|
||||
00:04:27.001 --> 00:04:28.956
|
||||
Well. don't you ever get tired of this?
|
||||
|
||||
26
|
||||
00:04:29.084 --> 00:04:30.909
|
||||
Tired?!?
|
||||
|
||||
27
|
||||
00:04:31.126 --> 00:04:34.491
|
||||
Emo. the machine is like clockwork.
|
||||
|
||||
28
|
||||
00:04:35.083 --> 00:04:37.074
|
||||
One move out of place...
|
||||
|
||||
29
|
||||
00:04:37.166 --> 00:04:39.121
|
||||
...and you're ground to a pulp.
|
||||
|
||||
30
|
||||
00:04:40.958 --> 00:04:42.004
|
||||
But isn't it -
|
||||
|
||||
31
|
||||
00:04:42.041 --> 00:04:46.034
|
||||
Pulp. Emo!
|
||||
Is that what you want. pulp?
|
||||
|
||||
32
|
||||
00:04:47.040 --> 00:04:48.995
|
||||
Emo. your goal in life...
|
||||
|
||||
33
|
||||
00:04:50.081 --> 00:04:51.953
|
||||
...pulp?
|
||||
|
||||
34
|
||||
00:05:41.156 --> 00:05:43.028
|
||||
Emo. close your eyes.
|
||||
|
||||
35
|
||||
00:05:44.156 --> 00:05:46.027
|
||||
Why?
|
||||
- Now!
|
||||
|
||||
36
|
||||
00:05:51.155 --> 00:05:52.102
|
||||
Ok.
|
||||
|
||||
37
|
||||
00:05:53.113 --> 00:05:54.688
|
||||
Good.
|
||||
|
||||
38
|
||||
00:05:59.070 --> 00:06:02.103
|
||||
What do you see at your left side. Emo?
|
||||
|
||||
39
|
||||
00:06:04.028 --> 00:06:05.899
|
||||
Nothing.
|
||||
- Really?
|
||||
|
||||
40
|
||||
00:06:06.027 --> 00:06:07.105
|
||||
No. nothing at all.
|
||||
|
||||
41
|
||||
00:06:07.944 --> 00:06:11.984
|
||||
And at your right.
|
||||
what do you see at your right side. Emo?
|
||||
|
||||
42
|
||||
00:06:13.151 --> 00:06:16.102
|
||||
The same Proog. exactly the same...
|
||||
|
||||
43
|
||||
00:06:16.942 --> 00:06:19.098
|
||||
...nothing!
|
||||
- Great.
|
||||
|
||||
44
|
||||
00:06:40.105 --> 00:06:42.724
|
||||
Listen Proog! Do you hear that!
|
||||
|
||||
45
|
||||
00:06:43.105 --> 00:06:44.894
|
||||
Can we go here?
|
||||
|
||||
46
|
||||
00:06:44.979 --> 00:06:47.894
|
||||
There?
|
||||
It isn't safe. Emo.
|
||||
|
||||
47
|
||||
00:06:49.145 --> 00:06:52.013
|
||||
But...
|
||||
- Trust me. it's not.
|
||||
|
||||
48
|
||||
00:06:53.020 --> 00:06:54.145
|
||||
Maybe I could...
|
||||
|
||||
49
|
||||
00:06:54.181 --> 00:06:55.969
|
||||
No.
|
||||
|
||||
50
|
||||
00:06:57.102 --> 00:06:59.934
|
||||
NO!
|
||||
|
||||
51
|
||||
00:07:00.144 --> 00:07:03.058
|
||||
Any further questions. Emo?
|
||||
|
||||
52
|
||||
00:07:03.976 --> 00:07:05.090
|
||||
No.
|
||||
|
||||
53
|
||||
00:07:09.059 --> 00:07:10.089
|
||||
Emo?
|
||||
|
||||
54
|
||||
00:07:11.142 --> 00:07:13.058
|
||||
Emo. why...
|
||||
|
||||
55
|
||||
00:07:13.095 --> 00:07:14.022
|
||||
Emo...
|
||||
|
||||
56
|
||||
00:07:14.058 --> 00:07:18.003
|
||||
...why can't you see
|
||||
the beauty of this place?
|
||||
|
||||
57
|
||||
00:07:18.141 --> 00:07:20.048
|
||||
The way it works.
|
||||
|
||||
58
|
||||
00:07:20.140 --> 00:07:23.895
|
||||
How perfect it is.
|
||||
|
||||
59
|
||||
00:07:23.932 --> 00:07:26.964
|
||||
No. Proog. I don't see.
|
||||
|
||||
60
|
||||
00:07:27.056 --> 00:07:29.970
|
||||
I don't see because there's nothing there.
|
||||
|
||||
61
|
||||
00:07:31.055 --> 00:07:34.965
|
||||
And why should I trust my
|
||||
life to something that isn't there?
|
||||
|
||||
62
|
||||
00:07:35.055 --> 00:07:36.926
|
||||
Well can you tell me that?
|
||||
|
||||
63
|
||||
00:07:37.054 --> 00:07:38.926
|
||||
Answer me!
|
||||
|
||||
64
|
||||
00:07:42.970 --> 00:07:44.000
|
||||
Proog...
|
||||
|
||||
65
|
||||
00:07:45.053 --> 00:07:46.985
|
||||
...you're a sick man!
|
||||
|
||||
66
|
||||
00:07:47.022 --> 00:07:48.918
|
||||
Stay away from me!
|
||||
|
||||
67
|
||||
00:07:52.052 --> 00:07:54.884
|
||||
No! Emo! It's a trap!
|
||||
|
||||
68
|
||||
00:07:55.135 --> 00:07:56.931
|
||||
Hah. it's a trap.
|
||||
|
||||
69
|
||||
00:07:56.968 --> 00:08:01.043
|
||||
At the left side you can see
|
||||
the hanging gardens of Babylon!
|
||||
|
||||
70
|
||||
00:08:01.967 --> 00:08:03.957
|
||||
How's that for a trap?
|
||||
|
||||
71
|
||||
00:08:05.050 --> 00:08:06.922
|
||||
No. Emo.
|
||||
|
||||
72
|
||||
00:08:09.008 --> 00:08:12.088
|
||||
At the right side you can see...
|
||||
...well guess what...
|
||||
|
||||
73
|
||||
00:08:12.924 --> 00:08:14.665
|
||||
...the colossus of Rhodes!
|
||||
|
||||
74
|
||||
00:08:15.132 --> 00:08:16.053
|
||||
No!
|
||||
|
||||
75
|
||||
00:08:16.090 --> 00:08:21.919
|
||||
The colossus of Rhodes
|
||||
and it is here just for you Proog.
|
||||
|
||||
76
|
||||
00:08:51.001 --> 00:08:52.923
|
||||
It is there...
|
||||
|
||||
77
|
||||
00:08:52.959 --> 00:08:56.040
|
||||
I'm telling you.
|
||||
Emo...
|
||||
|
||||
78
|
||||
00:08:57.000 --> 00:08:59.867
|
||||
...it is.
|
||||
@@ -0,0 +1,326 @@
|
||||
WEBVTT
|
||||
|
||||
1
|
||||
00:00:15.042 --> 00:00:18.042
|
||||
左に見えるのは…
|
||||
|
||||
2
|
||||
00:00:18.750 --> 00:00:20.333
|
||||
右に見えるのは…
|
||||
|
||||
3
|
||||
00:00:20.417 --> 00:00:21.917
|
||||
…首刈り機
|
||||
|
||||
4
|
||||
00:00:22.000 --> 00:00:24.625
|
||||
すべて安全
|
||||
完璧に安全だ
|
||||
|
||||
5
|
||||
00:00:26.333 --> 00:00:27.333
|
||||
イーモ?
|
||||
|
||||
6
|
||||
00:00:28.875 --> 00:00:30.250
|
||||
危ない!
|
||||
|
||||
7
|
||||
00:00:47.125 --> 00:00:48.250
|
||||
ケガはないか?
|
||||
|
||||
8
|
||||
00:00:51.917 --> 00:00:53.917
|
||||
ええ、多分…
|
||||
あなたは?
|
||||
|
||||
9
|
||||
00:00:55.625 --> 00:00:57.125
|
||||
わしは平気だ
|
||||
|
||||
10
|
||||
00:00:57.583 --> 00:01:01.667
|
||||
起きてくれイーモ
|
||||
ここは危ない
|
||||
|
||||
11
|
||||
00:01:02.208 --> 00:01:03.667
|
||||
行こう
|
||||
|
||||
12
|
||||
00:01:03.750 --> 00:01:04.917
|
||||
どこに?
|
||||
|
||||
13
|
||||
00:01:05.875 --> 00:01:07.875
|
||||
すぐにわかるさ!
|
||||
|
||||
14
|
||||
00:01:16.167 --> 00:01:18.375
|
||||
イーモ、こっちだ
|
||||
|
||||
15
|
||||
00:01:34.958 --> 00:01:36.958
|
||||
ついて来るんだ!
|
||||
|
||||
16
|
||||
00:02:11.583 --> 00:02:12.792
|
||||
イーモ、早く!
|
||||
|
||||
17
|
||||
00:02:48.375 --> 00:02:50.083
|
||||
むやみにさわるな!
|
||||
|
||||
18
|
||||
00:02:50.750 --> 00:02:54.500
|
||||
僕はただ、電話に
|
||||
…出ようと
|
||||
|
||||
19
|
||||
00:02:55.000 --> 00:02:58.208
|
||||
イーモ、見るんだ…
|
||||
いや、聞いてくれ
|
||||
|
||||
20
|
||||
00:02:59.750 --> 00:03:02.292
|
||||
君は「聞き方」を知る必要がある
|
||||
|
||||
21
|
||||
00:03:03.625 --> 00:03:05.125
|
||||
これは遊びじゃない
|
||||
|
||||
22
|
||||
00:03:06.167 --> 00:03:10.417
|
||||
我々はここでは
|
||||
たやすく死ぬ
|
||||
|
||||
23
|
||||
00:03:11.208 --> 00:03:14.125
|
||||
機械の声を聞くんだ
|
||||
|
||||
24
|
||||
00:03:18.333 --> 00:03:22.417
|
||||
君の息づかいを聞くんだ
|
||||
|
||||
25
|
||||
00:04:27.208 --> 00:04:29.250
|
||||
そんなことして疲れない?
|
||||
|
||||
26
|
||||
00:04:29.583 --> 00:04:31.083
|
||||
疲れる?!
|
||||
|
||||
27
|
||||
00:04:31.750 --> 00:04:34.667
|
||||
この機械は非常に正確で
|
||||
|
||||
28
|
||||
00:04:35.500 --> 00:04:37.708
|
||||
一つ間違えば…
|
||||
|
||||
29
|
||||
00:04:37.833 --> 00:04:40.792
|
||||
…地面に落ちてバラバラだ
|
||||
|
||||
30
|
||||
00:04:41.042 --> 00:04:42.375
|
||||
え、でも―
|
||||
|
||||
31
|
||||
00:04:42.417 --> 00:04:46.542
|
||||
バラバラだぞ、イーモ!
|
||||
それでいいのか?
|
||||
|
||||
32
|
||||
00:04:48.083 --> 00:04:50.000
|
||||
バラバラで死ぬんだぞ?
|
||||
|
||||
33
|
||||
00:04:50.583 --> 00:04:52.250
|
||||
バラバラだ!
|
||||
|
||||
34
|
||||
00:05:41.833 --> 00:05:43.458
|
||||
イーモ、目を閉じるんだ
|
||||
|
||||
35
|
||||
00:05:44.917 --> 00:05:46.583
|
||||
なぜ?
|
||||
―早く!
|
||||
|
||||
36
|
||||
00:05:53.750 --> 00:05:56.042
|
||||
それでいい
|
||||
|
||||
37
|
||||
00:05:59.542 --> 00:06:03.792
|
||||
左に見えるものは何だ、イーモ?
|
||||
|
||||
38
|
||||
00:06:04.417 --> 00:06:06.000
|
||||
え…何も
|
||||
―本当か?
|
||||
|
||||
39
|
||||
00:06:06.333 --> 00:06:07.917
|
||||
全く何も
|
||||
|
||||
40
|
||||
00:06:08.042 --> 00:06:12.833
|
||||
では右は
|
||||
何か見えるか、イーモ?
|
||||
|
||||
41
|
||||
00:06:13.875 --> 00:06:16.917
|
||||
同じだよプルーグ、全く同じ…
|
||||
|
||||
42
|
||||
00:06:17.083 --> 00:06:18.583
|
||||
何もない!
|
||||
|
||||
43
|
||||
00:06:40.625 --> 00:06:43.208
|
||||
プルーグ!何か聞こえない?
|
||||
|
||||
44
|
||||
00:06:43.625 --> 00:06:45.042
|
||||
あそこに行かないか?
|
||||
|
||||
45
|
||||
00:06:45.208 --> 00:06:48.042
|
||||
あそこ?
|
||||
…安全じゃない
|
||||
|
||||
46
|
||||
00:06:49.917 --> 00:06:52.500
|
||||
でも…
|
||||
―本当に危ないぞ
|
||||
|
||||
47
|
||||
00:06:53.292 --> 00:06:54.792
|
||||
大丈夫だよ…
|
||||
|
||||
48
|
||||
00:06:54.833 --> 00:06:56.333
|
||||
だめだ
|
||||
|
||||
49
|
||||
00:06:57.667 --> 00:07:00.167
|
||||
だめだ!
|
||||
|
||||
50
|
||||
00:07:00.875 --> 00:07:03.750
|
||||
まだ続ける気か、イーモ?
|
||||
|
||||
51
|
||||
00:07:04.250 --> 00:07:05.917
|
||||
いいえ…
|
||||
|
||||
52
|
||||
00:07:09.458 --> 00:07:10.833
|
||||
イーモ?
|
||||
|
||||
53
|
||||
00:07:11.875 --> 00:07:13.542
|
||||
イーモ、なぜ…
|
||||
|
||||
54
|
||||
00:07:13.583 --> 00:07:14.458
|
||||
イーモ…
|
||||
|
||||
55
|
||||
00:07:14.500 --> 00:07:18.500
|
||||
…なぜここの美しさが
|
||||
見えない?
|
||||
|
||||
56
|
||||
00:07:18.833 --> 00:07:20.750
|
||||
仕組みがこんなに…
|
||||
|
||||
57
|
||||
00:07:20.875 --> 00:07:24.000
|
||||
こんなに完全なのに
|
||||
|
||||
58
|
||||
00:07:24.083 --> 00:07:27.417
|
||||
もういいよ!プルーグ!
|
||||
|
||||
59
|
||||
00:07:27.542 --> 00:07:30.333
|
||||
そこには何もないんだから
|
||||
|
||||
60
|
||||
00:07:31.500 --> 00:07:35.333
|
||||
なぜ命を「ない」物に
|
||||
ゆだねなきゃ?
|
||||
|
||||
61
|
||||
00:07:35.583 --> 00:07:37.125
|
||||
教えてくれないか?
|
||||
|
||||
62
|
||||
00:07:37.500 --> 00:07:39.167
|
||||
さあ!
|
||||
|
||||
63
|
||||
00:07:43.208 --> 00:07:44.583
|
||||
プルーグ…
|
||||
|
||||
64
|
||||
00:07:45.500 --> 00:07:47.333
|
||||
あなたは病気なんだ
|
||||
|
||||
65
|
||||
00:07:47.375 --> 00:07:49.208
|
||||
僕から離れてくれ
|
||||
|
||||
66
|
||||
00:07:52.583 --> 00:07:55.083
|
||||
いかん!イーモ!ワナだ!
|
||||
|
||||
67
|
||||
00:07:55.833 --> 00:07:57.167
|
||||
ワナだ? ふーん
|
||||
|
||||
68
|
||||
00:07:57.208 --> 00:08:01.750
|
||||
左に何が見える?
|
||||
バビロンの空中庭園!
|
||||
|
||||
69
|
||||
00:08:02.250 --> 00:08:04.292
|
||||
これがワナとでも?
|
||||
|
||||
70
|
||||
00:08:05.458 --> 00:08:07.125
|
||||
だめだ、イーモ
|
||||
|
||||
71
|
||||
00:08:09.417 --> 00:08:12.792
|
||||
右にあるのは…
|
||||
…すごい!…
|
||||
|
||||
72
|
||||
00:08:13.000 --> 00:08:14.750
|
||||
…ロードス島の巨像だ!
|
||||
|
||||
73
|
||||
00:08:15.833 --> 00:08:16.708
|
||||
やめろ!
|
||||
|
||||
74
|
||||
00:08:16.750 --> 00:08:22.167
|
||||
この巨像はあなたの物
|
||||
プルーグ、あなたのだよ
|
||||
|
||||
75
|
||||
00:08:51.333 --> 00:08:53.167
|
||||
いってるじゃないか…
|
||||
|
||||
76
|
||||
00:08:53.208 --> 00:08:55.500
|
||||
そこにあるって、イーモ…
|
||||
|
||||
77
|
||||
00:08:57.333 --> 00:09:00.000
|
||||
…あるって
|
||||
@@ -0,0 +1,356 @@
|
||||
WEBVTT
|
||||
|
||||
1
|
||||
00:00:14.958 --> 00:00:17.833
|
||||
Слева мы видим...
|
||||
|
||||
2
|
||||
00:00:18.458 --> 00:00:20.208
|
||||
справа мы видим...
|
||||
|
||||
3
|
||||
00:00:20.333 --> 00:00:21.875
|
||||
...голово-клацов.
|
||||
|
||||
4
|
||||
00:00:22.000 --> 00:00:24.583
|
||||
всё в порядке.
|
||||
в полном порядке.
|
||||
|
||||
5
|
||||
00:00:26.333 --> 00:00:27.333
|
||||
Имо?
|
||||
|
||||
6
|
||||
00:00:28.833 --> 00:00:30.250
|
||||
Осторожно!
|
||||
|
||||
7
|
||||
00:00:47.125 --> 00:00:48.250
|
||||
Ты не ранен?
|
||||
|
||||
8
|
||||
00:00:51.875 --> 00:00:53.875
|
||||
Вроде нет...
|
||||
а ты?
|
||||
|
||||
9
|
||||
00:00:55.583 --> 00:00:57.125
|
||||
Я в порядке.
|
||||
|
||||
10
|
||||
00:00:57.542 --> 00:01:01.625
|
||||
Вставай.
|
||||
Имо. здесь не безопасно.
|
||||
|
||||
11
|
||||
00:01:02.208 --> 00:01:03.625
|
||||
Пойдём.
|
||||
|
||||
12
|
||||
00:01:03.708 --> 00:01:05.708
|
||||
Что дальше?
|
||||
|
||||
13
|
||||
00:01:05.833 --> 00:01:07.833
|
||||
Ты увидишь!
|
||||
|
||||
14
|
||||
00:01:08.000 --> 00:01:08.833
|
||||
Ты увидишь...
|
||||
|
||||
15
|
||||
00:01:16.167 --> 00:01:18.375
|
||||
Имо. сюда.
|
||||
|
||||
16
|
||||
00:01:34.917 --> 00:01:35.750
|
||||
За мной!
|
||||
|
||||
17
|
||||
00:02:11.542 --> 00:02:12.750
|
||||
Имо. быстрее!
|
||||
|
||||
18
|
||||
00:02:48.375 --> 00:02:50.083
|
||||
Ты не обращаешь внимания!
|
||||
|
||||
19
|
||||
00:02:50.708 --> 00:02:54.500
|
||||
Я только хотел ответить на ...
|
||||
...звонок.
|
||||
|
||||
20
|
||||
00:02:55.000 --> 00:02:58.208
|
||||
Имо. смотри.
|
||||
то есть слушай...
|
||||
|
||||
21
|
||||
00:02:59.708 --> 00:03:02.292
|
||||
Ты должен учиться слушать.
|
||||
|
||||
22
|
||||
00:03:03.250 --> 00:03:05.333
|
||||
Это не какая-нибудь игра.
|
||||
|
||||
23
|
||||
00:03:06.000 --> 00:03:08.833
|
||||
Ты. вернее мы. легко можем погибнуть здесь.
|
||||
|
||||
24
|
||||
00:03:10.000 --> 00:03:11.167
|
||||
Слушай...
|
||||
|
||||
25
|
||||
00:03:11.667 --> 00:03:14.125
|
||||
слушай звуки машины.
|
||||
|
||||
26
|
||||
00:03:18.333 --> 00:03:20.417
|
||||
Слушай своё дыхание.
|
||||
|
||||
27
|
||||
00:04:27.208 --> 00:04:29.250
|
||||
И не надоест тебе это?
|
||||
|
||||
28
|
||||
00:04:29.542 --> 00:04:31.083
|
||||
Надоест?!?
|
||||
|
||||
29
|
||||
00:04:31.708 --> 00:04:34.625
|
||||
Имо! Машина -
|
||||
она как часовой механизм.
|
||||
|
||||
30
|
||||
00:04:35.500 --> 00:04:37.667
|
||||
Одно движение не туда...
|
||||
|
||||
31
|
||||
00:04:37.792 --> 00:04:39.750
|
||||
...и тебя размелют в месиво!
|
||||
|
||||
32
|
||||
00:04:41.042 --> 00:04:42.375
|
||||
А разве это не -
|
||||
|
||||
33
|
||||
00:04:42.417 --> 00:04:46.500
|
||||
Месиво. Имо!
|
||||
ты этого хочешь? месиво?
|
||||
|
||||
34
|
||||
00:04:48.083 --> 00:04:50.000
|
||||
Имо. твоя цель в жизни?
|
||||
|
||||
35
|
||||
00:04:50.542 --> 00:04:52.250
|
||||
Месиво!
|
||||
|
||||
36
|
||||
00:05:41.792 --> 00:05:43.458
|
||||
Имо. закрой глаза.
|
||||
|
||||
37
|
||||
00:05:44.875 --> 00:05:46.542
|
||||
Зачем?
|
||||
- Ну же!
|
||||
|
||||
38
|
||||
00:05:51.500 --> 00:05:52.333
|
||||
Ладно.
|
||||
|
||||
39
|
||||
00:05:53.708 --> 00:05:56.042
|
||||
Хорошо.
|
||||
|
||||
40
|
||||
00:05:59.500 --> 00:06:02.750
|
||||
Что ты видишь слева от себя. Имо?
|
||||
|
||||
41
|
||||
00:06:04.417 --> 00:06:06.000
|
||||
Ничего.
|
||||
- Точно?
|
||||
|
||||
42
|
||||
00:06:06.333 --> 00:06:07.875
|
||||
да. совсем ничего.
|
||||
|
||||
43
|
||||
00:06:08.042 --> 00:06:12.708
|
||||
А справа от себя.
|
||||
что ты видишь справа от себя. Имо?
|
||||
|
||||
44
|
||||
00:06:13.833 --> 00:06:16.875
|
||||
Да то же Пруг. в точности то же...
|
||||
|
||||
45
|
||||
00:06:17.042 --> 00:06:18.500
|
||||
Ничего!
|
||||
|
||||
46
|
||||
00:06:18.667 --> 00:06:19.500
|
||||
Прекрасно...
|
||||
|
||||
47
|
||||
00:06:40.583 --> 00:06:42.917
|
||||
Прислушайся. Пруг! Ты слышишь это?
|
||||
|
||||
48
|
||||
00:06:43.583 --> 00:06:45.042
|
||||
Может. мы пойдём туда?
|
||||
|
||||
49
|
||||
00:06:45.208 --> 00:06:48.042
|
||||
Туда?
|
||||
Это не безопасно. Имо.
|
||||
|
||||
50
|
||||
00:06:49.875 --> 00:06:52.500
|
||||
Но...
|
||||
- Поверь мне. это так.
|
||||
|
||||
51
|
||||
00:06:53.292 --> 00:06:54.750
|
||||
Может я бы ...
|
||||
|
||||
52
|
||||
00:06:54.792 --> 00:06:56.333
|
||||
Нет.
|
||||
|
||||
53
|
||||
00:06:57.625 --> 00:06:59.583
|
||||
- Но...
|
||||
- НЕТ!
|
||||
|
||||
54
|
||||
00:06:59.708 --> 00:07:00.833
|
||||
Нет!
|
||||
|
||||
55
|
||||
00:07:00.833 --> 00:07:03.708
|
||||
Ещё вопросы. Имо?
|
||||
|
||||
56
|
||||
00:07:04.250 --> 00:07:05.875
|
||||
Нет.
|
||||
|
||||
57
|
||||
00:07:09.458 --> 00:07:10.792
|
||||
Имо?
|
||||
|
||||
58
|
||||
00:07:11.833 --> 00:07:13.500
|
||||
Имо. почему...
|
||||
|
||||
59
|
||||
00:07:13.542 --> 00:07:14.458
|
||||
Имо...
|
||||
|
||||
60
|
||||
00:07:14.500 --> 00:07:18.500
|
||||
...почему? почему ты не видишь
|
||||
красоты этого места?
|
||||
|
||||
61
|
||||
00:07:18.792 --> 00:07:20.708
|
||||
То как оно работает.
|
||||
|
||||
62
|
||||
00:07:20.833 --> 00:07:24.000
|
||||
Как совершенно оно.
|
||||
|
||||
63
|
||||
00:07:24.083 --> 00:07:27.417
|
||||
Нет. Пруг. я не вижу.
|
||||
|
||||
64
|
||||
00:07:27.500 --> 00:07:30.333
|
||||
Я не вижу. потому что здесь ничего нет.
|
||||
|
||||
65
|
||||
00:07:31.375 --> 00:07:35.333
|
||||
И почему я должен доверять свою жизнь
|
||||
чему-то. чего здесь нет?
|
||||
|
||||
66
|
||||
00:07:35.542 --> 00:07:37.125
|
||||
это ты мне можешь сказать?
|
||||
|
||||
67
|
||||
00:07:37.500 --> 00:07:39.167
|
||||
Ответь мне!
|
||||
|
||||
68
|
||||
00:07:43.208 --> 00:07:44.542
|
||||
Пруг...
|
||||
|
||||
69
|
||||
00:07:45.500 --> 00:07:47.333
|
||||
Ты просто больной!
|
||||
|
||||
70
|
||||
00:07:47.375 --> 00:07:48.500
|
||||
Отстань от меня.
|
||||
|
||||
71
|
||||
00:07:48.625 --> 00:07:49.917
|
||||
Имо...
|
||||
|
||||
72
|
||||
00:07:52.542 --> 00:07:55.083
|
||||
Нет! Имо! Это ловушка!
|
||||
|
||||
73
|
||||
00:07:55.792 --> 00:07:57.167
|
||||
Это ловушка!
|
||||
|
||||
74
|
||||
00:07:57.208 --> 00:08:01.708
|
||||
Слева от себя вы можете увидеть
|
||||
Висящие сады Семирамиды!
|
||||
|
||||
75
|
||||
00:08:02.250 --> 00:08:04.292
|
||||
Сойдёт за ловушку?
|
||||
|
||||
76
|
||||
00:08:05.458 --> 00:08:07.125
|
||||
Нет. Имо.
|
||||
|
||||
77
|
||||
00:08:09.417 --> 00:08:12.750
|
||||
Справа от себя вы можете увидеть...
|
||||
...угадай кого...
|
||||
|
||||
78
|
||||
00:08:13.000 --> 00:08:14.708
|
||||
...Колосса Родосского!
|
||||
|
||||
79
|
||||
00:08:15.500 --> 00:08:16.625
|
||||
Нет!
|
||||
|
||||
80
|
||||
00:08:16.667 --> 00:08:21.125
|
||||
Колосс Родосский!
|
||||
И он здесь специально для тебя. Пруг.
|
||||
|
||||
81
|
||||
00:08:21.167 --> 00:08:22.208
|
||||
Специально для тебя...
|
||||
|
||||
82
|
||||
00:08:51.333 --> 00:08:53.167
|
||||
Она здесь есть!
|
||||
|
||||
83
|
||||
00:08:53.208 --> 00:08:55.500
|
||||
Говорю тебе.
|
||||
Имо...
|
||||
|
||||
84
|
||||
00:08:57.333 --> 00:09:00.000
|
||||
...она есть... есть...
|
||||
@@ -0,0 +1,349 @@
|
||||
WEBVTT
|
||||
|
||||
1
|
||||
00:00:15.042 --> 00:00:18.250
|
||||
Till vänster kan vi se...
|
||||
Ser vi...
|
||||
|
||||
2
|
||||
00:00:18.708 --> 00:00:20.333
|
||||
Till höger ser vi...
|
||||
|
||||
3
|
||||
00:00:20.417 --> 00:00:21.958
|
||||
...huvudkaparna.
|
||||
|
||||
4
|
||||
00:00:22.000 --> 00:00:24.792
|
||||
Allt är säkert.
|
||||
alldeles ofarligt.
|
||||
|
||||
5
|
||||
00:00:24.917 --> 00:00:26.833
|
||||
Emo?
|
||||
|
||||
6
|
||||
00:00:28.750 --> 00:00:30.167
|
||||
Se upp!
|
||||
|
||||
7
|
||||
00:00:46.708 --> 00:00:48.750
|
||||
Är du skadad?
|
||||
|
||||
8
|
||||
00:00:51.875 --> 00:00:54.458
|
||||
Jag tror inte det...
|
||||
Är du?
|
||||
|
||||
9
|
||||
00:00:55.292 --> 00:00:57.333
|
||||
Jag är ok.
|
||||
|
||||
10
|
||||
00:00:57.542 --> 00:01:01.625
|
||||
Res dig upp Emo.
|
||||
Det är inte säkert här.
|
||||
|
||||
11
|
||||
00:01:02.208 --> 00:01:03.625
|
||||
Kom så går vi.
|
||||
|
||||
12
|
||||
00:01:03.708 --> 00:01:05.708
|
||||
Vad nu då?
|
||||
|
||||
13
|
||||
00:01:05.833 --> 00:01:07.833
|
||||
Du får se...
|
||||
|
||||
14
|
||||
00:01:08.042 --> 00:01:10.417
|
||||
Du får se.
|
||||
|
||||
15
|
||||
00:01:15.958 --> 00:01:18.375
|
||||
Emo. den här vägen.
|
||||
|
||||
16
|
||||
00:01:34.417 --> 00:01:36.750
|
||||
Följ efter mig!
|
||||
|
||||
17
|
||||
00:02:11.250 --> 00:02:13.250
|
||||
Skynda dig. Emo!
|
||||
|
||||
18
|
||||
00:02:48.375 --> 00:02:50.583
|
||||
Du är inte uppmärksam!
|
||||
|
||||
19
|
||||
00:02:50.708 --> 00:02:54.500
|
||||
Jag vill bara svara...
|
||||
... i telefonen.
|
||||
|
||||
20
|
||||
00:02:54.500 --> 00:02:58.208
|
||||
Emo. se här...
|
||||
Lyssna menar jag.
|
||||
|
||||
21
|
||||
00:02:59.708 --> 00:03:02.292
|
||||
Du måste lära dig att lyssna.
|
||||
|
||||
22
|
||||
00:03:03.292 --> 00:03:05.208
|
||||
Det här är ingen lek.
|
||||
|
||||
23
|
||||
00:03:05.250 --> 00:03:08.917
|
||||
Du... Jag menar vi.
|
||||
vi skulle kunna dö här ute.
|
||||
|
||||
24
|
||||
00:03:09.917 --> 00:03:11.417
|
||||
Lyssna...
|
||||
|
||||
25
|
||||
00:03:11.708 --> 00:03:14.833
|
||||
Lyssna på ljuden från maskinen.
|
||||
|
||||
26
|
||||
00:03:18.125 --> 00:03:21.417
|
||||
Lyssna på dina andetag.
|
||||
|
||||
27
|
||||
00:04:26.625 --> 00:04:29.250
|
||||
Tröttnar du aldrig på det här?
|
||||
|
||||
28
|
||||
00:04:29.542 --> 00:04:31.083
|
||||
Tröttnar!?
|
||||
|
||||
29
|
||||
00:04:31.208 --> 00:04:33.458
|
||||
Emo. maskinen är som...
|
||||
|
||||
30
|
||||
00:04:33.458 --> 00:04:35.333
|
||||
Som ett urverk.
|
||||
|
||||
31
|
||||
00:04:35.417 --> 00:04:37.167
|
||||
Ett felsteg...
|
||||
|
||||
32
|
||||
00:04:37.208 --> 00:04:39.750
|
||||
...och du blir krossad.
|
||||
|
||||
33
|
||||
00:04:41.042 --> 00:04:42.292
|
||||
Men är det inte -
|
||||
|
||||
34
|
||||
00:04:42.292 --> 00:04:47.000
|
||||
Krossad. Emo!
|
||||
Är det vad du vill bli? Krossad till mos?
|
||||
|
||||
35
|
||||
00:04:47.500 --> 00:04:50.542
|
||||
Emo. är det ditt mål i livet?
|
||||
|
||||
36
|
||||
00:04:50.667 --> 00:04:53.250
|
||||
Att bli mos!?
|
||||
|
||||
37
|
||||
00:05:41.375 --> 00:05:43.458
|
||||
Emo. blunda.
|
||||
|
||||
38
|
||||
00:05:44.375 --> 00:05:46.542
|
||||
Varför då?
|
||||
- Blunda!
|
||||
|
||||
39
|
||||
00:05:51.292 --> 00:05:55.042
|
||||
Ok.
|
||||
- Bra.
|
||||
|
||||
40
|
||||
00:05:59.500 --> 00:06:02.750
|
||||
Vad ser du till vänster om dig Emo?
|
||||
|
||||
41
|
||||
00:06:04.125 --> 00:06:06.292
|
||||
Ingenting.
|
||||
- Säker?
|
||||
|
||||
42
|
||||
00:06:06.333 --> 00:06:07.958
|
||||
Ingenting alls.
|
||||
|
||||
43
|
||||
00:06:08.042 --> 00:06:12.625
|
||||
Jaså. och till höger om dig...
|
||||
Vad ser du där. Emo?
|
||||
|
||||
44
|
||||
00:06:13.750 --> 00:06:15.583
|
||||
Samma där Proog...
|
||||
|
||||
45
|
||||
00:06:15.583 --> 00:06:18.083
|
||||
Exakt samma där. ingenting!
|
||||
|
||||
46
|
||||
00:06:18.083 --> 00:06:19.667
|
||||
Perfekt.
|
||||
|
||||
47
|
||||
00:06:40.500 --> 00:06:42.917
|
||||
Lyssna Proog! Hör du?
|
||||
|
||||
48
|
||||
00:06:43.500 --> 00:06:45.125
|
||||
Kan vi gå dit?
|
||||
|
||||
49
|
||||
00:06:45.208 --> 00:06:48.125
|
||||
Gå dit?
|
||||
Det är inte tryggt.
|
||||
|
||||
50
|
||||
00:06:49.583 --> 00:06:52.583
|
||||
Men. men...
|
||||
- Tro mig. det inte säkert.
|
||||
|
||||
51
|
||||
00:06:53.000 --> 00:06:54.292
|
||||
Men kanske om jag -
|
||||
|
||||
52
|
||||
00:06:54.292 --> 00:06:56.333
|
||||
Nej.
|
||||
|
||||
53
|
||||
00:06:57.208 --> 00:07:00.167
|
||||
Men -
|
||||
- Nej. NEJ!
|
||||
|
||||
54
|
||||
00:07:00.917 --> 00:07:03.792
|
||||
Några fler frågor Emo?
|
||||
|
||||
55
|
||||
00:07:04.250 --> 00:07:05.875
|
||||
Nej.
|
||||
|
||||
56
|
||||
00:07:09.542 --> 00:07:11.375
|
||||
Emo?
|
||||
- Ja?
|
||||
|
||||
57
|
||||
00:07:11.542 --> 00:07:15.667
|
||||
Emo. varför...
|
||||
|
||||
58
|
||||
00:07:15.792 --> 00:07:18.583
|
||||
Varför kan du inte se skönheten i det här?
|
||||
|
||||
59
|
||||
00:07:18.792 --> 00:07:21.708
|
||||
Hur det fungerar.
|
||||
|
||||
60
|
||||
00:07:21.833 --> 00:07:24.000
|
||||
Hur perfekt det är.
|
||||
|
||||
61
|
||||
00:07:24.083 --> 00:07:27.333
|
||||
Nej Proog. jag kan inte se det.
|
||||
|
||||
62
|
||||
00:07:27.333 --> 00:07:30.333
|
||||
Jag ser det inte. för det finns inget där.
|
||||
|
||||
63
|
||||
00:07:31.292 --> 00:07:35.333
|
||||
Och varför skulle jag lägga mitt liv
|
||||
i händerna på något som inte finns?
|
||||
|
||||
64
|
||||
00:07:35.333 --> 00:07:37.083
|
||||
Kan du berätta det för mig?
|
||||
- Emo...
|
||||
|
||||
65
|
||||
00:07:37.083 --> 00:07:39.167
|
||||
Svara mig!
|
||||
|
||||
66
|
||||
00:07:43.500 --> 00:07:45.208
|
||||
Proog...
|
||||
|
||||
67
|
||||
00:07:45.208 --> 00:07:47.083
|
||||
Du är inte frisk!
|
||||
|
||||
68
|
||||
00:07:47.167 --> 00:07:49.292
|
||||
Håll dig borta från mig!
|
||||
|
||||
69
|
||||
00:07:52.292 --> 00:07:55.083
|
||||
Nej! Emo!
|
||||
Det är en fälla!
|
||||
|
||||
70
|
||||
00:07:55.375 --> 00:07:57.208
|
||||
Heh. det är en fälla.
|
||||
|
||||
71
|
||||
00:07:57.208 --> 00:08:01.708
|
||||
På vänster sida ser vi...
|
||||
Babylons hängande trädgårdar!
|
||||
|
||||
72
|
||||
00:08:01.958 --> 00:08:04.000
|
||||
Vad sägs om den fällan?
|
||||
|
||||
73
|
||||
00:08:05.458 --> 00:08:07.333
|
||||
Nej. Emo.
|
||||
|
||||
74
|
||||
00:08:08.917 --> 00:08:12.667
|
||||
Till höger ser vi...
|
||||
Gissa!
|
||||
|
||||
75
|
||||
00:08:12.750 --> 00:08:15.125
|
||||
Rhodos koloss!
|
||||
|
||||
76
|
||||
00:08:15.375 --> 00:08:16.500
|
||||
Nej!
|
||||
|
||||
77
|
||||
00:08:16.500 --> 00:08:20.250
|
||||
Kolossen på Rhodos!
|
||||
Och den är här för din skull. Proog...
|
||||
|
||||
78
|
||||
00:08:20.250 --> 00:08:23.250
|
||||
Bara för din skull.
|
||||
|
||||
79
|
||||
00:08:50.917 --> 00:08:53.250
|
||||
Den är där...
|
||||
|
||||
80
|
||||
00:08:53.625 --> 00:08:56.417
|
||||
Tro mig.
|
||||
Emo...
|
||||
|
||||
81
|
||||
00:08:57.000 --> 00:09:00.000
|
||||
Det är den.
|
||||
Det är den...
|
||||
@@ -0,0 +1,44 @@
|
||||
WEBVTT
|
||||
|
||||
NOTE Created by Owen Edwards 2015. http://creativecommons.org/licenses/by/2.5/
|
||||
NOTE Based on 'finalbreakdown.rtf', part of the prepoduction notes, which are:
|
||||
NOTE (c) Copyright 2006, Blender Foundation /
|
||||
NOTE Netherlands Media Art Institute /
|
||||
NOTE www.elephantsdream.org
|
||||
|
||||
1
|
||||
00:00:00.000 --> 00:00:27.500
|
||||
Prologue
|
||||
|
||||
2
|
||||
00:00:27.500 --> 00:01:10.000
|
||||
Switchboard trap
|
||||
|
||||
3
|
||||
00:01:10.000 --> 00:03:25.000
|
||||
Telephone/Lecture
|
||||
|
||||
4
|
||||
00:03:25.000 --> 00:04:52.000
|
||||
Typewriter
|
||||
|
||||
5
|
||||
00:04:52.000 --> 00:06:19.500
|
||||
Proog shows Emo stuff
|
||||
|
||||
6
|
||||
00:06:19.500 --> 00:07:09.000
|
||||
Which way
|
||||
|
||||
7
|
||||
00:07:09.000 --> 00:07:45.000
|
||||
Emo flips out
|
||||
|
||||
8
|
||||
00:07:45.000 --> 00:09:25.000
|
||||
Emo creates
|
||||
|
||||
9
|
||||
00:09:25.000 --> 00:10:53.000
|
||||
Closing credits
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
WEBVTT
|
||||
License: CC BY 4.0 http://creativecommons.org/licenses/by/4.0/
|
||||
Author: Silvia Pfeiffer
|
||||
|
||||
1
|
||||
00:00:00.000 --> 00:00:05.000
|
||||
The orange open movie project presents
|
||||
|
||||
2
|
||||
00:00:05.010 --> 00:00:12.000
|
||||
Introductory titles are showing on the background of a water pool with fishes swimming and mechanical objects lying on a stone floor.
|
||||
|
||||
3
|
||||
00:00:12.010 --> 00:00:14.800
|
||||
elephants dream
|
||||
|
||||
4
|
||||
00:00:26.100 --> 00:00:28.206
|
||||
Two people stand on a small bridge.
|
||||
|
||||
5
|
||||
00:00:30.010 --> 00:00:40.000
|
||||
The old man, Proog, shoves the younger and less experienced Emo on the ground to save him from being mowed down by a barrage of jack plugs that whir back and forth between the two massive switch-board-like walls.
|
||||
|
||||
6
|
||||
00:00:40.000 --> 00:00:47.000
|
||||
The plugs are oblivious of the two, endlessly channeling streams of bizarre sounds and data.
|
||||
|
||||
7
|
||||
00:00:48.494 --> 00:00:51.994
|
||||
Emo sits on the bridge and checks his limbs.
|
||||
|
||||
8
|
||||
00:01:09.150 --> 00:01:16.030
|
||||
After the squealing plugs move on, Proog makes sure that Emo is unharmed and urges him onwards through a crack in one of the plug-walls.
|
||||
|
||||
9
|
||||
00:01:18.050 --> 00:01:24.000
|
||||
They walk through the narrow hall into a massive room that fades away into blackness on all sides.
|
||||
|
||||
10
|
||||
00:01:24.050 --> 00:01:34.200
|
||||
Only one path is visible, suspended in mid-air that runs between thousands of dangling electric cables on which sit crowds of robin-like robotic birds.
|
||||
|
||||
11
|
||||
00:01:36.000 --> 00:01:40.000
|
||||
As Proog and Emo enter the room, the birds begin to wake up and notice them.
|
||||
|
||||
12
|
||||
00:01:42.000 --> 00:01:50.000
|
||||
Realizing the danger, Proog grabs Emo by the arm.
|
||||
|
||||
13
|
||||
00:01:50.050 --> 00:02:00.000
|
||||
They run along the increasingly bizarre path as the birds begin to swarm.
|
||||
|
||||
14
|
||||
00:02:00.050 --> 00:02:11.000
|
||||
All sound is blocked out by the birds which are making the same noises as the jack-plugs, garbled screaming and obscure sentences and static.
|
||||
|
||||
15
|
||||
00:02:12.600 --> 00:02:17.000
|
||||
The path dead-ends, stopping in the middle of no-where above the infinite drop.
|
||||
|
||||
16
|
||||
00:02:17.600 --> 00:02:22.000
|
||||
Proog turns around as the birds reach them and begin to dive-bomb at them.
|
||||
|
||||
17
|
||||
00:02:22.600 --> 00:02:28.000
|
||||
At the last moment, Proog takes out an old candlestick phone and the birds dive into the speaker piece.
|
||||
|
||||
18
|
||||
00:02:28.600 --> 00:02:31.000
|
||||
The screen cuts to black.
|
||||
|
||||
19
|
||||
00:02:31.600 --> 00:02:38.000
|
||||
In the next scene, Proog stands at one end of a room, suspiciously watching what is probably the same candlestick phone, which is ringing.
|
||||
|
||||
20
|
||||
00:02:38.500 --> 00:02:41.000
|
||||
Emo watches from the other side of the room.
|
||||
|
||||
21
|
||||
00:02:41.500 --> 00:02:43.000
|
||||
The phone continues to ring.
|
||||
|
||||
22
|
||||
00:02:43.500 --> 00:02:48.000
|
||||
After a while Emo approaches it to answer it, but Proog slaps his hand away.
|
||||
|
||||
23
|
||||
00:02:57.972 --> 00:02:59.100
|
||||
Proog takes the ear-piece off the hook.
|
||||
|
||||
24
|
||||
00:03:13.500 --> 00:03:18.054
|
||||
The phone speaker revealed a mass of clawed, fleshy polyps which scream and gibber obscenely.
|
||||
|
||||
25
|
||||
00:03:25.000 --> 00:03:33.000
|
||||
There is a solemn silence as Emo looks around the room and the technical objects therein.
|
||||
|
||||
26
|
||||
00:03:38.000 --> 00:03:44.000
|
||||
Emo laughs disbelievingly and Proog walks away.
|
||||
|
||||
27
|
||||
00:03:46.000 --> 00:03:54.000
|
||||
In the next scene, the two enter another massive black room.
|
||||
|
||||
28
|
||||
00:03:54.500 --> 00:04:04.000
|
||||
There is no path, the entry platform is the only structure that seems to be there except for another exit, lit distantly at the far side.
|
||||
|
||||
29
|
||||
00:04:04.500 --> 00:04:14.000
|
||||
Proog takes a step forward into the void, and his feet are suddenly caught by giant typewriter arms that rocket up out of the blackness to catch his feet as he dances across mid-air.
|
||||
|
||||
30
|
||||
00:04:14.500 --> 00:04:22.000
|
||||
Emo follows Proog with somewhat less enthusiasm as the older man leads the way.
|
||||
|
||||
31
|
||||
00:04:52.000 --> 00:04:58.000
|
||||
They reach the end of the room and go through a hall into a small compartment.
|
||||
|
||||
32
|
||||
00:05:02.000 --> 00:05:06.000
|
||||
Proog presses a button, and the door shuts.
|
||||
|
||||
33
|
||||
00:05:06.500 --> 00:05:09.000
|
||||
It is an elevator.
|
||||
|
||||
34
|
||||
00:05:09.500 --> 00:05:24.000
|
||||
The elevator lurches suddenly as it is grabbed by a giant mechanical arm and thrown upwards, rushing up through an ever-widening tunnel.
|
||||
|
||||
35
|
||||
00:05:26.500 --> 00:05:32.000
|
||||
When it begins to slow down, another arm grabs the capsule and throws it even further up.
|
||||
|
||||
36
|
||||
00:05:32.500 --> 00:05:40.000
|
||||
As it moves up, the walls unlock and fall away, leaving only the floor with the two on it, rushing higher and higher.
|
||||
|
||||
37
|
||||
00:05:54.500 --> 00:05:59.000
|
||||
They exit the tunnel into a black sky and the platform reaches the peak of its arc.
|
||||
|
||||
38
|
||||
00:06:19.500 --> 00:06:26.000
|
||||
The elevator begins to drop down another shaft, coming to rest as it slams into the floor of another room and bringing the two to a level stop.
|
||||
|
||||
39
|
||||
00:06:26.500 --> 00:06:28.000
|
||||
A camera flashes.
|
||||
|
||||
40
|
||||
00:06:28.010 --> 00:06:34.000
|
||||
They are in a large, dingy room filled with strange, generator-like devices and dotted with boxy holographic projectors.
|
||||
|
||||
41
|
||||
00:06:34.500 --> 00:06:38.000
|
||||
One of them is projecting a portion of wall with a door in it right beside them.
|
||||
|
||||
42
|
||||
00:06:38.500 --> 00:06:40.000
|
||||
The door seems harmless enough.
|
||||
|
||||
43
|
||||
00:06:42.800 --> 00:06:45.100
|
||||
From behind the door comes light music.
|
||||
|
||||
44
|
||||
00:06:56.000 --> 00:07:00.100
|
||||
Proog presses a button on his cane, which changes the holograph to another wall.
|
||||
|
||||
45
|
||||
00:07:05.100 --> 00:07:11.000
|
||||
Proog finishes the wall, and boxes them into a Safe Room, out of the view of anything outside.
|
||||
|
||||
46
|
||||
00:07:39.000 --> 00:07:42.500
|
||||
Proog slaps him, trying to bring him to his senses.
|
||||
|
||||
47
|
||||
00:07:45.000 --> 00:07:52.000
|
||||
Emo storms away down the length of the room towards a wall he apparently cannot see and the wall begins to move, extending the length of the room.
|
||||
|
||||
48
|
||||
00:08:00.000 --> 00:08:07.000
|
||||
The walls begin to discolour and mechanical roots start tearing through the walls to his left.
|
||||
|
||||
49
|
||||
00:08:07.010 --> 00:08:09.000
|
||||
The roots move forwards toward Proog.
|
||||
|
||||
50
|
||||
00:08:22.000 --> 00:08:31.000
|
||||
The rest of the safety wall crumples away as a pair of massive hands heave out of the ground and begin to attack.
|
||||
|
||||
51
|
||||
00:08:31.010 --> 00:08:37.000
|
||||
Proog is knocked down by the shockwave, while Emo turns and begins to walk away, waving his finger around his temple in the 'crazy' sign.
|
||||
|
||||
52
|
||||
00:08:37.010 --> 00:08:44.000
|
||||
In a last effort, Proog extricates himself from the tentacle roots, and cracks Emo over the back of the head with his cane.
|
||||
|
||||
53
|
||||
00:08:44.500 --> 00:08:51.000
|
||||
As Emo collapses, everything falls away, and Proog and Emo are left in one tiny patch of light in the middle of blackness.
|
||||
|
||||
54
|
||||
00:09:00.000 --> 00:09:20.000
|
||||
The scene fades to black while panning over a pile of tentacle roots lying on the ground.
|
||||
|
||||
55
|
||||
00:09:26.000 --> 00:09:28.000
|
||||
Credits begin:
|
||||
|
||||
56
|
||||
00:09:28.500 --> 00:09:35.000
|
||||
Orange Open Movie Team
|
||||
Director: Bassum Kurdali
|
||||
Art Director: Andreas Goralczyk
|
||||
|
||||
57
|
||||
00:09:35.500 --> 00:09:39.000
|
||||
Music and Sound Design: Jan Morgenstern
|
||||
|
||||
58
|
||||
00:09:39.500 --> 00:09:44.000
|
||||
Emo: Cas Jansen
|
||||
Proog: Tygo Gernandt
|
||||
|
||||
59
|
||||
00:09:44.500 --> 00:09:50.000
|
||||
Screenplay: Pepijn Zwanenberg
|
||||
Original Concept & Scenario: Andreas Goralczyk, Bassam Kurdali, Ton Roosendaal
|
||||
|
||||
60
|
||||
00:09:50.500 --> 00:10:24.000
|
||||
More people for
|
||||
Additional Artwork and Animation
|
||||
Texture Photography
|
||||
Software Development
|
||||
3D Modelling, Animation, Rendering, Compiling Software
|
||||
Special Thanks to Open Source Projects
|
||||
Rendering Services Provided
|
||||
Hardware Sponsored
|
||||
Casting
|
||||
Sound FX, Foley, Dialogue Editing, Audio Mix and Post
|
||||
Voice Recording
|
||||
HDCam conversion
|
||||
Netherlands Media Art Institute Staff
|
||||
Blender Foundation Staff
|
||||
|
||||
61
|
||||
00:10:24.500 --> 00:10:30.000
|
||||
Many Thanks to our Donation and DVD sponsors
|
||||
|
||||
62
|
||||
00:10:30.500 --> 00:10:47.000
|
||||
Elephants Dream has been realised with financial support from
|
||||
The Netherlands Film Fund
|
||||
Mondriaan Foundation
|
||||
VSBfonds
|
||||
Uni-Verse / EU Sixth Framework Programme
|
||||
|
||||
63
|
||||
00:10:47.500 --> 00:10:53.000
|
||||
Produced By
|
||||
Ton Roosendaal
|
||||
Copyright 2006
|
||||
Netherlands Media Art Institute / Montevideo
|
||||
Blender Foundation
|
||||
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>Video.js Text Descriptions, Chapters & Captions Example</title>
|
||||
|
||||
<link href="http://vjs.zencdn.net/5.19/video-js.css" rel="stylesheet">
|
||||
<script src="http://vjs.zencdn.net/ie8/1.1/videojs-ie8.min.js"></script>
|
||||
<script src="http://vjs.zencdn.net/5.19/video.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- NOTE: we have to disable native Text Track support for the HTML5 tech,
|
||||
since even HTML5 video players with native Text Track support
|
||||
don't currently support 'description' text tracks in any
|
||||
useful way! Currently this means that iOS will not display
|
||||
ANY text tracks -->
|
||||
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="360"
|
||||
data-setup='{ "html5" : { "nativeTextTracks" : false } }'
|
||||
poster="http://d2zihajmogu5jn.cloudfront.net/elephantsdream/poster.png">
|
||||
|
||||
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.mp4" type="video/mp4">
|
||||
<source src="//d2zihajmogu5jn.cloudfront.net/elephantsdream/ed_hd.ogg" type="video/ogg">
|
||||
|
||||
<track kind="captions" src="captions.en.vtt" srclang="en" label="English" default></track><!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<track kind="captions" src="captions.sv.vtt" srclang="sv" label="Swedish"></track>
|
||||
<track kind="captions" src="captions.ru.vtt" srclang="ru" label="Russian"></track>
|
||||
<track kind="captions" src="captions.ja.vtt" srclang="ja" label="Japanese"></track>
|
||||
<track kind="captions" src="captions.ar.vtt" srclang="ar" label="Arabic"></track>
|
||||
|
||||
<track kind="descriptions" src="descriptions.en.vtt" srclang="en" label="English"></track>
|
||||
|
||||
<track kind="chapters" src="chapters.en.vtt" srclang="en" label="English"></track>
|
||||
|
||||
<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,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Index of video.js examples</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Index of video.js examples</h1>
|
||||
<ul>
|
||||
<li><a href="simple-embed">Video.js HTML5 video player simple example</a></li>
|
||||
<li><a href="elephantsdream">Elephants Dream video with text descriptions, chapters & captions example</a></li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,31 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Video.js | HTML5 Video Player</title>
|
||||
|
||||
<!-- Chang URLs to wherever Video.js files will be hosted -->
|
||||
<link href="../../../build/temp/video-js.min.css" rel="stylesheet" type="text/css">
|
||||
<!-- video.js must be in the <head> for older IEs to work. -->
|
||||
<script src="../../../build/temp/video.min.js"></script>
|
||||
|
||||
<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
|
||||
<script>
|
||||
videojs.options.flash.swf = "../../../build/temp/video-js.swf";
|
||||
</script>
|
||||
<title>Video.js | HTML5 Video Player</title>
|
||||
<link href="http://vjs.zencdn.net/5.19/video-js.css" rel="stylesheet">
|
||||
<script src="http://vjs.zencdn.net/ie8/1.1/videojs-ie8.min.js"></script>
|
||||
<script src="http://vjs.zencdn.net/5.19/video.js"></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="../shared/example-captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<track kind="subtitles" src="../shared/example-captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264" poster="http://vjs.zencdn.net/v/oceans.png" data-setup="{}">
|
||||
<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
|
||||
<source src="http://vjs.zencdn.net/v/oceans.webm" type="video/webm">
|
||||
<source src="http://vjs.zencdn.net/v/oceans.ogv" type="video/ogg">
|
||||
<track kind="captions" src="../shared/example-captions.vtt" srclang="en" label="English"></track>
|
||||
<!-- Tracks need an ending tag thanks to IE9 -->
|
||||
<track kind="subtitles" src="../shared/example-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>
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
API
|
||||
===
|
||||
|
||||
The Video.js API allows you to interact with the video through JavaScript, whether the browser is playing the video through HTML5 video, Flash, or any other supported playback technologies.
|
||||
|
||||
Referencing the Player
|
||||
----------------------
|
||||
To use the API functions, you need access to the player object. Luckily this is easy to get. You just need to make sure your video tag has an ID. The example embed code has an ID of "example\_video_1". If you have multiple videos on one page, make sure every video tag has a unique ID.
|
||||
|
||||
```js
|
||||
var myPlayer = videojs('example_video_1');
|
||||
```
|
||||
|
||||
(If the player hasn't been initialized yet via the data-setup attribute or another method, this will also initialize the player.)
|
||||
|
||||
Wait Until the Player is Ready
|
||||
------------------------------
|
||||
The time it takes Video.js to set up the video and API will vary depending on the playback technology being used (HTML5 will often be much faster to load than Flash). For that reason we want to use the player's 'ready' function to trigger any code that requires the player's API.
|
||||
|
||||
```javascript
|
||||
videojs("example_video_1").ready(function(){
|
||||
var myPlayer = this;
|
||||
|
||||
// EXAMPLE: Start playing the video.
|
||||
myPlayer.play();
|
||||
|
||||
});
|
||||
```
|
||||
|
||||
API Methods
|
||||
-----------
|
||||
Now that you have access to a ready player, you can control the video, get values, or respond to video events. The Video.js API function names follow the [HTML5 media API](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html). The main difference is that getter/setter functions are used for video properties.
|
||||
|
||||
```js
|
||||
|
||||
// setting a property on a bare HTML5 video element
|
||||
myVideoElement.currentTime = "120";
|
||||
|
||||
// setting a property on a Video.js player
|
||||
myPlayer.currentTime(120);
|
||||
|
||||
```
|
||||
|
||||
The full list of player API methods and events can be found in the [player API docs](../api/vjs.Player.md).
|
||||
@@ -0,0 +1,161 @@
|
||||
# Audio Tracks
|
||||
|
||||
Audio tracks are a feature of HTML5 video for providing alternate audio track selections
|
||||
to the user, so that a track other than the main track can be played. Video.js offers a
|
||||
cross-browser implementation of audio tracks.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Caveats](#caveats)
|
||||
* [Working with Audio Tracks](#working-with-audio-tracks)
|
||||
* [Add an Audio Track to the Player](#add-an-audio-track-to-the-player)
|
||||
* [Listen for a Video Track Becoming Enabled](#listen-for-a-video-track-becoming-enabled)
|
||||
* [Removing an Audio Track from the Player](#removing-an-audio-track-from-the-player)
|
||||
* [API](#api)
|
||||
* [videojs.AudioTrack](#videojsaudiotrack)
|
||||
* [id](#id)
|
||||
* [kind](#kind)
|
||||
* [label](#label)
|
||||
* [language](#language)
|
||||
* [enabled](#enabled)
|
||||
|
||||
## Caveats
|
||||
|
||||
* It is not possible to add audio tracks through HTML like you can with text tracks.
|
||||
They must be added programmatically.
|
||||
* Video.js only stores track representations. Switching audio tracks for playback is
|
||||
_not handled by Video.js_ and must be handled elsewhere - for example,
|
||||
[videojs-contrib-hls][hls] handles switching
|
||||
audio tracks to support track selection through the UI.
|
||||
|
||||
## Working with Audio Tracks
|
||||
|
||||
### Add an Audio Track to the Player
|
||||
|
||||
```js
|
||||
// Create a player.
|
||||
var player = videojs('my-player');
|
||||
|
||||
// Create a track object.
|
||||
var track = new videojs.AudioTrack({
|
||||
id: 'my-spanish-audio-track',
|
||||
kind: 'translation',
|
||||
label: 'Spanish',
|
||||
language: 'es'
|
||||
});
|
||||
|
||||
// Add the track to the player's audio track list.
|
||||
player.audioTracks().addTrack(track);
|
||||
```
|
||||
|
||||
### Listen for a Video Track Becoming Enabled
|
||||
|
||||
When a track is enabled or disabled on an `AudioTrackList`, a `change` event will be
|
||||
fired. You can listen for that event and do something with it.
|
||||
|
||||
> NOTE: The initial `AudioTrack` selection (usually the main track that is selected)
|
||||
> should not fire a `change` event.
|
||||
|
||||
```js
|
||||
// Get the current player's AudioTrackList object.
|
||||
var audioTrackList = player.audioTracks();
|
||||
|
||||
// Listen to the "change" event.
|
||||
audioTrackList.addEventListener('change', function() {
|
||||
|
||||
// Log the currently enabled AudioTrack label.
|
||||
for (var i = 0; i < audioTrackList.length; i++) {
|
||||
var track = audioTrackList[i];
|
||||
|
||||
if (track.enabled) {
|
||||
videojs.log(track.label);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Removing an Audio Track from the Player
|
||||
|
||||
Assuming a player already exists and has an audio track that you want to remove, you
|
||||
might do something like the following:
|
||||
|
||||
```js
|
||||
// Get the track we created in an earlier example.
|
||||
var track = player.audioTracks().getTrackById('my-spanish-audio-track');
|
||||
|
||||
// Remove it from the audio track list.
|
||||
player.audioTracks().removeTrack(track);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
For more complete information, refer to the
|
||||
[Video.js API docs](http://docs.videojs.com/), specifically:
|
||||
|
||||
* `Player#audioTracks`
|
||||
* `AudioTrackList`
|
||||
* `AudioTrack`
|
||||
|
||||
### `videojs.AudioTrack`
|
||||
|
||||
This class is based on [the `AudioTrack` standard][spec-audiotrack] and can be used to
|
||||
create new audio track objects.
|
||||
|
||||
Each property below is available as an option to the `AudioTrack` constructor.
|
||||
|
||||
#### `id`
|
||||
|
||||
> [standard definition](https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-id)
|
||||
|
||||
A unique identifier for this track. Video.js will generate one if not given.
|
||||
|
||||
#### `kind`
|
||||
|
||||
> [standard definition](https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind)
|
||||
|
||||
Video.js supports standard `kind` values for `AudioTracks`:
|
||||
|
||||
* `"alternative"`: A possible alternative to the main track.
|
||||
* `"descriptions"`: An audio description of a video track.
|
||||
* `"main"`: The primary audio track for this video.
|
||||
* `"main-desc"`: The primary audio track, mixed with audio descriptions.
|
||||
* `"translation"`: A translated version of the main audio track.
|
||||
* `"commentary"`: Commentary on the primary audio track, e.g. a director's commentary.
|
||||
* `""` (default): No explicit kind, or the kind given by the track's metadata is not
|
||||
recognized by the user agent.
|
||||
|
||||
#### `label`
|
||||
|
||||
> [standard definition](https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-label)
|
||||
|
||||
The label for the track that will be shown to the user. For example, in a menu that lists
|
||||
the different languages available as alternate audio tracks.
|
||||
|
||||
#### `language`
|
||||
|
||||
> [standard definition](https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-language)
|
||||
|
||||
The valid [BCP 47](https://tools.ietf.org/html/bcp47) code for the language of the audio
|
||||
track, e.g. `"en"` for English or `"es"` for Spanish.
|
||||
|
||||
For supported language translations, please see the [languages folder (/lang)](https://github.com/videojs/video.js/tree/master/lang)
|
||||
located in the Video.js root and refer to the [languages guide][languages-guide] for more
|
||||
information on languages in Video.js.
|
||||
|
||||
#### `enabled`
|
||||
|
||||
> [standard definition](https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-enabled)
|
||||
|
||||
Whether or not this track should be playing.
|
||||
|
||||
In Video.js, we only allow one track to be enabled at a time; so, if you enable more
|
||||
than one, the last one to be enabled will end up being the only one. While the spec
|
||||
allows for more than one track to be enabled, Safari and most implementations only allow
|
||||
one audio track to be enabled at a time.
|
||||
|
||||
[languages-guide]: /docs/guides/languages.md
|
||||
|
||||
[spec-audiotrack]: https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack
|
||||
|
||||
[hls]: http://github.com/videojs/videojs-contrib-hls
|
||||
+328
-47
@@ -1,59 +1,340 @@
|
||||
Components
|
||||
===
|
||||
The Video.js player is built on top of a simple, custom UI components architecture. The player class and all control classes inherit from the Component class, or a subclass of Component.
|
||||
# Components
|
||||
|
||||
The architecture of the Video.js player is centered around components. The `Player` class and all classes representing player controls and other UI elements inherit from the `Component` class. This architecture makes it easy to construct the user interface of the Video.js player in a tree-like structure that mirrors the DOM.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [What is a Component?](#what-is-a-component)
|
||||
* [Creating a Component](#creating-a-component)
|
||||
* [Component Children](#component-children)
|
||||
* [Basic Example](#basic-example)
|
||||
* [Using Options](#using-options)
|
||||
* [Event Listening](#event-listening)
|
||||
* [Using on](#using-on)
|
||||
* [Using off](#using-off)
|
||||
* [Using one](#using-one)
|
||||
* [Using trigger](#using-trigger)
|
||||
* [Default Component Tree](#default-component-tree)
|
||||
* [Specific Component Details](#specific-component-details)
|
||||
* [Volume Panel](#volume-panel)
|
||||
* [Text Track Settings](#text-track-settings)
|
||||
|
||||
## What is a Component?
|
||||
|
||||
A component is a JavaScript object that has the following features:
|
||||
|
||||
* An associated DOM element, in almost all cases.
|
||||
* An association to a `Player` object.
|
||||
* The ability to manage any number of child components.
|
||||
* The ability to listen for and trigger events.
|
||||
* A lifecycle of initialization and disposal.
|
||||
|
||||
For more specifics on the programmatic interface of a component, see [the component API docs][api].
|
||||
|
||||
## Creating a Component
|
||||
|
||||
Video.js components can be inherited and registered with Video.js to add new features and UI to the player.
|
||||
|
||||
For a working example, [we have a JSBin](http://jsbin.com/vobacas/edit?html,css,js,output) demonstrating the creation of a component for displaying a title across the top of the player.
|
||||
|
||||
In addition, there are a couple methods worth recognizing:
|
||||
|
||||
* `videojs.getComponent(String name)`: Retrieves component constructors from Video.js.
|
||||
* `videojs.registerComponent(String name, Function Comp)`: Registers component constructors with Video.js.
|
||||
* `videojs.extend(Function component, Object properties)`: Provides prototype inheritance. Can be used to extend a component's constructor, returning a new constructor with the given properties.
|
||||
|
||||
Creation:
|
||||
|
||||
```js
|
||||
videojs.Control = videojs.Component.extend();
|
||||
videojs.Button = videojs.Control.extend();
|
||||
videojs.PlayToggle = videojs.Button.extend();
|
||||
// adding a button to the player
|
||||
var player = videojs('some-video-id');
|
||||
var Component = videojs.getComponent('Component');
|
||||
var button = new Component(player);
|
||||
|
||||
console.log(button.el());
|
||||
```
|
||||
|
||||
The UI component architecture makes it easier to add child components to a parent component and build up an entire user interface, like the controls for the Video.js player.
|
||||
|
||||
```js
|
||||
// Adding a new control to the player
|
||||
myPlayer.addChild('BigPlayButton');
|
||||
```
|
||||
|
||||
Every component has an associated DOM element, and when you add a child component, it inserts the element of that child into the element of the parent.
|
||||
|
||||
```js
|
||||
myPlayer.addChild('BigPlayButton');
|
||||
```
|
||||
|
||||
Results in:
|
||||
The above code will output
|
||||
|
||||
```html
|
||||
<!-- Player Element -->
|
||||
<div class="video-js">
|
||||
<!-- BigPlayButton Element -->
|
||||
<div class="vjs-big-play-button"></div>
|
||||
</div>
|
||||
<div class="video-js">
|
||||
<div class="vjs-button">Button</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
The actual default component structure of the Video.js player looks something like this:
|
||||
Adding the new button to the player
|
||||
|
||||
```js
|
||||
// adding a button to the player
|
||||
var player = videojs('some-video-id');
|
||||
var button = player.addChild('button');
|
||||
|
||||
console.log(button.el());
|
||||
// will have the same html result as the previous example
|
||||
```
|
||||
|
||||
## Component Children
|
||||
|
||||
Again, refer to [the component API docs][api] for complete details on methods available for managing component structures.
|
||||
|
||||
### Basic Example
|
||||
|
||||
When child component is added to a parent component, Video.js inserts the element of the child into the element of the parent. For example, adding a component like this:
|
||||
|
||||
```js
|
||||
// Add a "BigPlayButton" component to the player. Its element will be appended to the player's element.
|
||||
player.addChild('BigPlayButton');
|
||||
```
|
||||
|
||||
Results in a DOM that looks like this:
|
||||
|
||||
```html
|
||||
<!-- Player Element -->
|
||||
<div class="video-js">
|
||||
<!-- BigPlayButton Element -->
|
||||
<div class="vjs-big-play-button"></div>
|
||||
</div>
|
||||
```
|
||||
|
||||
Conversely, removing child components will remove the child component's element from the DOM:
|
||||
|
||||
```js
|
||||
player.removeChild('BigPlayButton');
|
||||
```
|
||||
|
||||
Results in a DOM that looks like this:
|
||||
|
||||
```html
|
||||
<!-- Player Element -->
|
||||
<div class="video-js">
|
||||
</div>
|
||||
```
|
||||
|
||||
### Using Options
|
||||
|
||||
Pass in options for child constructors and options for children of the child.
|
||||
|
||||
```js
|
||||
var player = videojs('some-vid-id');
|
||||
var Component = videojs.getComponent('Component');
|
||||
var myComponent = new Component(player);
|
||||
var myButton = myComponent.addChild('MyButton', {
|
||||
text: 'Press Me',
|
||||
buttonChildExample: {
|
||||
buttonChildOption: true
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Children can also be added via options when a component is initialized.
|
||||
|
||||
> Note: Include a 'name' key which will be used if two child components of the same
|
||||
> type that need different options.
|
||||
|
||||
```js
|
||||
// MyComponent is from the above example
|
||||
var myComp = new MyComponent(player, {
|
||||
children: ['button', {
|
||||
name: 'button',
|
||||
someOtherOption: true
|
||||
}, {
|
||||
name: 'button',
|
||||
someOtherOption: false
|
||||
}]
|
||||
});
|
||||
```
|
||||
|
||||
## Event Listening
|
||||
|
||||
### Using `on`
|
||||
|
||||
```js
|
||||
var player = videojs('some-player-id');
|
||||
var Component = videojs.getComponent('Component');
|
||||
var myComponent = new Component(player);
|
||||
var myFunc = function() {
|
||||
var myComponent = this;
|
||||
console.log('myFunc called');
|
||||
};
|
||||
|
||||
myComponent.on('eventType', myFunc);
|
||||
myComponent.trigger('eventType');
|
||||
// logs 'myFunc called'
|
||||
```
|
||||
|
||||
The context of `myFunc` will be `myComponent` unless it is bound. You can add
|
||||
a listener to another element or component.
|
||||
|
||||
```js
|
||||
var otherComponent = new Component(player);
|
||||
|
||||
// myComponent/myFunc is from the above example
|
||||
myComponent.on(otherComponent.el(), 'eventName', myFunc);
|
||||
myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
|
||||
otherComponent.trigger('eventName');
|
||||
// logs 'myFunc called' twice
|
||||
```
|
||||
|
||||
### Using `off`
|
||||
|
||||
```js
|
||||
var player = videojs('some-player-id');
|
||||
var Component = videojs.getComponent('Component');
|
||||
var myComponent = new Component(player);
|
||||
var myFunc = function() {
|
||||
var myComponent = this;
|
||||
console.log('myFunc called');
|
||||
};
|
||||
myComponent.on('eventType', myFunc);
|
||||
myComponent.trigger('eventType');
|
||||
// logs 'myFunc called'
|
||||
|
||||
myComponent.off('eventType', myFunc);
|
||||
myComponent.trigger('eventType');
|
||||
// does nothing
|
||||
```
|
||||
|
||||
If myFunc gets excluded, _all_ listeners for the event type will get removed. If
|
||||
eventType gets excluded, _all_ listeners will get removed from the component.
|
||||
You can use `off` to remove listeners that get added to other elements or
|
||||
components using:
|
||||
|
||||
`myComponent.on(otherComponent...`
|
||||
|
||||
In this case both the event type and listener function are **REQUIRED**.
|
||||
|
||||
```js
|
||||
var otherComponent = new Component(player);
|
||||
|
||||
// myComponent/myFunc is from the above example
|
||||
myComponent.on(otherComponent.el(), 'eventName', myFunc);
|
||||
myComponent.on(otherComponent, 'eventName', myFunc);
|
||||
|
||||
otherComponent.trigger('eventName');
|
||||
// logs 'myFunc called' twice
|
||||
myComponent.off(ootherComponent.el(), 'eventName', myFunc);
|
||||
myComponent.off(otherComponent, 'eventName', myFunc);
|
||||
otherComponent.trigger('eventName');
|
||||
// does nothing
|
||||
```
|
||||
|
||||
### Using `one`
|
||||
|
||||
```js
|
||||
var player = videojs('some-player-id');
|
||||
var Component = videojs.getComponent('Component');
|
||||
var myComponent = new Component(player);
|
||||
var myFunc = function() {
|
||||
var myComponent = this;
|
||||
console.log('myFunc called');
|
||||
};
|
||||
myComponent.one('eventName', myFunc);
|
||||
myComponent.trigger('eventName');
|
||||
// logs 'myFunc called'
|
||||
|
||||
myComponent.trigger('eventName');
|
||||
// does nothing
|
||||
```
|
||||
|
||||
You can also add a listener to another element or component that will get
|
||||
triggered only once.
|
||||
|
||||
```js
|
||||
var otherComponent = new Component(player);
|
||||
|
||||
// myComponent/myFunc is from the above example
|
||||
myComponent.one(otherComponent.el(), 'eventName', myFunc);
|
||||
myComponent.one(otherComponent, 'eventName', myFunc);
|
||||
|
||||
otherComponent.trigger('eventName');
|
||||
// logs 'myFunc called' twice
|
||||
|
||||
otherComponent.trigger('eventName');
|
||||
// does nothing
|
||||
```
|
||||
|
||||
### Using `trigger`
|
||||
|
||||
```js
|
||||
var player = videojs('some-player-id');
|
||||
var Component = videojs.getComponent('Component');
|
||||
var myComponent = new Component(player);
|
||||
var myFunc = function(data) {
|
||||
var myComponent = this;
|
||||
console.log('myFunc called');
|
||||
console.log(data);
|
||||
};
|
||||
myComponent.one('eventName', myFunc);
|
||||
myComponent.trigger('eventName');
|
||||
// logs 'myFunc called' and 'undefined'
|
||||
|
||||
myComponent.trigger({'type':'eventName'});
|
||||
// logs 'myFunc called' and 'undefined'
|
||||
|
||||
myComponent.trigger('eventName', {data: 'some data'});
|
||||
// logs 'myFunc called' and "{data: 'some data'}"
|
||||
|
||||
myComponent.trigger({'type':'eventName'}, {data: 'some data'});
|
||||
// logs 'myFunc called' and "{data: 'some data'}"
|
||||
```
|
||||
|
||||
## Default Component Tree
|
||||
|
||||
The default component structure of the Video.js player looks something like this:
|
||||
|
||||
```tree
|
||||
Player
|
||||
PosterImage
|
||||
TextTrackDisplay
|
||||
LoadingSpinner
|
||||
BigPlayButton
|
||||
ControlBar
|
||||
PlayToggle
|
||||
FullscreenToggle
|
||||
CurrentTimeDisplay
|
||||
TimeDivider
|
||||
DurationDisplay
|
||||
RemainingTimeDisplay
|
||||
ProgressControl
|
||||
SeekBar
|
||||
LoadProgressBar
|
||||
PlayProgressBar
|
||||
SeekHandle
|
||||
VolumeControl
|
||||
VolumeBar
|
||||
VolumeLevel
|
||||
VolumeHandle
|
||||
MuteToggle
|
||||
├── MediaLoader (has no DOM element)
|
||||
├── PosterImage
|
||||
├── TextTrackDisplay
|
||||
├── LoadingSpinner
|
||||
├── BigPlayButton
|
||||
├─┬ ControlBar
|
||||
│ ├── PlayToggle
|
||||
│ ├── VolumePanel
|
||||
│ ├── CurrentTimeDisplay (hidden by default)
|
||||
│ ├── TimeDivider (hidden by default)
|
||||
│ ├── DurationDisplay (hidden by default)
|
||||
│ ├─┬ ProgressControl (hidden during live playback)
|
||||
│ │ └─┬ SeekBar
|
||||
│ │ ├── LoadProgressBar
|
||||
│ │ ├── MouseTimeDisplay
|
||||
│ │ └── PlayProgressBar
|
||||
│ ├── LiveDisplay (hidden during VOD playback)
|
||||
│ ├── RemainingTimeDisplay
|
||||
│ ├── CustomControlSpacer (has no UI)
|
||||
│ ├── PlaybackRateMenuButton (hidden, unless playback tech supports rate changes)
|
||||
│ ├── ChaptersButton (hidden, unless there are relevant tracks)
|
||||
│ ├── DescriptionsButton (hidden, unless there are relevant tracks)
|
||||
│ ├── SubtitlesButton (hidden, unless there are relevant tracks)
|
||||
│ ├── CaptionsButton (hidden, unless there are relevant tracks)
|
||||
│ ├── AudioTrackButton (hidden, unless there are relevant tracks)
|
||||
│ └── FullscreenToggle
|
||||
├── ErrorDisplay (hidden, until there is an error)
|
||||
└── TextTrackSettings
|
||||
```
|
||||
|
||||
## Specific Component Details
|
||||
|
||||
### Volume Panel
|
||||
|
||||
The `VolumePanel` includes the `MuteToggle` and the `VolumeControl` Components, which will be hidden if volume changes are not supported. There is one important option for the `VolumePanel` which can make your `VolumeControl` appear vertically over the `MuteToggle`. This can be set by passing `VolumePanel` `{inline: false}` as the default behavior is a horizontal `VolumeControl` with `{inline: true}`.
|
||||
|
||||
Example of a vertical `VolumeControl`
|
||||
|
||||
```js
|
||||
let player = videojs('myplayer', {
|
||||
controlBar: {
|
||||
volumePanel: {
|
||||
inline: false
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Text Track Settings
|
||||
|
||||
The text track settings component is only available when using emulated text tracks.
|
||||
|
||||
[api]: http://docs.videojs.com/Component.html
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
# Debugging
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Logging](#logging)
|
||||
* [API Overview](#api-overview)
|
||||
* [Log Safely](#log-safely)
|
||||
* [Log Objects Usefully](#log-objects-usefully)
|
||||
* [Log Levels](#log-levels)
|
||||
* [Available Log Levels](#available-log-levels)
|
||||
* [History](#history)
|
||||
|
||||
## Logging
|
||||
|
||||
Video.js includes `videojs.log`, a lightweight wrapper around a subset of [the `console` API][console]. The available methods are `videojs.log`, `videojs.log.warn`, and `videojs.log.error`.
|
||||
|
||||
### API Overview
|
||||
|
||||
Most of these methods should be fairly self-explanatory, but for complete details, see [the API docs][api].
|
||||
|
||||
| Method | Alias Of | Matching Level(s) |
|
||||
| ------------------------------- | --------------- | ----------------- |
|
||||
| `videojs.log()` | `console.log` | all |
|
||||
| `videojs.log.warn()` | `console.warn` | all, warn |
|
||||
| `videojs.log.error()` | `console.error` | all, warn, error |
|
||||
| `videojs.log.level()` | n/a | n/a |
|
||||
| `videojs.log.history()` | n/a | n/a |
|
||||
| `videojs.log.history.clear()` | n/a | n/a |
|
||||
| `videojs.log.history.disable()` | n/a | n/a |
|
||||
| `videojs.log.history.enable()` | n/a | n/a |
|
||||
|
||||
For descriptions of these features, please refer to the sections below.
|
||||
|
||||
### Log Safely
|
||||
|
||||
Unlike the `console`, it's safe to leave `videojs.log` calls in your code. They won't throw errors when the `console` doesn't exist.
|
||||
|
||||
### Log Objects Usefully
|
||||
|
||||
Similar to the `console`, any number of mixed-type values can be passed to `videojs.log` methods:
|
||||
|
||||
```js
|
||||
videojs.log('this is a string', {butThis: 'is an object'});
|
||||
```
|
||||
|
||||
However, certain browser consoles (namely, IE10 and lower) do not support non-string values. Video.js improves on this situation by passing objects through `JSON.stringify` before logging them in IE10 and below. In other words, instead of the above producing this:
|
||||
|
||||
```txt
|
||||
VIDEOJS: this is a string [object Object]
|
||||
```
|
||||
|
||||
it will produce this:
|
||||
|
||||
```txt
|
||||
VIDEOJS: this is a string {"butThis": "is an object"}
|
||||
```
|
||||
|
||||
### Log Levels
|
||||
|
||||
Unlike the `console`, `videojs.log` includes the concept of logging levels. These levels toggle logging methods on or off.
|
||||
|
||||
Levels are exposed through the `videojs.log.level` method. This method acts as both a getter and setter for the current logging level. With no arguments, it returns the current logging level:
|
||||
|
||||
```js
|
||||
videojs.log.level(); // "all"
|
||||
```
|
||||
|
||||
By passing a string, the logging level can be changed to one of the available logging levels:
|
||||
|
||||
```js
|
||||
videojs.log.level('error'); // show only error messages and suppress others
|
||||
videojs.log('foo'); // does nothing
|
||||
videojs.log.warn('foo'); // does nothing
|
||||
videojs.log.error('foo'); // logs "foo" as an error
|
||||
```
|
||||
|
||||
### Available Log Levels
|
||||
|
||||
* **all** (default): enables all logging methods
|
||||
* **error**: only show `log.error` messages
|
||||
* **off**: disable all logging methods
|
||||
* **warn**: only show `log.warn` _and_ `log.error` messages
|
||||
|
||||
### History
|
||||
|
||||
> **Note:** In Video.js 5, `videojs.log.history` was an array. As of Video.js 6, it is a function which returns an array. This change was made to provide a richer, safer logging history API.
|
||||
|
||||
By default, the `videojs.log` module tracks a history of _everything_ passed to it regardless of logging level:
|
||||
|
||||
```js
|
||||
videojs.log.history(); // an array of everything that's been logged up to now
|
||||
```
|
||||
|
||||
This will work even when logging is set to **off**.
|
||||
|
||||
This can be useful, but it can also be a source of memory leaks. For example, logged objects will be retained in history even if references are removed everywhere else!
|
||||
|
||||
To avoid this problem, history can be disabled or enabled via method calls (using the `disable` and `enable` methods respectively). Disabling history is as easy as:
|
||||
|
||||
```js
|
||||
videojs.log.history.disable();
|
||||
```
|
||||
|
||||
Finally, the history (if enabled) can be cleared at any time via:
|
||||
|
||||
```js
|
||||
videojs.log.history.clear();
|
||||
```
|
||||
|
||||
[api]: http://docs.videojs.com/
|
||||
|
||||
[console]: https://developer.mozilla.org/en-US/docs/Web/API/Console
|
||||
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