videojs_rails 4.2.2 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bd0944242505ecd665b54fa38fc3370b6eb2ed8
4
- data.tar.gz: 56c76e8eed49edd1f99e477afba4940be6236731
3
+ metadata.gz: 38c49666ba70a870de23c626b4b0d274f1d25049
4
+ data.tar.gz: 48e4b0b947797a0724fd3b49a7f7eb6f4d22b83f
5
5
  SHA512:
6
- metadata.gz: 01a0117a1215e70ed20c3155071278c116799624bb6a05febb53414370d05f65f696b543c29c7bd5e9e04471d2d0c61615efdd10e2371ea3675ace0035b27d06
7
- data.tar.gz: affd8b10327a06709e46d14ea50c7cbac68263a0e266e304ae7eea0ab0865b21d7c64a9238a4bbddc8304c282c7739ab8f052863d87cb616973f323bd34566d3
6
+ metadata.gz: b72993e361b879b4d26107538eb92c9065fe0c9945f50d3016bc7a2e91decf69a6f96dc48728288ec122e2a248d3546ab4d8a99ec646561b7095bfb3fa64130d
7
+ data.tar.gz: 0f309eac136d9349258f6faf6fe55f0161a0e9fbd3506e21d6adc809a7266fb6112b21857a7ad0e563d4c12f35950ff4512897a284204a79847467c1bef54606
@@ -1,3 +1,3 @@
1
1
  module VideojsRails
2
- VERSION = "4.2.2"
2
+ VERSION = "4.3.0"
3
3
  end
Binary file
Binary file
@@ -9,32 +9,57 @@ This is a custom SVG font generated by IcoMoon.
9
9
  <font id="VideoJS" horiz-adv-x="512" >
10
10
  <font-face units-per-em="512" ascent="480" descent="-32" />
11
11
  <missing-glyph horiz-adv-x="512" />
12
- <glyph unicode="&#xe000;" d="M 512.00,480.00 L 512.00,272.00 L 432.00,352.00 L 336.00,256.00 L 288.00,304.00 L 384.00,400.00 L 304.00,480.00 ZM 224.00,144.00 L 128.00,48.00 L 208.00-32.00 L 0.00-32.00 L 0.00,176.00 L 80.00,96.00 L 176.00,192.00 Z" />
13
- <glyph unicode="&#xe001;" d="M 96.00,416.00L 416.00,224.00L 96.00,32.00 z" />
14
- <glyph unicode="&#xe002;" d="M 64.00,416.00L 224.00,416.00L 224.00,32.00L 64.00,32.00zM 288.00,416.00L 448.00,416.00L 448.00,32.00L 288.00,32.00z" />
15
- <glyph unicode="&#xe003;" d="M 200.666,440.666 C 213.50,453.50 224.00,449.15 224.00,431.00 L 224.00,17.00 C 224.00-1.15 213.50-5.499 200.666,7.335 L 80.00,128.00 L 0.00,128.00 L 0.00,320.00 L 80.00,320.00 L 200.666,440.666 Z" />
16
- <glyph unicode="&#xe004;" d="M 274.51,109.49c-6.143,0.00-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0.00,33.941
17
- c 40.55,40.55, 40.55,106.529,0.00,147.078c-9.373,9.373-9.373,24.569,0.00,33.941c 9.373,9.372, 24.568,9.372, 33.941,0.00
18
- c 59.265-59.265, 59.265-155.696,0.00-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.50,453.50 224.00,449.15 224.00,431.00 L 224.00,17.00 C 224.00-1.15 213.50-5.499 200.666,7.335 L 80.00,128.00 L 0.00,128.00 L 0.00,320.00 L 80.00,320.00 L 200.666,440.666 Z" />
19
- <glyph unicode="&#xe005;" d="M 359.765,64.235c-6.143,0.00-12.284,2.343-16.971,7.029c-9.372,9.372-9.372,24.568,0.00,33.941
20
- c 65.503,65.503, 65.503,172.085,0.00,237.588c-9.372,9.373-9.372,24.569,0.00,33.941c 9.372,9.371, 24.569,9.372, 33.941,0.00
21
- C 417.532,335.938, 440.00,281.696, 440.00,224.00c0.00-57.695-22.468-111.938-63.265-152.735C 372.049,66.578, 365.907,64.235, 359.765,64.235zM 274.51,109.49c-6.143,0.00-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0.00,33.941
22
- c 40.55,40.55, 40.55,106.529,0.00,147.078c-9.373,9.373-9.373,24.569,0.00,33.941c 9.373,9.372, 24.568,9.372, 33.941,0.00
23
- c 59.265-59.265, 59.265-155.696,0.00-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.50,453.50 224.00,449.15 224.00,431.00 L 224.00,17.00 C 224.00-1.15 213.50-5.499 200.666,7.335 L 80.00,128.00 L 0.00,128.00 L 0.00,320.00 L 80.00,320.00 L 200.666,440.666 Z" />
24
- <glyph unicode="&#xe006;" d="M 445.02,18.98c-6.143,0.00-12.284,2.343-16.971,7.029c-9.372,9.373-9.372,24.568,0.00,33.941
25
- C 471.868,103.771, 496.001,162.03, 496.001,224.00c0.00,61.969-24.133,120.229-67.952,164.049c-9.372,9.373-9.372,24.569,0.00,33.941
26
- c 9.372,9.372, 24.569,9.372, 33.941,0.00c 52.885-52.886, 82.011-123.20, 82.011-197.99c0.00-74.791-29.126-145.104-82.011-197.99
27
- C 457.304,21.323, 451.162,18.98, 445.02,18.98zM 359.765,64.235c-6.143,0.00-12.284,2.343-16.971,7.029c-9.372,9.372-9.372,24.568,0.00,33.941
28
- c 65.503,65.503, 65.503,172.085,0.00,237.588c-9.372,9.373-9.372,24.569,0.00,33.941c 9.372,9.371, 24.569,9.372, 33.941,0.00
29
- C 417.532,335.938, 440.00,281.696, 440.00,224.00c0.00-57.695-22.468-111.938-63.265-152.735C 372.049,66.578, 365.907,64.235, 359.765,64.235zM 274.51,109.49c-6.143,0.00-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0.00,33.941
30
- c 40.55,40.55, 40.55,106.529,0.00,147.078c-9.373,9.373-9.373,24.569,0.00,33.941c 9.373,9.372, 24.568,9.372, 33.941,0.00
31
- c 59.265-59.265, 59.265-155.696,0.00-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.50,453.50 224.00,449.15 224.00,431.00 L 224.00,17.00 C 224.00-1.15 213.50-5.499 200.666,7.335 L 80.00,128.00 L 0.00,128.00 L 0.00,320.00 L 80.00,320.00 L 200.666,440.666 Z" horiz-adv-x="544" />
32
- <glyph unicode="&#xe007;" d="M 256.00,480.00L 96.00,224.00L 256.00-32.00L 416.00,224.00 z" />
33
- <glyph unicode="&#xe008;" d="M 0.00,480.00 L 687.158,480.00 L 687.158-35.207 L 0.00-35.207 L 0.00,480.00 z M 622.731,224.638 C 621.878,314.664 618.46,353.922 597.131,381.656 C 593.291,387.629 586.038,391.042 580.065,395.304 C 559.158,410.669 460.593,416.211 346.247,416.211 C 231.896,416.211 128.642,410.669 108.162,395.304 C 101.762,391.042 94.504,387.629 90.242,381.656 C 69.331,353.922 66.349,314.664 65.069,224.638 C 66.349,134.607 69.331,95.353 90.242,67.62 C 94.504,61.22 101.762,58.233 108.162,53.967 C 128.642,38.18 231.896,33.06 346.247,32.207 C 460.593,33.06 559.158,38.18 580.065,53.967 C 586.038,58.233 593.291,61.22 597.131,67.62 C 618.46,95.353 621.878,134.607 622.731,224.638 z M 331.179,247.952 C 325.389,318.401 287.924,359.905 220.901,359.905 C 159.672,359.905 111.54,304.689 111.54,215.965 C 111.54,126.859 155.405,71.267 227.907,71.267 C 285.79,71.267 326.306,113.916 332.701,184.742 L 263.55,184.742 C 260.81,158.468 249.843,138.285 226.69,138.285 C 190.136,138.285 183.435,174.462 183.435,212.92 C 183.435,265.854 198.665,292.886 223.951,292.886 C 246.492,292.886 260.81,276.511 262.939,247.952 L 331.179,247.952 z M 570.013,247.952 C 564.228,318.401 526.758,359.905 459.74,359.905 C 398.507,359.905 350.379,304.689 350.379,215.965 C 350.379,126.859 394.244,71.267 466.746,71.267 C 524.625,71.267 565.14,113.916 571.536,184.742 L 502.384,184.742 C 499.649,158.468 488.682,138.285 465.529,138.285 C 428.971,138.285 422.27,174.462 422.27,212.92 C 422.27,265.854 437.504,292.886 462.785,292.886 C 485.327,292.886 499.649,276.511 501.778,247.952 L 570.013,247.952 z " horiz-adv-x="687.1578947368421" />
34
- <glyph unicode="&#xe009;" d="M 64.00,416.00L 448.00,416.00L 448.00,32.00L 64.00,32.00z" />
35
- <glyph unicode="&#xe00a;" d="M 192.00,416.00A64.00,64.00 12780.00 1 1 320.00,416A64.00,64.00 12780.00 1 1 192.00,416zM 327.765,359.765A64.00,64.00 12780.00 1 1 455.765,359.765A64.00,64.00 12780.00 1 1 327.765,359.765zM 416.00,224.00A32.00,32.00 12780.00 1 1 480.00,224A32.00,32.00 12780.00 1 1 416.00,224zM 359.765,88.235A32.00,32.00 12780.00 1 1 423.765,88.23500000000001A32.00,32.00 12780.00 1 1 359.765,88.23500000000001zM 224.001,32.00A32.00,32.00 12780.00 1 1 288.001,32A32.00,32.00 12780.00 1 1 224.001,32zM 88.236,88.235A32.00,32.00 12780.00 1 1 152.236,88.23500000000001A32.00,32.00 12780.00 1 1 88.236,88.23500000000001zM 72.236,359.765A48.00,48.00 12780.00 1 1 168.236,359.765A48.00,48.00 12780.00 1 1 72.236,359.765zM 28.00,224.00A36.00,36.00 12780.00 1 1 100.00,224A36.00,36.00 12780.00 1 1 28.00,224z" />
36
- <glyph unicode="&#xe00b;" d="M 224.00,192.00 L 224.00-16.00 L 144.00,64.00 L 48.00-32.00 L 0.00,16.00 L 96.00,112.00 L 16.00,192.00 ZM 512.00,432.00 L 416.00,336.00 L 496.00,256.00 L 288.00,256.00 L 288.00,464.00 L 368.00,384.00 L 464.00,480.00 Z" />
37
- <glyph unicode="&#xe00c;" d="M 256.00,448.00 C 397.385,448.00 512.00,354.875 512.00,240.00 C 512.00,125.124 397.385,32.00 256.00,32.00 C 242.422,32.00 229.095,32.867 216.088,34.522 C 161.099-20.467 95.463-30.328 32.00-31.776 L 32.00-18.318 C 66.268-1.529 96.00,29.052 96.00,64.00 C 96.00,68.877 95.621,73.665 94.918,78.348 C 37.02,116.48 0.00,174.725 0.00,240.00 C 0.00,354.875 114.615,448.00 256.00,448.00 Z" />
38
- <glyph unicode="&#x20;" horiz-adv-x="256" />
39
12
  <glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
13
+ <glyph unicode="&#xe002;" d="M 64,416L 224,416L 224,32L 64,32zM 288,416L 448,416L 448,32L 288,32z" />
14
+ <glyph unicode="&#xe003;" d="M 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z" />
15
+ <glyph unicode="&#xe004;" d="M 274.51,109.49c-6.143,0-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0,33.941
16
+ c 40.55,40.55, 40.55,106.529,0,147.078c-9.373,9.373-9.373,24.569,0,33.941c 9.373,9.372, 24.568,9.372, 33.941,0
17
+ c 59.265-59.265, 59.265-155.696,0-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z" />
18
+ <glyph unicode="&#xe005;" d="M 359.765,64.235c-6.143,0-12.284,2.343-16.971,7.029c-9.372,9.372-9.372,24.568,0,33.941
19
+ c 65.503,65.503, 65.503,172.085,0,237.588c-9.372,9.373-9.372,24.569,0,33.941c 9.372,9.371, 24.569,9.372, 33.941,0
20
+ C 417.532,335.938, 440,281.696, 440,224c0-57.695-22.468-111.938-63.265-152.735C 372.049,66.578, 365.907,64.235, 359.765,64.235zM 274.51,109.49c-6.143,0-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0,33.941
21
+ c 40.55,40.55, 40.55,106.529,0,147.078c-9.373,9.373-9.373,24.569,0,33.941c 9.373,9.372, 24.568,9.372, 33.941,0
22
+ c 59.265-59.265, 59.265-155.696,0-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z" />
23
+ <glyph unicode="&#xe006;" d="M 445.020,18.98c-6.143,0-12.284,2.343-16.971,7.029c-9.372,9.373-9.372,24.568,0,33.941
24
+ C 471.868,103.771, 496.001,162.030, 496.001,224c0,61.969-24.133,120.229-67.952,164.049c-9.372,9.373-9.372,24.569,0,33.941
25
+ c 9.372,9.372, 24.569,9.372, 33.941,0c 52.885-52.886, 82.011-123.2, 82.011-197.99c0-74.791-29.126-145.104-82.011-197.99
26
+ C 457.304,21.323, 451.162,18.98, 445.020,18.98zM 359.765,64.235c-6.143,0-12.284,2.343-16.971,7.029c-9.372,9.372-9.372,24.568,0,33.941
27
+ c 65.503,65.503, 65.503,172.085,0,237.588c-9.372,9.373-9.372,24.569,0,33.941c 9.372,9.371, 24.569,9.372, 33.941,0
28
+ C 417.532,335.938, 440,281.696, 440,224c0-57.695-22.468-111.938-63.265-152.735C 372.049,66.578, 365.907,64.235, 359.765,64.235zM 274.51,109.49c-6.143,0-12.284,2.343-16.971,7.029c-9.373,9.373-9.373,24.568,0,33.941
29
+ c 40.55,40.55, 40.55,106.529,0,147.078c-9.373,9.373-9.373,24.569,0,33.941c 9.373,9.372, 24.568,9.372, 33.941,0
30
+ c 59.265-59.265, 59.265-155.696,0-214.961C 286.794,111.833, 280.652,109.49, 274.51,109.49zM 200.666,440.666 C 213.5,453.5 224,449.15 224,431 L 224,17 C 224-1.15 213.5-5.499 200.666,7.335 L 80,128 L 0,128 L 0,320 L 80,320 L 200.666,440.666 Z" horiz-adv-x="544" />
31
+ <glyph unicode="&#xe007;" d="M 256,480L 96,224L 256-32L 416,224 z" />
32
+ <glyph unicode="&#xe008;" d="M 0,480 L 687.158,480 L 687.158-35.207 L 0-35.207 L 0,480 z M 622.731,224.638 C 621.878,314.664 618.46,353.922 597.131,381.656 C 593.291,387.629 586.038,391.042 580.065,395.304 C 559.158,410.669 460.593,416.211 346.247,416.211 C 231.896,416.211 128.642,410.669 108.162,395.304 C 101.762,391.042 94.504,387.629 90.242,381.656 C 69.331,353.922 66.349,314.664 65.069,224.638 C 66.349,134.607 69.331,95.353 90.242,67.62 C 94.504,61.22 101.762,58.233 108.162,53.967 C 128.642,38.18 231.896,33.060 346.247,32.207 C 460.593,33.060 559.158,38.18 580.065,53.967 C 586.038,58.233 593.291,61.22 597.131,67.62 C 618.46,95.353 621.878,134.607 622.731,224.638 z M 331.179,247.952 C 325.389,318.401 287.924,359.905 220.901,359.905 C 159.672,359.905 111.54,304.689 111.54,215.965 C 111.54,126.859 155.405,71.267 227.907,71.267 C 285.79,71.267 326.306,113.916 332.701,184.742 L 263.55,184.742 C 260.81,158.468 249.843,138.285 226.69,138.285 C 190.136,138.285 183.435,174.462 183.435,212.92 C 183.435,265.854 198.665,292.886 223.951,292.886 C 246.492,292.886 260.81,276.511 262.939,247.952 L 331.179,247.952 z M 570.013,247.952 C 564.228,318.401 526.758,359.905 459.74,359.905 C 398.507,359.905 350.379,304.689 350.379,215.965 C 350.379,126.859 394.244,71.267 466.746,71.267 C 524.625,71.267 565.14,113.916 571.536,184.742 L 502.384,184.742 C 499.649,158.468 488.682,138.285 465.529,138.285 C 428.971,138.285 422.27,174.462 422.27,212.92 C 422.27,265.854 437.504,292.886 462.785,292.886 C 485.327,292.886 499.649,276.511 501.778,247.952 L 570.013,247.952 z " horiz-adv-x="687.158" />
33
+ <glyph unicode="&#xe009;" d="M 64,416L 448,416L 448,32L 64,32z" />
34
+ <glyph unicode="&#xe00a;" d="M 192,416A64,64 12780 1 1 320,416A64,64 12780 1 1 192,416zM 327.765,359.765A64,64 12780 1 1 455.765,359.765A64,64 12780 1 1 327.765,359.765zM 416,224A32,32 12780 1 1 480,224A32,32 12780 1 1 416,224zM 359.765,88.235A32,32 12780 1 1 423.765,88.23500000000001A32,32 12780 1 1 359.765,88.23500000000001zM 224.001,32A32,32 12780 1 1 288.001,32A32,32 12780 1 1 224.001,32zM 88.236,88.235A32,32 12780 1 1 152.236,88.23500000000001A32,32 12780 1 1 88.236,88.23500000000001zM 72.236,359.765A48,48 12780 1 1 168.236,359.765A48,48 12780 1 1 72.236,359.765zM 28,224A36,36 12780 1 1 100,224A36,36 12780 1 1 28,224z" />
35
+ <glyph unicode="&#xe00b;" d="M 224,192 L 224-16 L 144,64 L 48-32 L 0,16 L 96,112 L 16,192 ZM 512,432 L 416,336 L 496,256 L 288,256 L 288,464 L 368,384 L 464,480 Z" />
36
+ <glyph unicode="&#xe00c;" d="M 256,448 C 397.385,448 512,354.875 512,240 C 512,125.124 397.385,32 256,32 C 242.422,32 229.095,32.867 216.088,34.522 C 161.099-20.467 95.463-30.328 32-31.776 L 32-18.318 C 66.268-1.529 96,29.052 96,64 C 96,68.877 95.621,73.665 94.918,78.348 C 37.020,116.48 0,174.725 0,240 C 0,354.875 114.615,448 256,448 Z" />
37
+ <glyph unicode="&#xe00d;" d="M 256,480C 114.615,480,0,365.385,0,224s 114.615-256, 256-256s 256,114.615, 256,256S 397.385,480, 256,480z M 256,352
38
+ c 70.692,0, 128-57.308, 128-128s-57.308-128-128-128s-128,57.308-128,128S 185.308,352, 256,352z M 408.735,71.265
39
+ C 367.938,30.468, 313.695,8, 256,8c-57.696,0-111.938,22.468-152.735,63.265C 62.468,112.062, 40,166.304, 40,224
40
+ c0,57.695, 22.468,111.938, 63.265,152.735l 33.941-33.941c0,0,0,0,0,0c-65.503-65.503-65.503-172.085,0-237.588
41
+ C 168.937,73.475, 211.125,56, 256,56c 44.874,0, 87.062,17.475, 118.794,49.206c 65.503,65.503, 65.503,172.084,0,237.588l 33.941,33.941
42
+ C 449.532,335.938, 472,281.695, 472,224C 472,166.304, 449.532,112.062, 408.735,71.265z" />
43
+ <glyph unicode="&#xe01e;" d="M 512,224c-0.639,33.431-7.892,66.758-21.288,97.231c-13.352,30.5-32.731,58.129-56.521,80.96
44
+ c-23.776,22.848-51.972,40.91-82.492,52.826C 321.197,466.979, 288.401,472.693, 256,472c-32.405-0.641-64.666-7.687-94.167-20.678
45
+ c-29.524-12.948-56.271-31.735-78.367-54.788c-22.112-23.041-39.58-50.354-51.093-79.899C 20.816,287.104, 15.309,255.375, 16,224
46
+ c 0.643-31.38, 7.482-62.574, 20.067-91.103c 12.544-28.55, 30.738-54.414, 53.055-75.774c 22.305-21.377, 48.736-38.252, 77.307-49.36
47
+ C 194.988-3.389, 225.652-8.688, 256-8c 30.354,0.645, 60.481,7.277, 88.038,19.457c 27.575,12.141, 52.558,29.74, 73.183,51.322
48
+ c 20.641,21.57, 36.922,47.118, 47.627,74.715c 6.517,16.729, 10.94,34.2, 13.271,51.899c 0.623-0.036, 1.249-0.060, 1.881-0.060
49
+ c 17.673,0, 32,14.326, 32,32c0,0.898-0.047,1.786-0.119,2.666L 512,223.999 z M 461.153,139.026c-11.736-26.601-28.742-50.7-49.589-70.59
50
+ c-20.835-19.905-45.5-35.593-72.122-45.895C 312.828,12.202, 284.297,7.315, 256,8c-28.302,0.649-56.298,6.868-81.91,18.237
51
+ c-25.625,11.333-48.842,27.745-67.997,47.856c-19.169,20.099-34.264,43.882-44.161,69.529C 51.997,169.264, 47.318,196.729, 48,224
52
+ c 0.651,27.276, 6.664,54.206, 17.627,78.845c 10.929,24.65, 26.749,46.985, 46.123,65.405c 19.365,18.434, 42.265,32.935, 66.937,42.428
53
+ C 203.356,420.208, 229.755,424.681, 256,424c 26.25-0.653, 52.114-6.459, 75.781-17.017c 23.676-10.525, 45.128-25.751, 62.812-44.391
54
+ c 17.698-18.629, 31.605-40.647, 40.695-64.344C 444.412,274.552, 448.679,249.219, 448,224l 0.119,0 c-0.072-0.88-0.119-1.768-0.119-2.666
55
+ c0-16.506, 12.496-30.087, 28.543-31.812C 473.431,172.111, 468.278,155.113, 461.153,139.026z" />
56
+ <glyph unicode="&#xe01f;" d="M 256,480 C 116.626,480 3.271,368.619 0.076,230.013 C 3.036,350.945 94.992,448 208,448 C 322.875,448 416,347.712 416,224 C 416,197.49 437.49,176 464,176 C 490.51,176 512,197.49 512,224 C 512,365.385 397.385,480 256,480 ZM 256-32 C 395.374-32 508.729,79.381 511.924,217.987 C 508.964,97.055 417.008,0 304,0 C 189.125,0 96,100.288 96,224 C 96,250.51 74.51,272 48,272 C 21.49,272 0,250.51 0,224 C 0,82.615 114.615-32 256-32 Z" />
57
+ <glyph unicode="&#xe00e;" d="M 432,128c-22.58,0-42.96-9.369-57.506-24.415L 158.992,211.336C 159.649,215.462, 160,219.689, 160,224
58
+ s-0.351,8.538-1.008,12.663l 215.502,107.751C 389.040,329.369, 409.42,320, 432,320c 44.183,0, 80,35.817, 80,80S 476.183,480, 432,480
59
+ s-80-35.817-80-80c0-4.311, 0.352-8.538, 1.008-12.663L 137.506,279.585C 122.96,294.63, 102.58,304, 80,304c-44.183,0-80-35.818-80-80
60
+ c0-44.184, 35.817-80, 80-80c 22.58,0, 42.96,9.369, 57.506,24.414l 215.502-107.751C 352.352,56.538, 352,52.311, 352,48
61
+ c0-44.184, 35.817-80, 80-80s 80,35.816, 80,80C 512,92.182, 476.183,128, 432,128z" />
62
+ <glyph unicode="&#xe001;" d="M 96,416L 416,224L 96,32 z" />
63
+ <glyph unicode="&#xe000;" d="M 512,480 L 512,272 L 432,352 L 336,256 L 288,304 L 384,400 L 304,480 ZM 224,144 L 128,48 L 208-32 L 0-32 L 0,176 L 80,96 L 176,192 Z" />
64
+ <glyph unicode="&#x20;" horiz-adv-x="256" />
40
65
  </font></defs></svg>
Binary file
Binary file
File without changes
@@ -11,10 +11,17 @@ document.createElement('track');
11
11
  * Doubles as the main function for users to create a player instance and also
12
12
  * the main library object.
13
13
  *
14
+ * **ALIASES** videojs, _V_ (deprecated)
15
+ *
16
+ * The `vjs` function can be used to initialize or retrieve a player.
17
+ *
18
+ * var myPlayer = vjs('my_video_id');
19
+ *
14
20
  * @param {String|Element} id Video element or video element ID
15
21
  * @param {Object=} options Optional options object for config/settings
16
22
  * @param {Function=} ready Optional ready callback
17
23
  * @return {vjs.Player} A player instance
24
+ * @namespace
18
25
  */
19
26
  var vjs = function(id, options, ready){
20
27
  var tag; // Element of ID
@@ -57,7 +64,7 @@ var videojs = vjs;
57
64
  window.videojs = window.vjs = vjs;
58
65
 
59
66
  // CDN Version. Used to target right flash swf.
60
- vjs.CDN_VERSION = '4.2';
67
+ vjs.CDN_VERSION = '4.3';
61
68
  vjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
62
69
 
63
70
  /**
@@ -99,7 +106,7 @@ vjs.options = {
99
106
  };
100
107
 
101
108
  // Set CDN Version of swf
102
- // The added (+) blocks the replace from changing this 4.2 string
109
+ // The added (+) blocks the replace from changing this 4.3 string
103
110
  if (vjs.CDN_VERSION !== 'GENERATED'+'_CDN_VSN') {
104
111
  videojs.options['flash']['swf'] = vjs.ACCESS_PROTOCOL + 'vjs.zencdn.net/'+vjs.CDN_VERSION+'/video-js.swf';
105
112
  }
@@ -111,6 +118,53 @@ if (vjs.CDN_VERSION !== 'GENERATED'+'_CDN_VSN') {
111
118
  vjs.players = {};
112
119
  /**
113
120
  * Core Object/Class for objects that use inheritance + contstructors
121
+ *
122
+ * To create a class that can be subclassed itself, extend the CoreObject class.
123
+ *
124
+ * var Animal = CoreObject.extend();
125
+ * var Horse = Animal.extend();
126
+ *
127
+ * The constructor can be defined through the init property of an object argument.
128
+ *
129
+ * var Animal = CoreObject.extend({
130
+ * init: function(name, sound){
131
+ * this.name = name;
132
+ * }
133
+ * });
134
+ *
135
+ * Other methods and properties can be added the same way, or directly to the
136
+ * prototype.
137
+ *
138
+ * var Animal = CoreObject.extend({
139
+ * init: function(name){
140
+ * this.name = name;
141
+ * },
142
+ * getName: function(){
143
+ * return this.name;
144
+ * },
145
+ * sound: '...'
146
+ * });
147
+ *
148
+ * Animal.prototype.makeSound = function(){
149
+ * alert(this.sound);
150
+ * };
151
+ *
152
+ * To create an instance of a class, use the create method.
153
+ *
154
+ * var fluffy = Animal.create('Fluffy');
155
+ * fluffy.getName(); // -> Fluffy
156
+ *
157
+ * Methods and properties can be overridden in subclasses.
158
+ *
159
+ * var Horse = Animal.extend({
160
+ * sound: 'Neighhhhh!'
161
+ * });
162
+ *
163
+ * var horsey = Horse.create('Horsey');
164
+ * horsey.getName(); // -> Horsey
165
+ * horsey.makeSound(); // -> Alert: Neighhhhh!
166
+ *
167
+ * @class
114
168
  * @constructor
115
169
  */
116
170
  vjs.CoreObject = vjs['CoreObject'] = function(){};
@@ -122,9 +176,13 @@ vjs.CoreObject = vjs['CoreObject'] = function(){};
122
176
 
123
177
  /**
124
178
  * Create a new object that inherits from this Object
179
+ *
180
+ * var Animal = CoreObject.extend();
181
+ * var Horse = Animal.extend();
182
+ *
125
183
  * @param {Object} props Functions and properties to be applied to the
126
184
  * new object's prototype
127
- * @return {vjs.CoreObject} Returns an object that inherits from CoreObject
185
+ * @return {vjs.CoreObject} An object that inherits from CoreObject
128
186
  * @this {*}
129
187
  */
130
188
  vjs.CoreObject.extend = function(props){
@@ -171,7 +229,10 @@ vjs.CoreObject.extend = function(props){
171
229
 
172
230
  /**
173
231
  * Create a new instace of this Object class
174
- * @return {vjs.CoreObject} Returns an instance of a CoreObject subclass
232
+ *
233
+ * var myAnimal = Animal.create();
234
+ *
235
+ * @return {vjs.CoreObject} An instance of a CoreObject subclass
175
236
  * @this {*}
176
237
  */
177
238
  vjs.CoreObject.create = function(){
@@ -199,6 +260,7 @@ vjs.CoreObject.create = function(){
199
260
  * @param {Element|Object} elem Element or object to bind listeners to
200
261
  * @param {String} type Type of event to bind to.
201
262
  * @param {Function} fn Event listener.
263
+ * @private
202
264
  */
203
265
  vjs.on = function(elem, type, fn){
204
266
  var data = vjs.getData(elem);
@@ -251,6 +313,7 @@ vjs.on = function(elem, type, fn){
251
313
  * @param {Element|Object} elem Object to remove listeners from
252
314
  * @param {String=} type Type of listener to remove. Don't include to remove all events from element.
253
315
  * @param {Function} fn Specific listener to remove. Don't incldue to remove listeners for an event type.
316
+ * @private
254
317
  */
255
318
  vjs.off = function(elem, type, fn) {
256
319
  // Don't want to add a cache object through getData if not needed
@@ -300,6 +363,7 @@ vjs.off = function(elem, type, fn) {
300
363
  * Clean up the listener cache and dispatchers
301
364
  * @param {Element|Object} elem Element to clean up
302
365
  * @param {String} type Type of event to clean up
366
+ * @private
303
367
  */
304
368
  vjs.cleanUpEvents = function(elem, type) {
305
369
  var data = vjs.getData(elem);
@@ -339,6 +403,7 @@ vjs.cleanUpEvents = function(elem, type) {
339
403
  * Fix a native event to have standard property values
340
404
  * @param {Object} event Event object to fix
341
405
  * @return {Object}
406
+ * @private
342
407
  */
343
408
  vjs.fixEvent = function(event) {
344
409
 
@@ -441,6 +506,7 @@ vjs.fixEvent = function(event) {
441
506
  * Trigger an event for an element
442
507
  * @param {Element|Object} elem Element to trigger an event on
443
508
  * @param {String} event Type of event to trigger
509
+ * @private
444
510
  */
445
511
  vjs.trigger = function(elem, event) {
446
512
  // Fetches element data and a reference to the parent (for bubbling).
@@ -511,9 +577,9 @@ vjs.trigger = function(elem, event) {
511
577
  /**
512
578
  * Trigger a listener only once for an event
513
579
  * @param {Element|Object} elem Element or object to
514
- * @param {[type]} type [description]
515
- * @param {Function} fn [description]
516
- * @return {[type]}
580
+ * @param {String} type
581
+ * @param {Function} fn
582
+ * @private
517
583
  */
518
584
  vjs.one = function(elem, type, fn) {
519
585
  var func = function(){
@@ -530,6 +596,7 @@ var hasOwnProp = Object.prototype.hasOwnProperty;
530
596
  * @param {String=} tagName Name of tag to be created.
531
597
  * @param {Object=} properties Element properties to be applied.
532
598
  * @return {Element}
599
+ * @private
533
600
  */
534
601
  vjs.createEl = function(tagName, properties){
535
602
  var el, propName;
@@ -562,6 +629,7 @@ vjs.createEl = function(tagName, properties){
562
629
  * Uppercase the first letter of a string
563
630
  * @param {String} string String to be uppercased
564
631
  * @return {String}
632
+ * @private
565
633
  */
566
634
  vjs.capitalize = function(string){
567
635
  return string.charAt(0).toUpperCase() + string.slice(1);
@@ -570,13 +638,18 @@ vjs.capitalize = function(string){
570
638
  /**
571
639
  * Object functions container
572
640
  * @type {Object}
641
+ * @private
573
642
  */
574
643
  vjs.obj = {};
575
644
 
576
645
  /**
577
- * Object.create shim for prototypal inheritance.
646
+ * Object.create shim for prototypal inheritance
647
+ *
578
648
  * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create
649
+ *
650
+ * @function
579
651
  * @param {Object} obj Object to use as prototype
652
+ * @private
580
653
  */
581
654
  vjs.obj.create = Object.create || function(obj){
582
655
  //Create a new function called 'F' which is just an empty object.
@@ -596,6 +669,7 @@ vjs.obj = {};
596
669
  * @param {Object} obj Object of properties
597
670
  * @param {Function} fn Function to be called on each property.
598
671
  * @this {*}
672
+ * @private
599
673
  */
600
674
  vjs.obj.each = function(obj, fn, context){
601
675
  for (var key in obj) {
@@ -610,6 +684,7 @@ vjs.obj.each = function(obj, fn, context){
610
684
  * @param {Object} obj1
611
685
  * @param {Object} obj2
612
686
  * @return {Object}
687
+ * @private
613
688
  */
614
689
  vjs.obj.merge = function(obj1, obj2){
615
690
  if (!obj2) { return obj1; }
@@ -628,6 +703,7 @@ vjs.obj.merge = function(obj1, obj2){
628
703
  * @param {Object} obj1 Object to override
629
704
  * @param {Object} obj2 Overriding object
630
705
  * @return {Object} New object. Obj1 and Obj2 will be untouched.
706
+ * @private
631
707
  */
632
708
  vjs.obj.deepMerge = function(obj1, obj2){
633
709
  var key, val1, val2;
@@ -656,6 +732,7 @@ vjs.obj.deepMerge = function(obj1, obj2){
656
732
  * Make a copy of the supplied object
657
733
  * @param {Object} obj Object to copy
658
734
  * @return {Object} Copy of object
735
+ * @private
659
736
  */
660
737
  vjs.obj.copy = function(obj){
661
738
  return vjs.obj.merge({}, obj);
@@ -665,6 +742,7 @@ vjs.obj.copy = function(obj){
665
742
  * Check if an object is plain, and not a dom node or any object sub-instance
666
743
  * @param {Object} obj Object to check
667
744
  * @return {Boolean} True if plain, false otherwise
745
+ * @private
668
746
  */
669
747
  vjs.obj.isPlain = function(obj){
670
748
  return !!obj
@@ -680,6 +758,7 @@ vjs.obj.isPlain = function(obj){
680
758
  * @param {Function} fn The function to be bound to a scope
681
759
  * @param {Number=} uid An optional unique ID for the function to be set
682
760
  * @return {Function}
761
+ * @private
683
762
  */
684
763
  vjs.bind = function(context, fn, uid) {
685
764
  // Make sure the function has a unique ID
@@ -706,12 +785,14 @@ vjs.bind = function(context, fn, uid) {
706
785
  * Ex. Event listneres are stored here.
707
786
  * (also from jsninja.com, slightly modified and updated for closure compiler)
708
787
  * @type {Object}
788
+ * @private
709
789
  */
710
790
  vjs.cache = {};
711
791
 
712
792
  /**
713
793
  * Unique ID for an element or function
714
794
  * @type {Number}
795
+ * @private
715
796
  */
716
797
  vjs.guid = 1;
717
798
 
@@ -719,6 +800,7 @@ vjs.guid = 1;
719
800
  * Unique attribute name to store an element's guid in
720
801
  * @type {String}
721
802
  * @constant
803
+ * @private
722
804
  */
723
805
  vjs.expando = 'vdata' + (new Date()).getTime();
724
806
 
@@ -726,6 +808,7 @@ vjs.expando = 'vdata' + (new Date()).getTime();
726
808
  * Returns the cache object where data for an element is stored
727
809
  * @param {Element} el Element to store data for.
728
810
  * @return {Object}
811
+ * @private
729
812
  */
730
813
  vjs.getData = function(el){
731
814
  var id = el[vjs.expando];
@@ -740,6 +823,7 @@ vjs.getData = function(el){
740
823
  * Returns the cache object where data for an element is stored
741
824
  * @param {Element} el Element to store data for.
742
825
  * @return {Object}
826
+ * @private
743
827
  */
744
828
  vjs.hasData = function(el){
745
829
  var id = el[vjs.expando];
@@ -749,6 +833,7 @@ vjs.hasData = function(el){
749
833
  /**
750
834
  * Delete data for the element from the cache and the guid attr from getElementById
751
835
  * @param {Element} el Remove data for an element
836
+ * @private
752
837
  */
753
838
  vjs.removeData = function(el){
754
839
  var id = el[vjs.expando];
@@ -772,6 +857,12 @@ vjs.removeData = function(el){
772
857
  }
773
858
  };
774
859
 
860
+ /**
861
+ * Check if an object is empty
862
+ * @param {Object} obj The object to check for emptiness
863
+ * @return {Boolean}
864
+ * @private
865
+ */
775
866
  vjs.isEmpty = function(obj) {
776
867
  for (var prop in obj) {
777
868
  // Inlude null properties as empty.
@@ -786,6 +877,7 @@ vjs.isEmpty = function(obj) {
786
877
  * Add a CSS class name to an element
787
878
  * @param {Element} element Element to add class name to
788
879
  * @param {String} classToAdd Classname to add
880
+ * @private
789
881
  */
790
882
  vjs.addClass = function(element, classToAdd){
791
883
  if ((' '+element.className+' ').indexOf(' '+classToAdd+' ') == -1) {
@@ -797,6 +889,7 @@ vjs.addClass = function(element, classToAdd){
797
889
  * Remove a CSS class name from an element
798
890
  * @param {Element} element Element to remove from class name
799
891
  * @param {String} classToAdd Classname to remove
892
+ * @private
800
893
  */
801
894
  vjs.removeClass = function(element, classToRemove){
802
895
  var classNames, i;
@@ -819,6 +912,7 @@ vjs.removeClass = function(element, classToRemove){
819
912
  * Element for testing browser HTML5 video capabilities
820
913
  * @type {Element}
821
914
  * @constant
915
+ * @private
822
916
  */
823
917
  vjs.TEST_VID = vjs.createEl('video');
824
918
 
@@ -826,6 +920,7 @@ vjs.TEST_VID = vjs.createEl('video');
826
920
  * Useragent for browser testing.
827
921
  * @type {String}
828
922
  * @constant
923
+ * @private
829
924
  */
830
925
  vjs.USER_AGENT = navigator.userAgent;
831
926
 
@@ -833,6 +928,7 @@ vjs.USER_AGENT = navigator.userAgent;
833
928
  * Device is an iPhone
834
929
  * @type {Boolean}
835
930
  * @constant
931
+ * @private
836
932
  */
837
933
  vjs.IS_IPHONE = (/iPhone/i).test(vjs.USER_AGENT);
838
934
  vjs.IS_IPAD = (/iPad/i).test(vjs.USER_AGENT);
@@ -873,7 +969,7 @@ vjs.IS_OLD_ANDROID = vjs.IS_ANDROID && (/webkit/i).test(vjs.USER_AGENT) && vjs.A
873
969
  vjs.IS_FIREFOX = (/Firefox/i).test(vjs.USER_AGENT);
874
970
  vjs.IS_CHROME = (/Chrome/i).test(vjs.USER_AGENT);
875
971
 
876
- vjs.TOUCH_ENABLED = ('ontouchstart' in window);
972
+ vjs.TOUCH_ENABLED = !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch);
877
973
 
878
974
  /**
879
975
  * Get an element's attribute values, as defined on the HTML tag
@@ -882,6 +978,7 @@ vjs.TOUCH_ENABLED = ('ontouchstart' in window);
882
978
  * This will return true or false for boolean attributes.
883
979
  * @param {Element} tag Element from which to get tag attributes
884
980
  * @return {Object}
981
+ * @private
885
982
  */
886
983
  vjs.getAttributeValues = function(tag){
887
984
  var obj, knownBooleans, attrs, attrName, attrVal;
@@ -922,6 +1019,7 @@ vjs.getAttributeValues = function(tag){
922
1019
  * @param {Element} el Element to get style value for
923
1020
  * @param {String} strCssRule Style name
924
1021
  * @return {String} Style value
1022
+ * @private
925
1023
  */
926
1024
  vjs.getComputedDimension = function(el, strCssRule){
927
1025
  var strValue = '';
@@ -939,6 +1037,7 @@ vjs.getComputedDimension = function(el, strCssRule){
939
1037
  * Insert an element as the first child node of another
940
1038
  * @param {Element} child Element to insert
941
1039
  * @param {[type]} parent Element to insert child into
1040
+ * @private
942
1041
  */
943
1042
  vjs.insertFirst = function(child, parent){
944
1043
  if (parent.firstChild) {
@@ -951,6 +1050,7 @@ vjs.insertFirst = function(child, parent){
951
1050
  /**
952
1051
  * Object to hold browser support information
953
1052
  * @type {Object}
1053
+ * @private
954
1054
  */
955
1055
  vjs.support = {};
956
1056
 
@@ -959,6 +1059,7 @@ vjs.support = {};
959
1059
  * Also allows for CSS (jQuery) ID syntax. But nothing other than IDs.
960
1060
  * @param {String} id Element ID
961
1061
  * @return {Element} Element with supplied ID
1062
+ * @private
962
1063
  */
963
1064
  vjs.el = function(id){
964
1065
  if (id.indexOf('#') === 0) {
@@ -975,6 +1076,7 @@ vjs.el = function(id){
975
1076
  * @param {Number} seconds Number of seconds to be turned into a string
976
1077
  * @param {Number} guide Number (in seconds) to model the string after
977
1078
  * @return {String} Time formatted as H:MM:SS or M:SS
1079
+ * @private
978
1080
  */
979
1081
  vjs.formatTime = function(seconds, guide) {
980
1082
  // Default to using seconds as guide
@@ -1017,6 +1119,7 @@ vjs.unblockTextSelection = function(){ document.onselectstart = function () { re
1017
1119
  * Trim whitespace from the ends of a string.
1018
1120
  * @param {String} string String to trim
1019
1121
  * @return {String} Trimmed string
1122
+ * @private
1020
1123
  */
1021
1124
  vjs.trim = function(str){
1022
1125
  return (str+'').replace(/^\s+|\s+$/g, '');
@@ -1027,6 +1130,7 @@ vjs.trim = function(str){
1027
1130
  * @param {Number} num Number to round
1028
1131
  * @param {Number} dec Number of decimal places to round to
1029
1132
  * @return {Number} Rounded number
1133
+ * @private
1030
1134
  */
1031
1135
  vjs.round = function(num, dec) {
1032
1136
  if (!dec) { dec = 0; }
@@ -1041,6 +1145,7 @@ vjs.round = function(num, dec) {
1041
1145
  * @param {Number} start Start time in seconds
1042
1146
  * @param {Number} end End time in seconds
1043
1147
  * @return {Object} Fake TimeRange object
1148
+ * @private
1044
1149
  */
1045
1150
  vjs.createTimeRange = function(start, end){
1046
1151
  return {
@@ -1055,6 +1160,7 @@ vjs.createTimeRange = function(start, end){
1055
1160
  * @param {String} url URL of resource
1056
1161
  * @param {Function=} onSuccess Success callback
1057
1162
  * @param {Function=} onError Error callback
1163
+ * @private
1058
1164
  */
1059
1165
  vjs.get = function(url, onSuccess, onError){
1060
1166
  var local, request;
@@ -1098,8 +1204,10 @@ vjs.get = function(url, onSuccess, onError){
1098
1204
  }
1099
1205
  };
1100
1206
 
1101
- /* Local Storage
1102
- ================================================================================ */
1207
+ /**
1208
+ * Add to local storage (may removeable)
1209
+ * @private
1210
+ */
1103
1211
  vjs.setLocalStorage = function(key, value){
1104
1212
  try {
1105
1213
  // IE was throwing errors referencing the var anywhere without this
@@ -1124,6 +1232,7 @@ vjs.setLocalStorage = function(key, value){
1124
1232
  * http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
1125
1233
  * @param {String} url URL to make absolute
1126
1234
  * @return {String} Absolute URL
1235
+ * @private
1127
1236
  */
1128
1237
  vjs.getAbsoluteURL = function(url){
1129
1238
 
@@ -1187,12 +1296,39 @@ vjs.findPosition = function(el) {
1187
1296
 
1188
1297
  /**
1189
1298
  * Base UI Component class
1299
+ *
1300
+ * Components are embeddable UI objects that are represented by both a
1301
+ * javascript object and an element in the DOM. They can be children of other
1302
+ * components, and can have many children themselves.
1303
+ *
1304
+ * // adding a button to the player
1305
+ * var button = player.addChild('button');
1306
+ * button.el(); // -> button element
1307
+ *
1308
+ * <div class="video-js">
1309
+ * <div class="vjs-button">Button</div>
1310
+ * </div>
1311
+ *
1312
+ * Components are also event emitters.
1313
+ *
1314
+ * button.on('click', function(){
1315
+ * console.log('Button Clicked!');
1316
+ * });
1317
+ *
1318
+ * button.trigger('customevent');
1319
+ *
1190
1320
  * @param {Object} player Main Player
1191
1321
  * @param {Object=} options
1322
+ * @class
1192
1323
  * @constructor
1324
+ * @extends vjs.CoreObject
1193
1325
  */
1194
1326
  vjs.Component = vjs.CoreObject.extend({
1195
- /** @constructor */
1327
+ /**
1328
+ * the constructor funciton for the class
1329
+ *
1330
+ * @constructor
1331
+ */
1196
1332
  init: function(player, options, ready){
1197
1333
  this.player_ = player;
1198
1334
 
@@ -1224,7 +1360,7 @@ vjs.Component = vjs.CoreObject.extend({
1224
1360
  });
1225
1361
 
1226
1362
  /**
1227
- * Dispose of the component and all child components.
1363
+ * Dispose of the component and all child components
1228
1364
  */
1229
1365
  vjs.Component.prototype.dispose = function(){
1230
1366
  this.trigger('dispose');
@@ -1256,14 +1392,16 @@ vjs.Component.prototype.dispose = function(){
1256
1392
  };
1257
1393
 
1258
1394
  /**
1259
- * Reference to main player instance.
1395
+ * Reference to main player instance
1396
+ *
1260
1397
  * @type {vjs.Player}
1261
1398
  * @private
1262
1399
  */
1263
- vjs.Component.prototype.player_;
1400
+ vjs.Component.prototype.player_ = true;
1264
1401
 
1265
1402
  /**
1266
- * Return the component's player.
1403
+ * Return the component's player
1404
+ *
1267
1405
  * @return {vjs.Player}
1268
1406
  */
1269
1407
  vjs.Component.prototype.player = function(){
@@ -1271,7 +1409,8 @@ vjs.Component.prototype.player = function(){
1271
1409
  };
1272
1410
 
1273
1411
  /**
1274
- * Component options object.
1412
+ * The component's options object
1413
+ *
1275
1414
  * @type {Object}
1276
1415
  * @private
1277
1416
  */
@@ -1279,6 +1418,7 @@ vjs.Component.prototype.options_;
1279
1418
 
1280
1419
  /**
1281
1420
  * Deep merge of options objects
1421
+ *
1282
1422
  * Whenever a property is an object on both options objects
1283
1423
  * the two properties will be merged using vjs.obj.deepMerge.
1284
1424
  *
@@ -1286,36 +1426,36 @@ vjs.Component.prototype.options_;
1286
1426
  * want it to be easy to override individual options on a child
1287
1427
  * component without having to rewrite all the other default options.
1288
1428
  *
1289
- * Parent.prototype.options_ = {
1290
- * children: {
1291
- * 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
1292
- * 'childTwo': {},
1293
- * 'childThree': {}
1294
- * }
1295
- * }
1296
- * newOptions = {
1297
- * children: {
1298
- * 'childOne': { 'foo': 'baz', 'abc': '123' }
1299
- * 'childTwo': null,
1300
- * 'childFour': {}
1301
- * }
1302
- * }
1303
- *
1304
- * this.options(newOptions);
1429
+ * Parent.prototype.options_ = {
1430
+ * children: {
1431
+ * 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' },
1432
+ * 'childTwo': {},
1433
+ * 'childThree': {}
1434
+ * }
1435
+ * }
1436
+ * newOptions = {
1437
+ * children: {
1438
+ * 'childOne': { 'foo': 'baz', 'abc': '123' }
1439
+ * 'childTwo': null,
1440
+ * 'childFour': {}
1441
+ * }
1442
+ * }
1443
+ *
1444
+ * this.options(newOptions);
1305
1445
  *
1306
1446
  * RESULT
1307
1447
  *
1308
- * {
1309
- * children: {
1310
- * 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
1311
- * 'childTwo': null, // Disabled. Won't be initialized.
1312
- * 'childThree': {},
1313
- * 'childFour': {}
1314
- * }
1315
- * }
1448
+ * {
1449
+ * children: {
1450
+ * 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' },
1451
+ * 'childTwo': null, // Disabled. Won't be initialized.
1452
+ * 'childThree': {},
1453
+ * 'childFour': {}
1454
+ * }
1455
+ * }
1316
1456
  *
1317
1457
  * @param {Object} obj Object whose values will be overwritten
1318
- * @return {Object} NEW merged object. Does not return obj1.
1458
+ * @return {Object} NEW merged object. Does not return obj1.
1319
1459
  */
1320
1460
  vjs.Component.prototype.options = function(obj){
1321
1461
  if (obj === undefined) return this.options_;
@@ -1324,16 +1464,18 @@ vjs.Component.prototype.options = function(obj){
1324
1464
  };
1325
1465
 
1326
1466
  /**
1327
- * The DOM element for the component.
1467
+ * The DOM element for the component
1468
+ *
1328
1469
  * @type {Element}
1329
1470
  * @private
1330
1471
  */
1331
1472
  vjs.Component.prototype.el_;
1332
1473
 
1333
1474
  /**
1334
- * Create the component's DOM element.
1475
+ * Create the component's DOM element
1476
+ *
1335
1477
  * @param {String=} tagName Element's node type. e.g. 'div'
1336
- * @param {Object=} attributes An object of element attributes that should be set on the element.
1478
+ * @param {Object=} attributes An object of element attributes that should be set on the element
1337
1479
  * @return {Element}
1338
1480
  */
1339
1481
  vjs.Component.prototype.createEl = function(tagName, attributes){
@@ -1341,7 +1483,10 @@ vjs.Component.prototype.createEl = function(tagName, attributes){
1341
1483
  };
1342
1484
 
1343
1485
  /**
1344
- * Return the component's DOM element.
1486
+ * Get the component's DOM element
1487
+ *
1488
+ * var domEl = myComponent.el();
1489
+ *
1345
1490
  * @return {Element}
1346
1491
  */
1347
1492
  vjs.Component.prototype.el = function(){
@@ -1349,8 +1494,9 @@ vjs.Component.prototype.el = function(){
1349
1494
  };
1350
1495
 
1351
1496
  /**
1352
- * An optional element where, if defined, children will be inserted
1353
- * instead of directly in el_
1497
+ * An optional element where, if defined, children will be inserted instead of
1498
+ * directly in `el_`
1499
+ *
1354
1500
  * @type {Element}
1355
1501
  * @private
1356
1502
  */
@@ -1358,7 +1504,8 @@ vjs.Component.prototype.contentEl_;
1358
1504
 
1359
1505
  /**
1360
1506
  * Return the component's DOM element for embedding content.
1361
- * will either be el_ or a new element defined in createEl
1507
+ * Will either be el_ or a new element defined in createEl.
1508
+ *
1362
1509
  * @return {Element}
1363
1510
  */
1364
1511
  vjs.Component.prototype.contentEl = function(){
@@ -1366,14 +1513,18 @@ vjs.Component.prototype.contentEl = function(){
1366
1513
  };
1367
1514
 
1368
1515
  /**
1369
- * The ID for the component.
1516
+ * The ID for the component
1517
+ *
1370
1518
  * @type {String}
1371
1519
  * @private
1372
1520
  */
1373
1521
  vjs.Component.prototype.id_;
1374
1522
 
1375
1523
  /**
1376
- * Return the component's ID.
1524
+ * Get the component's ID
1525
+ *
1526
+ * var id = myComponent.id();
1527
+ *
1377
1528
  * @return {String}
1378
1529
  */
1379
1530
  vjs.Component.prototype.id = function(){
@@ -1382,13 +1533,17 @@ vjs.Component.prototype.id = function(){
1382
1533
 
1383
1534
  /**
1384
1535
  * The name for the component. Often used to reference the component.
1536
+ *
1385
1537
  * @type {String}
1386
1538
  * @private
1387
1539
  */
1388
1540
  vjs.Component.prototype.name_;
1389
1541
 
1390
1542
  /**
1391
- * Return the component's ID.
1543
+ * Get the component's name. The name is often used to reference the component.
1544
+ *
1545
+ * var name = myComponent.name();
1546
+ *
1392
1547
  * @return {String}
1393
1548
  */
1394
1549
  vjs.Component.prototype.name = function(){
@@ -1397,14 +1552,18 @@ vjs.Component.prototype.name = function(){
1397
1552
 
1398
1553
  /**
1399
1554
  * Array of child components
1555
+ *
1400
1556
  * @type {Array}
1401
1557
  * @private
1402
1558
  */
1403
1559
  vjs.Component.prototype.children_;
1404
1560
 
1405
1561
  /**
1406
- * Returns array of all child components.
1407
- * @return {Array}
1562
+ * Get an array of all child components
1563
+ *
1564
+ * var kids = myComponent.children();
1565
+ *
1566
+ * @return {Array} The children
1408
1567
  */
1409
1568
  vjs.Component.prototype.children = function(){
1410
1569
  return this.children_;
@@ -1412,40 +1571,64 @@ vjs.Component.prototype.children = function(){
1412
1571
 
1413
1572
  /**
1414
1573
  * Object of child components by ID
1574
+ *
1415
1575
  * @type {Object}
1416
1576
  * @private
1417
1577
  */
1418
1578
  vjs.Component.prototype.childIndex_;
1419
1579
 
1420
1580
  /**
1421
- * Returns a child component with the provided ID.
1422
- * @return {Array}
1581
+ * Returns a child component with the provided ID
1582
+ *
1583
+ * @return {vjs.Component}
1423
1584
  */
1424
1585
  vjs.Component.prototype.getChildById = function(id){
1425
1586
  return this.childIndex_[id];
1426
1587
  };
1427
1588
 
1428
1589
  /**
1429
- * Object of child components by Name
1590
+ * Object of child components by name
1591
+ *
1430
1592
  * @type {Object}
1431
1593
  * @private
1432
1594
  */
1433
1595
  vjs.Component.prototype.childNameIndex_;
1434
1596
 
1435
1597
  /**
1436
- * Returns a child component with the provided ID.
1437
- * @return {Array}
1598
+ * Returns a child component with the provided ID
1599
+ *
1600
+ * @return {vjs.Component}
1438
1601
  */
1439
1602
  vjs.Component.prototype.getChild = function(name){
1440
1603
  return this.childNameIndex_[name];
1441
1604
  };
1442
1605
 
1443
1606
  /**
1444
- * Adds a child component inside this component.
1445
- * @param {String|vjs.Component} child The class name or instance of a child to add.
1446
- * @param {Object=} options Optional options, including options to be passed to
1447
- * children of the child.
1448
- * @return {vjs.Component} The child component, because it might be created in this process.
1607
+ * Adds a child component inside this component
1608
+ *
1609
+ * myComponent.el();
1610
+ * // -> <div class='my-component'></div>
1611
+ * myComonent.children();
1612
+ * // [empty array]
1613
+ *
1614
+ * var myButton = myComponent.addChild('MyButton');
1615
+ * // -> <div class='my-component'><div class="my-button">myButton<div></div>
1616
+ * // -> myButton === myComonent.children()[0];
1617
+ *
1618
+ * Pass in options for child constructors and options for children of the child
1619
+ *
1620
+ * var myButton = myComponent.addChild('MyButton', {
1621
+ * text: 'Press Me',
1622
+ * children: {
1623
+ * buttonChildExample: {
1624
+ * buttonChildOption: true
1625
+ * }
1626
+ * }
1627
+ * });
1628
+ *
1629
+ * @param {String|vjs.Component} child The class name or instance of a child to add
1630
+ * @param {Object=} options Options, including options to be passed to children of the child.
1631
+ * @return {vjs.Component} The child component (created by this process if a string was used)
1449
1632
  * @suppress {accessControls|checkRegExp|checkTypes|checkVars|const|constantProperty|deprecated|duplicate|es5Strict|fileoverviewTags|globalThis|invalidCasts|missingProperties|nonStandardJsDocs|strictModuleDepCheck|undefinedNames|undefinedVars|unknownDefines|uselessCode|visibility}
1450
1633
  */
1451
1634
  vjs.Component.prototype.addChild = function(child, options){
@@ -1500,6 +1683,12 @@ vjs.Component.prototype.addChild = function(child, options){
1500
1683
  return component;
1501
1684
  };
1502
1685
 
1686
+ /**
1687
+ * Remove a child component from this component's list of children, and the
1688
+ * child component's element from this component's element
1689
+ *
1690
+ * @param {vjs.Component} component Component to remove
1691
+ */
1503
1692
  vjs.Component.prototype.removeChild = function(component){
1504
1693
  if (typeof component === 'string') {
1505
1694
  component = this.getChild(component);
@@ -1528,7 +1717,15 @@ vjs.Component.prototype.removeChild = function(component){
1528
1717
  };
1529
1718
 
1530
1719
  /**
1531
- * Initialize default child components from options
1720
+ * Add and initialize default child components from options
1721
+ *
1722
+ * // when an instance of MyComponent is created, all children in options
1723
+ * // will be added to the instance by their name strings and options
1724
+ * MyComponent.prototype.options_.children = {
1725
+ * myChildComponent: {
1726
+ * myChildOption: true
1727
+ * }
1728
+ * }
1532
1729
  */
1533
1730
  vjs.Component.prototype.initChildren = function(){
1534
1731
  var options = this.options_;
@@ -1557,6 +1754,11 @@ vjs.Component.prototype.initChildren = function(){
1557
1754
  }
1558
1755
  };
1559
1756
 
1757
+ /**
1758
+ * Allows sub components to stack CSS class names
1759
+ *
1760
+ * @return {String} The constructed class name
1761
+ */
1560
1762
  vjs.Component.prototype.buildCSSClass = function(){
1561
1763
  // Child classes can include a function that does:
1562
1764
  // return 'CLASS NAME' + this._super();
@@ -1567,10 +1769,20 @@ vjs.Component.prototype.buildCSSClass = function(){
1567
1769
  ============================================================================= */
1568
1770
 
1569
1771
  /**
1570
- * Add an event listener to this component's element. Context will be the component.
1571
- * @param {String} type Event type e.g. 'click'
1572
- * @param {Function} fn Event listener
1573
- * @return {vjs.Component}
1772
+ * Add an event listener to this component's element
1773
+ *
1774
+ * var myFunc = function(){
1775
+ * var myPlayer = this;
1776
+ * // Do something when the event is fired
1777
+ * };
1778
+ *
1779
+ * myPlayer.on("eventName", myFunc);
1780
+ *
1781
+ * The context will be the component.
1782
+ *
1783
+ * @param {String} type The event type e.g. 'click'
1784
+ * @param {Function} fn The event listener
1785
+ * @return {vjs.Component} self
1574
1786
  */
1575
1787
  vjs.Component.prototype.on = function(type, fn){
1576
1788
  vjs.on(this.el_, type, vjs.bind(this, fn));
@@ -1579,8 +1791,11 @@ vjs.Component.prototype.on = function(type, fn){
1579
1791
 
1580
1792
  /**
1581
1793
  * Remove an event listener from the component's element
1582
- * @param {String=} type Optional event type. Without type it will remove all listeners.
1583
- * @param {Function=} fn Optional event listener. Without fn it will remove all listeners for a type.
1794
+ *
1795
+ * myComponent.off("eventName", myFunc);
1796
+ *
1797
+ * @param {String=} type Event type. Without type it will remove all listeners.
1798
+ * @param {Function=} fn Event listener. Without fn it will remove all listeners for a type.
1584
1799
  * @return {vjs.Component}
1585
1800
  */
1586
1801
  vjs.Component.prototype.off = function(type, fn){
@@ -1590,6 +1805,7 @@ vjs.Component.prototype.off = function(type, fn){
1590
1805
 
1591
1806
  /**
1592
1807
  * Add an event listener to be triggered only once and then removed
1808
+ *
1593
1809
  * @param {String} type Event type
1594
1810
  * @param {Function} fn Event listener
1595
1811
  * @return {vjs.Component}
@@ -1601,9 +1817,12 @@ vjs.Component.prototype.one = function(type, fn) {
1601
1817
 
1602
1818
  /**
1603
1819
  * Trigger an event on an element
1604
- * @param {String} type Event type to trigger
1605
- * @param {Event|Object} event Event object to be passed to the listener
1606
- * @return {vjs.Component}
1820
+ *
1821
+ * myComponent.trigger('eventName');
1822
+ *
1823
+ * @param {String} type The event type to trigger, e.g. 'click'
1824
+ * @param {Event|Object} event The event object to be passed to the listener
1825
+ * @return {vjs.Component} self
1607
1826
  */
1608
1827
  vjs.Component.prototype.trigger = function(type, event){
1609
1828
  vjs.trigger(this.el_, type, event);
@@ -1613,33 +1832,40 @@ vjs.Component.prototype.trigger = function(type, event){
1613
1832
  /* Ready
1614
1833
  ================================================================================ */
1615
1834
  /**
1616
- * Is the component loaded.
1617
- * @type {Boolean}
1835
+ * Is the component loaded
1836
+ * This can mean different things depending on the component.
1837
+ *
1618
1838
  * @private
1839
+ * @type {Boolean}
1619
1840
  */
1620
1841
  vjs.Component.prototype.isReady_;
1621
1842
 
1622
1843
  /**
1623
- * Trigger ready as soon as initialization is finished.
1624
- * Allows for delaying ready. Override on a sub class prototype.
1625
- * If you set this.isReadyOnInitFinish_ it will affect all components.
1626
- * Specially used when waiting for the Flash player to asynchrnously load.
1627
- * @type {Boolean}
1628
- * @private
1844
+ * Trigger ready as soon as initialization is finished
1845
+ *
1846
+ * Allows for delaying ready. Override on a sub class prototype.
1847
+ * If you set this.isReadyOnInitFinish_ it will affect all components.
1848
+ * Specially used when waiting for the Flash player to asynchrnously load.
1849
+ *
1850
+ * @type {Boolean}
1851
+ * @private
1629
1852
  */
1630
1853
  vjs.Component.prototype.isReadyOnInitFinish_ = true;
1631
1854
 
1632
1855
  /**
1633
1856
  * List of ready listeners
1857
+ *
1634
1858
  * @type {Array}
1635
1859
  * @private
1636
1860
  */
1637
1861
  vjs.Component.prototype.readyQueue_;
1638
1862
 
1639
1863
  /**
1640
- * Bind a listener to the component's ready state.
1641
- * Different from event listeners in that if the ready event has already happend
1642
- * it will trigger the function immediately.
1864
+ * Bind a listener to the component's ready state
1865
+ *
1866
+ * Different from event listeners in that if the ready event has already happend
1867
+ * it will trigger the function immediately.
1868
+ *
1643
1869
  * @param {Function} fn Ready listener
1644
1870
  * @return {vjs.Component}
1645
1871
  */
@@ -1659,6 +1885,7 @@ vjs.Component.prototype.ready = function(fn){
1659
1885
 
1660
1886
  /**
1661
1887
  * Trigger the ready listeners
1888
+ *
1662
1889
  * @return {vjs.Component}
1663
1890
  */
1664
1891
  vjs.Component.prototype.triggerReady = function(){
@@ -1685,6 +1912,7 @@ vjs.Component.prototype.triggerReady = function(){
1685
1912
 
1686
1913
  /**
1687
1914
  * Add a CSS class name to the component's element
1915
+ *
1688
1916
  * @param {String} classToAdd Classname to add
1689
1917
  * @return {vjs.Component}
1690
1918
  */
@@ -1695,6 +1923,7 @@ vjs.Component.prototype.addClass = function(classToAdd){
1695
1923
 
1696
1924
  /**
1697
1925
  * Remove a CSS class name from the component's element
1926
+ *
1698
1927
  * @param {String} classToRemove Classname to remove
1699
1928
  * @return {vjs.Component}
1700
1929
  */
@@ -1705,6 +1934,7 @@ vjs.Component.prototype.removeClass = function(classToRemove){
1705
1934
 
1706
1935
  /**
1707
1936
  * Show the component element if hidden
1937
+ *
1708
1938
  * @return {vjs.Component}
1709
1939
  */
1710
1940
  vjs.Component.prototype.show = function(){
@@ -1714,6 +1944,7 @@ vjs.Component.prototype.show = function(){
1714
1944
 
1715
1945
  /**
1716
1946
  * Hide the component element if hidden
1947
+ *
1717
1948
  * @return {vjs.Component}
1718
1949
  */
1719
1950
  vjs.Component.prototype.hide = function(){
@@ -1722,8 +1953,11 @@ vjs.Component.prototype.hide = function(){
1722
1953
  };
1723
1954
 
1724
1955
  /**
1725
- * Lock an item in its visible state. To be used with fadeIn/fadeOut.
1956
+ * Lock an item in its visible state
1957
+ * To be used with fadeIn/fadeOut.
1958
+ *
1726
1959
  * @return {vjs.Component}
1960
+ * @private
1727
1961
  */
1728
1962
  vjs.Component.prototype.lockShowing = function(){
1729
1963
  this.addClass('vjs-lock-showing');
@@ -1731,8 +1965,11 @@ vjs.Component.prototype.lockShowing = function(){
1731
1965
  };
1732
1966
 
1733
1967
  /**
1734
- * Unlock an item to be hidden. To be used with fadeIn/fadeOut.
1968
+ * Unlock an item to be hidden
1969
+ * To be used with fadeIn/fadeOut.
1970
+ *
1735
1971
  * @return {vjs.Component}
1972
+ * @private
1736
1973
  */
1737
1974
  vjs.Component.prototype.unlockShowing = function(){
1738
1975
  this.removeClass('vjs-lock-showing');
@@ -1748,35 +1985,38 @@ vjs.Component.prototype.disable = function(){
1748
1985
  };
1749
1986
 
1750
1987
  /**
1751
- * If a value is provided it will change the width of the player to that value
1752
- * otherwise the width is returned
1753
- * http://dev.w3.org/html5/spec/dimension-attributes.html#attr-dim-height
1988
+ * Set or get the width of the component (CSS values)
1989
+ *
1754
1990
  * Video tag width/height only work in pixels. No percents.
1755
1991
  * But allowing limited percents use. e.g. width() will return number+%, not computed width
1992
+ *
1756
1993
  * @param {Number|String=} num Optional width number
1757
- * @param {[type]} skipListeners Skip the 'resize' event trigger
1758
- * @return {vjs.Component|Number|String} Returns 'this' if dimension was set.
1759
- * Otherwise it returns the dimension.
1994
+ * @param {Boolean} skipListeners Skip the 'resize' event trigger
1995
+ * @return {vjs.Component} Returns 'this' if width was set
1996
+ * @return {Number|String} Returns the width if nothing was set
1760
1997
  */
1761
1998
  vjs.Component.prototype.width = function(num, skipListeners){
1762
1999
  return this.dimension('width', num, skipListeners);
1763
2000
  };
1764
2001
 
1765
2002
  /**
1766
- * Get or set the height of the player
1767
- * @param {Number|String=} num Optional new player height
1768
- * @param {Boolean=} skipListeners Optional skip resize event trigger
1769
- * @return {vjs.Component|Number|String} The player, or the dimension
2003
+ * Get or set the height of the component (CSS values)
2004
+ *
2005
+ * @param {Number|String=} num New component height
2006
+ * @param {Boolean=} skipListeners Skip the resize event trigger
2007
+ * @return {vjs.Component} The component if the height was set
2008
+ * @return {Number|String} The height if it wasn't set
1770
2009
  */
1771
2010
  vjs.Component.prototype.height = function(num, skipListeners){
1772
2011
  return this.dimension('height', num, skipListeners);
1773
2012
  };
1774
2013
 
1775
2014
  /**
1776
- * Set both width and height at the same time.
2015
+ * Set both width and height at the same time
2016
+ *
1777
2017
  * @param {Number|String} width
1778
2018
  * @param {Number|String} height
1779
- * @return {vjs.Component} The player.
2019
+ * @return {vjs.Component} The component
1780
2020
  */
1781
2021
  vjs.Component.prototype.dimensions = function(width, height){
1782
2022
  // Skip resize listeners on width for optimization
@@ -1784,18 +2024,22 @@ vjs.Component.prototype.dimensions = function(width, height){
1784
2024
  };
1785
2025
 
1786
2026
  /**
1787
- * Get or set width or height.
2027
+ * Get or set width or height
2028
+ *
2029
+ * This is the shared code for the width() and height() methods.
1788
2030
  * All for an integer, integer + 'px' or integer + '%';
1789
- * Known issue: hidden elements. Hidden elements officially have a width of 0.
1790
- * So we're defaulting to the style.width value and falling back to computedStyle
1791
- * which has the hidden element issue.
1792
- * Info, but probably not an efficient fix:
2031
+ *
2032
+ * Known issue: Hidden elements officially have a width of 0. We're defaulting
2033
+ * to the style.width value and falling back to computedStyle which has the
2034
+ * hidden element issue. Info, but probably not an efficient fix:
1793
2035
  * http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/
1794
- * @param {String=} widthOrHeight 'width' or 'height'
1795
- * @param {Number|String=} num New dimension
2036
+ *
2037
+ * @param {String} widthOrHeight 'width' or 'height'
2038
+ * @param {Number|String=} num New dimension
1796
2039
  * @param {Boolean=} skipListeners Skip resize event trigger
1797
- * @return {vjs.Component|Number|String} Return the player if setting a dimension.
1798
- * Otherwise it returns the dimension.
2040
+ * @return {vjs.Component} The component if a dimension was set
2041
+ * @return {Number|String} The dimension if nothing was set
2042
+ * @private
1799
2043
  */
1800
2044
  vjs.Component.prototype.dimension = function(widthOrHeight, num, skipListeners){
1801
2045
  if (num !== undefined) {
@@ -1850,12 +2094,20 @@ vjs.Component.prototype.dimension = function(widthOrHeight, num, skipListeners){
1850
2094
  };
1851
2095
 
1852
2096
  /**
1853
- * Emit 'tap' events when touch events are supported. We're requireing them to
1854
- * be enabled because otherwise every component would have this extra overhead
1855
- * unnecessarily, on mobile devices where extra overhead is especially bad.
2097
+ * Fired when the width and/or height of the component changes
2098
+ * @event resize
2099
+ */
2100
+ vjs.Component.prototype.onResize;
2101
+
2102
+ /**
2103
+ * Emit 'tap' events when touch events are supported
2104
+ *
2105
+ * This is used to support toggling the controls through a tap on the video.
1856
2106
  *
1857
- * This is being implemented so we can support taps on the video element
1858
- * toggling the controls.
2107
+ * We're requireing them to be enabled because otherwise every component would
2108
+ * have this extra overhead unnecessarily, on mobile devices where extra
2109
+ * overhead is especially bad.
2110
+ * @private
1859
2111
  */
1860
2112
  vjs.Component.prototype.emitTapEvents = function(){
1861
2113
  var touchStart, touchTime, couldBeTap, noTap;
@@ -1901,10 +2153,14 @@ vjs.Component.prototype.emitTapEvents = function(){
1901
2153
  * Base class for all buttons
1902
2154
  * @param {vjs.Player|Object} player
1903
2155
  * @param {Object=} options
2156
+ * @class
1904
2157
  * @constructor
1905
2158
  */
1906
2159
  vjs.Button = vjs.Component.extend({
1907
- /** @constructor */
2160
+ /**
2161
+ * @constructor
2162
+ * @inheritDoc
2163
+ */
1908
2164
  init: function(player, options){
1909
2165
  vjs.Component.call(this, player, options);
1910
2166
 
@@ -1973,7 +2229,8 @@ vjs.Button.prototype.onBlur = function(){
1973
2229
  /* Slider
1974
2230
  ================================================================================ */
1975
2231
  /**
1976
- * Parent for seek bar and volume slider
2232
+ * The base functionality for sliders like the volume bar and seek bar
2233
+ *
1977
2234
  * @param {vjs.Player|Object} player
1978
2235
  * @param {Object=} options
1979
2236
  * @constructor
@@ -2184,7 +2441,9 @@ vjs.SliderHandle = vjs.Component.extend();
2184
2441
 
2185
2442
  /**
2186
2443
  * Default value of the slider
2444
+ *
2187
2445
  * @type {Number}
2446
+ * @private
2188
2447
  */
2189
2448
  vjs.SliderHandle.prototype.defaultValue = 0;
2190
2449
 
@@ -2202,9 +2461,12 @@ vjs.SliderHandle.prototype.createEl = function(type, props) {
2202
2461
  /* Menu
2203
2462
  ================================================================================ */
2204
2463
  /**
2205
- * The base for text track and settings menu buttons.
2464
+ * The Menu component is used to build pop up menus, including subtitle and
2465
+ * captions selection menus.
2466
+ *
2206
2467
  * @param {vjs.Player|Object} player
2207
2468
  * @param {Object=} options
2469
+ * @class
2208
2470
  * @constructor
2209
2471
  */
2210
2472
  vjs.Menu = vjs.Component.extend();
@@ -2243,9 +2505,11 @@ vjs.Menu.prototype.createEl = function(){
2243
2505
  };
2244
2506
 
2245
2507
  /**
2246
- * Menu item
2508
+ * The component for a menu item. `<li>`
2509
+ *
2247
2510
  * @param {vjs.Player|Object} player
2248
2511
  * @param {Object=} options
2512
+ * @class
2249
2513
  * @constructor
2250
2514
  */
2251
2515
  vjs.MenuItem = vjs.Button.extend({
@@ -2264,7 +2528,9 @@ vjs.MenuItem.prototype.createEl = function(type, props){
2264
2528
  }, props));
2265
2529
  };
2266
2530
 
2267
- /** @inheritDoc */
2531
+ /**
2532
+ * Handle a click on the menu item, and set it to selected
2533
+ */
2268
2534
  vjs.MenuItem.prototype.onClick = function(){
2269
2535
  this.selected(true);
2270
2536
  };
@@ -2314,6 +2580,7 @@ vjs.MenuButton = vjs.Button.extend({
2314
2580
  /**
2315
2581
  * Track the state of the menu button
2316
2582
  * @type {Boolean}
2583
+ * @private
2317
2584
  */
2318
2585
  vjs.MenuButton.prototype.buttonPressed_ = false;
2319
2586
 
@@ -2408,14 +2675,36 @@ vjs.MenuButton.prototype.unpressButton = function(){
2408
2675
  };
2409
2676
 
2410
2677
  /**
2411
- * Main player class. A player instance is returned by _V_(id);
2412
- * @param {Element} tag The original video tag used for configuring options
2413
- * @param {Object=} options Player options
2414
- * @param {Function=} ready Ready callback function
2415
- * @constructor
2678
+ * An instance of the `vjs.Player` class is created when any of the Video.js setup methods are used to initialize a video.
2679
+ *
2680
+ * ```js
2681
+ * var myPlayer = videojs('example_video_1');
2682
+ * ```
2683
+ *
2684
+ * In the follwing example, the `data-setup` attribute tells the Video.js library to create a player instance when the library is ready.
2685
+ *
2686
+ * ```html
2687
+ * <video id="example_video_1" data-setup='{}' controls>
2688
+ * <source src="my-source.mp4" type="video/mp4">
2689
+ * </video>
2690
+ * ```
2691
+ *
2692
+ * After an instance has been created it can be accessed globally using `Video('example_video_1')`.
2693
+ *
2694
+ * @class
2695
+ * @extends vjs.Component
2416
2696
  */
2417
2697
  vjs.Player = vjs.Component.extend({
2418
- /** @constructor */
2698
+
2699
+ /**
2700
+ * player's constructor function
2701
+ *
2702
+ * @constructs
2703
+ * @method init
2704
+ * @param {Element} tag The original video tag used for configuring options
2705
+ * @param {Object=} options Player options
2706
+ * @param {Function=} ready Ready callback function
2707
+ */
2419
2708
  init: function(tag, options, ready){
2420
2709
  this.tag = tag; // Store the original tag used to set options
2421
2710
 
@@ -2504,6 +2793,14 @@ vjs.Player = vjs.Component.extend({
2504
2793
  */
2505
2794
  vjs.Player.prototype.options_ = vjs.options;
2506
2795
 
2796
+ /**
2797
+ * Destroys the video player and does any necessary cleanup
2798
+ *
2799
+ * myPlayer.dispose();
2800
+ *
2801
+ * This is especially helpful if you are dynamically adding and removing videos
2802
+ * to/from the DOM.
2803
+ */
2507
2804
  vjs.Player.prototype.dispose = function(){
2508
2805
  this.trigger('dispose');
2509
2806
  // prevent dispose from being called twice
@@ -2741,7 +3038,7 @@ vjs.Player.prototype.trackProgress = function(){
2741
3038
  };
2742
3039
  vjs.Player.prototype.stopTrackingProgress = function(){ clearInterval(this.progressInterval); };
2743
3040
 
2744
- /* Time Tracking -------------------------------------------------------------- */
3041
+ /*! Time Tracking -------------------------------------------------------------- */
2745
3042
  vjs.Player.prototype.manualTimeUpdatesOn = function(){
2746
3043
  this.manualTimeUpdates = true;
2747
3044
 
@@ -2777,18 +3074,49 @@ vjs.Player.prototype.stopTrackingCurrentTime = function(){ clearInterval(this.cu
2777
3074
 
2778
3075
  // /* Player event handlers (how the player reacts to certain events)
2779
3076
  // ================================================================================ */
2780
- vjs.Player.prototype.onEnded = function(){
2781
- if (this.options_['loop']) {
2782
- this.currentTime(0);
2783
- this.play();
2784
- }
2785
- };
2786
3077
 
3078
+ /**
3079
+ * Fired when the user agent begins looking for media data
3080
+ * @event loadstart
3081
+ */
3082
+ vjs.Player.prototype.onLoadStart;
3083
+
3084
+ /**
3085
+ * Fired when the player has initial duration and dimension information
3086
+ * @event loadedmetadata
3087
+ */
3088
+ vjs.Player.prototype.onLoadedMetaData;
3089
+
3090
+ /**
3091
+ * Fired when the player has downloaded data at the current playback position
3092
+ * @event loadeddata
3093
+ */
3094
+ vjs.Player.prototype.onLoadedData;
3095
+
3096
+ /**
3097
+ * Fired when the player has finished downloading the source data
3098
+ * @event loadedalldata
3099
+ */
3100
+ vjs.Player.prototype.onLoadedAllData;
3101
+
3102
+ /**
3103
+ * Fired whenever the media begins or resumes playback
3104
+ * @event play
3105
+ */
2787
3106
  vjs.Player.prototype.onPlay = function(){
2788
3107
  vjs.removeClass(this.el_, 'vjs-paused');
2789
3108
  vjs.addClass(this.el_, 'vjs-playing');
2790
3109
  };
2791
3110
 
3111
+ /**
3112
+ * Fired the first time a video is played
3113
+ *
3114
+ * Not part of the HLS spec, and we're not sure if this is the best
3115
+ * implementation yet, so use sparingly. If you don't have a reason to
3116
+ * prevent playback, use `myPlayer.one('play');` instead.
3117
+ *
3118
+ * @event firstplay
3119
+ */
2792
3120
  vjs.Player.prototype.onFirstPlay = function(){
2793
3121
  //If the first starttime attribute is specified
2794
3122
  //then we will start at the given offset in seconds
@@ -2799,11 +3127,28 @@ vjs.Player.prototype.onFirstPlay = function(){
2799
3127
  this.addClass('vjs-has-started');
2800
3128
  };
2801
3129
 
3130
+ /**
3131
+ * Fired whenever the media has been paused
3132
+ * @event pause
3133
+ */
2802
3134
  vjs.Player.prototype.onPause = function(){
2803
3135
  vjs.removeClass(this.el_, 'vjs-playing');
2804
3136
  vjs.addClass(this.el_, 'vjs-paused');
2805
3137
  };
2806
3138
 
3139
+ /**
3140
+ * Fired when the current playback position has changed
3141
+ *
3142
+ * During playback this is fired every 15-250 milliseconds, depnding on the
3143
+ * playback technology in use.
3144
+ * @event timeupdate
3145
+ */
3146
+ vjs.Player.prototype.onTimeUpdate;
3147
+
3148
+ /**
3149
+ * Fired while the user agent is downloading media data
3150
+ * @event progress
3151
+ */
2807
3152
  vjs.Player.prototype.onProgress = function(){
2808
3153
  // Add custom event for when source is finished downloading.
2809
3154
  if (this.bufferedPercent() == 1) {
@@ -2811,16 +3156,36 @@ vjs.Player.prototype.onProgress = function(){
2811
3156
  }
2812
3157
  };
2813
3158
 
2814
- // Update duration with durationchange event
2815
- // Allows for cacheing value instead of asking player each time.
3159
+ /**
3160
+ * Fired when the end of the media resource is reached (currentTime == duration)
3161
+ * @event ended
3162
+ */
3163
+ vjs.Player.prototype.onEnded = function(){
3164
+ if (this.options_['loop']) {
3165
+ this.currentTime(0);
3166
+ this.play();
3167
+ }
3168
+ };
3169
+
3170
+ /**
3171
+ * Fired when the duration of the media resource is first known or changed
3172
+ * @event durationchange
3173
+ */
2816
3174
  vjs.Player.prototype.onDurationChange = function(){
3175
+ // Allows for cacheing value instead of asking player each time.
2817
3176
  this.duration(this.techGet('duration'));
2818
3177
  };
2819
3178
 
2820
- vjs.Player.prototype.onError = function(e) {
2821
- vjs.log('Video Error', e);
2822
- };
3179
+ /**
3180
+ * Fired when the volume changes
3181
+ * @event volumechange
3182
+ */
3183
+ vjs.Player.prototype.onVolumeChange;
2823
3184
 
3185
+ /**
3186
+ * Fired when the player switches in or out of fullscreen mode
3187
+ * @event fullscreenchange
3188
+ */
2824
3189
  vjs.Player.prototype.onFullscreenChange = function() {
2825
3190
  if (this.isFullScreen) {
2826
3191
  this.addClass('vjs-fullscreen');
@@ -2829,6 +3194,14 @@ vjs.Player.prototype.onFullscreenChange = function() {
2829
3194
  }
2830
3195
  };
2831
3196
 
3197
+ /**
3198
+ * Fired when there is an error in playback
3199
+ * @event error
3200
+ */
3201
+ vjs.Player.prototype.onError = function(e) {
3202
+ vjs.log('Video Error', e);
3203
+ };
3204
+
2832
3205
  // /* Player API
2833
3206
  // ================================================================================ */
2834
3207
 
@@ -2892,55 +3265,89 @@ vjs.Player.prototype.techGet = function(method){
2892
3265
  };
2893
3266
 
2894
3267
  /**
2895
- * Start media playback
2896
- * http://dev.w3.org/html5/spec/video.html#dom-media-play
2897
- * We're triggering the 'play' event here instead of relying on the
2898
- * media element to allow using event.preventDefault() to stop
2899
- * play from happening if desired. Usecase: preroll ads.
3268
+ * start media playback
3269
+ *
3270
+ * myPlayer.play();
3271
+ *
3272
+ * @return {vjs.Player} self
2900
3273
  */
2901
3274
  vjs.Player.prototype.play = function(){
2902
3275
  this.techCall('play');
2903
3276
  return this;
2904
3277
  };
2905
3278
 
2906
- // http://dev.w3.org/html5/spec/video.html#dom-media-pause
3279
+ /**
3280
+ * Pause the video playback
3281
+ *
3282
+ * myPlayer.pause();
3283
+ *
3284
+ * @return {vjs.Player} self
3285
+ */
2907
3286
  vjs.Player.prototype.pause = function(){
2908
3287
  this.techCall('pause');
2909
3288
  return this;
2910
3289
  };
2911
3290
 
2912
- // http://dev.w3.org/html5/spec/video.html#dom-media-paused
2913
- // The initial state of paused should be true (in Safari it's actually false)
3291
+ /**
3292
+ * Check if the player is paused
3293
+ *
3294
+ * var isPaused = myPlayer.paused();
3295
+ * var isPlaying = !myPlayer.paused();
3296
+ *
3297
+ * @return {Boolean} false if the media is currently playing, or true otherwise
3298
+ */
2914
3299
  vjs.Player.prototype.paused = function(){
3300
+ // The initial state of paused should be true (in Safari it's actually false)
2915
3301
  return (this.techGet('paused') === false) ? false : true;
2916
3302
  };
2917
3303
 
2918
- // http://dev.w3.org/html5/spec/video.html#dom-media-currenttime
3304
+ /**
3305
+ * Get or set the current time (in seconds)
3306
+ *
3307
+ * // get
3308
+ * var whereYouAt = myPlayer.currentTime();
3309
+ *
3310
+ * // set
3311
+ * myPlayer.currentTime(120); // 2 minutes into the video
3312
+ *
3313
+ * @param {Number|String=} seconds The time to seek to
3314
+ * @return {Number} The time in seconds, when not setting
3315
+ * @return {vjs.Player} self, when the current time is set
3316
+ */
2919
3317
  vjs.Player.prototype.currentTime = function(seconds){
2920
3318
  if (seconds !== undefined) {
2921
3319
 
2922
- // Cache the last set value for smoother scrubbing.
3320
+ // cache the last set value for smoother scrubbing
2923
3321
  this.cache_.lastSetCurrentTime = seconds;
2924
3322
 
2925
3323
  this.techCall('setCurrentTime', seconds);
2926
3324
 
2927
- // Improve the accuracy of manual timeupdates
3325
+ // improve the accuracy of manual timeupdates
2928
3326
  if (this.manualTimeUpdates) { this.trigger('timeupdate'); }
2929
3327
 
2930
3328
  return this;
2931
3329
  }
2932
3330
 
2933
- // Cache last currentTime and return
2934
- // Default to 0 seconds
3331
+ // cache last currentTime and return
3332
+ // default to 0 seconds
2935
3333
  return this.cache_.currentTime = (this.techGet('currentTime') || 0);
2936
3334
  };
2937
3335
 
2938
- // http://dev.w3.org/html5/spec/video.html#dom-media-duration
2939
- // Duration should return NaN if not available. ParseFloat will turn false-ish values to NaN.
3336
+ /**
3337
+ * Get the length in time of the video in seconds
3338
+ *
3339
+ * var lengthOfVideo = myPlayer.duration();
3340
+ *
3341
+ * **NOTE**: The video must have started loading before the duration can be
3342
+ * known, and in the case of Flash, may not be known until the video starts
3343
+ * playing.
3344
+ *
3345
+ * @return {Number} The duration of the video in seconds
3346
+ */
2940
3347
  vjs.Player.prototype.duration = function(seconds){
2941
3348
  if (seconds !== undefined) {
2942
3349
 
2943
- // Cache the last set value for optimiized scrubbing (esp. Flash)
3350
+ // cache the last set value for optimiized scrubbing (esp. Flash)
2944
3351
  this.cache_.duration = parseFloat(seconds);
2945
3352
 
2946
3353
  return this;
@@ -2962,6 +3369,27 @@ vjs.Player.prototype.remainingTime = function(){
2962
3369
  // Buffered returns a timerange object.
2963
3370
  // Kind of like an array of portions of the video that have been downloaded.
2964
3371
  // So far no browsers return more than one range (portion)
3372
+
3373
+ /**
3374
+ * Get a TimeRange object with the times of the video that have been downloaded
3375
+ *
3376
+ * If you just want the percent of the video that's been downloaded,
3377
+ * use bufferedPercent.
3378
+ *
3379
+ * // Number of different ranges of time have been buffered. Usually 1.
3380
+ * numberOfRanges = bufferedTimeRange.length,
3381
+ *
3382
+ * // Time in seconds when the first range starts. Usually 0.
3383
+ * firstRangeStart = bufferedTimeRange.start(0),
3384
+ *
3385
+ * // Time in seconds when the first range ends
3386
+ * firstRangeEnd = bufferedTimeRange.end(0),
3387
+ *
3388
+ * // Length in seconds of the first time range
3389
+ * firstRangeLength = firstRangeEnd - firstRangeStart;
3390
+ *
3391
+ * @return {Object} A mock TimeRange object (following HTML spec)
3392
+ */
2965
3393
  vjs.Player.prototype.buffered = function(){
2966
3394
  var buffered = this.techGet('buffered'),
2967
3395
  start = 0,
@@ -2978,12 +3406,35 @@ vjs.Player.prototype.buffered = function(){
2978
3406
  return vjs.createTimeRange(start, end);
2979
3407
  };
2980
3408
 
2981
- // Calculates amount of buffer is full. Not in spec but useful.
3409
+ /**
3410
+ * Get the percent (as a decimal) of the video that's been downloaded
3411
+ *
3412
+ * var howMuchIsDownloaded = myPlayer.bufferedPercent();
3413
+ *
3414
+ * 0 means none, 1 means all.
3415
+ * (This method isn't in the HTML5 spec, but it's very convenient)
3416
+ *
3417
+ * @return {Number} A decimal between 0 and 1 representing the percent
3418
+ */
2982
3419
  vjs.Player.prototype.bufferedPercent = function(){
2983
3420
  return (this.duration()) ? this.buffered().end(0) / this.duration() : 0;
2984
3421
  };
2985
3422
 
2986
- // http://dev.w3.org/html5/spec/video.html#dom-media-volume
3423
+ /**
3424
+ * Get or set the current volume of the media
3425
+ *
3426
+ * // get
3427
+ * var howLoudIsIt = myPlayer.volume();
3428
+ *
3429
+ * // set
3430
+ * myPlayer.volume(0.5); // Set volume to half
3431
+ *
3432
+ * 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
3433
+ *
3434
+ * @param {Number} percentAsDecimal The new volume as a decimal percent
3435
+ * @return {Number} The current volume, when getting
3436
+ * @return {vjs.Player} self, when setting
3437
+ */
2987
3438
  vjs.Player.prototype.volume = function(percentAsDecimal){
2988
3439
  var vol;
2989
3440
 
@@ -3000,7 +3451,20 @@ vjs.Player.prototype.volume = function(percentAsDecimal){
3000
3451
  return (isNaN(vol)) ? 1 : vol;
3001
3452
  };
3002
3453
 
3003
- // http://dev.w3.org/html5/spec/video.html#attr-media-muted
3454
+
3455
+ /**
3456
+ * Get the current muted state, or turn mute on or off
3457
+ *
3458
+ * // get
3459
+ * var isVolumeMuted = myPlayer.muted();
3460
+ *
3461
+ * // set
3462
+ * myPlayer.muted(true); // mute the volume
3463
+ *
3464
+ * @param {Boolean=} muted True to mute, false to unmute
3465
+ * @return {Boolean} True if mute is on, false if not, when getting
3466
+ * @return {vjs.Player} self, when setting mute
3467
+ */
3004
3468
  vjs.Player.prototype.muted = function(muted){
3005
3469
  if (muted !== undefined) {
3006
3470
  this.techCall('setMuted', muted);
@@ -3012,7 +3476,20 @@ vjs.Player.prototype.muted = function(muted){
3012
3476
  // Check if current tech can support native fullscreen (e.g. with built in controls lik iOS, so not our flash swf)
3013
3477
  vjs.Player.prototype.supportsFullScreen = function(){ return this.techGet('supportsFullScreen') || false; };
3014
3478
 
3015
- // Turn on fullscreen (or window) mode
3479
+ /**
3480
+ * Increase the size of the video to full screen
3481
+ *
3482
+ * myPlayer.requestFullScreen();
3483
+ *
3484
+ * In some browsers, full screen is not supported natively, so it enters
3485
+ * "full window mode", where the video fills the browser window.
3486
+ * In browsers and devices that support native full screen, sometimes the
3487
+ * browser's default controls will be shown, and not the Video.js custom skin.
3488
+ * This includes most mobile devices (iOS, Android) and older versions of
3489
+ * Safari.
3490
+ *
3491
+ * @return {vjs.Player} self
3492
+ */
3016
3493
  vjs.Player.prototype.requestFullScreen = function(){
3017
3494
  var requestFullScreen = vjs.support.requestFullScreen;
3018
3495
  this.isFullScreen = true;
@@ -3053,6 +3530,13 @@ vjs.Player.prototype.requestFullScreen = function(){
3053
3530
  return this;
3054
3531
  };
3055
3532
 
3533
+ /**
3534
+ * Return the video to its normal size after having been in full screen mode
3535
+ *
3536
+ * myPlayer.cancelFullScreen();
3537
+ *
3538
+ * @return {vjs.Player} self
3539
+ */
3056
3540
  vjs.Player.prototype.cancelFullScreen = function(){
3057
3541
  var requestFullScreen = vjs.support.requestFullScreen;
3058
3542
  this.isFullScreen = false;
@@ -3137,11 +3621,37 @@ vjs.Player.prototype.selectSource = function(sources){
3137
3621
  return false;
3138
3622
  };
3139
3623
 
3140
- // src is a pretty powerful function
3141
- // If you pass it an array of source objects, it will find the best source to play and use that object.src
3142
- // If the new source requires a new playback technology, it will switch to that.
3143
- // If you pass it an object, it will set the source to object.src
3144
- // If you pass it anything else (url string) it will set the video source to that
3624
+ /**
3625
+ * The source function updates the video source
3626
+ *
3627
+ * There are three types of variables you can pass as the argument.
3628
+ *
3629
+ * **URL String**: A URL to the the video file. Use this method if you are sure
3630
+ * the current playback technology (HTML5/Flash) can support the source you
3631
+ * provide. Currently only MP4 files can be used in both HTML5 and Flash.
3632
+ *
3633
+ * myPlayer.src("http://www.example.com/path/to/video.mp4");
3634
+ *
3635
+ * **Source Object (or element):** A javascript object containing information
3636
+ * about the source file. Use this method if you want the player to determine if
3637
+ * it can support the file using the type information.
3638
+ *
3639
+ * myPlayer.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" });
3640
+ *
3641
+ * **Array of Source Objects:** To provide multiple versions of the source so
3642
+ * that it can be played using HTML5 across browsers you can use an array of
3643
+ * source objects. Video.js will detect which version is supported and load that
3644
+ * file.
3645
+ *
3646
+ * myPlayer.src([
3647
+ * { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" },
3648
+ * { type: "video/webm", src: "http://www.example.com/path/to/video.webm" },
3649
+ * { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" }
3650
+ * ]);
3651
+ *
3652
+ * @param {String|Object|Array=} source The source URL, object, or array of sources
3653
+ * @return {vjs.Player} self
3654
+ */
3145
3655
  vjs.Player.prototype.src = function(source){
3146
3656
  // Case: Array of source objects to choose from and pick the best to play
3147
3657
  if (source instanceof Array) {
@@ -3237,20 +3747,31 @@ vjs.Player.prototype.loop = function(value){
3237
3747
  };
3238
3748
 
3239
3749
  /**
3240
- * The url of the poster image source.
3750
+ * the url of the poster image source
3241
3751
  * @type {String}
3242
3752
  * @private
3243
3753
  */
3244
3754
  vjs.Player.prototype.poster_;
3245
3755
 
3246
3756
  /**
3247
- * Get or set the poster image source url.
3248
- * @param {String} src Poster image source URL
3249
- * @return {String} Poster image source URL or null
3757
+ * get or set the poster image source url
3758
+ *
3759
+ * ##### EXAMPLE:
3760
+ *
3761
+ * // getting
3762
+ * var currentPoster = myPlayer.poster();
3763
+ *
3764
+ * // setting
3765
+ * myPlayer.poster('http://example.com/myImage.jpg');
3766
+ *
3767
+ * @param {String=} [src] Poster image source URL
3768
+ * @return {String} poster URL when getting
3769
+ * @return {vjs.Player} self when setting
3250
3770
  */
3251
3771
  vjs.Player.prototype.poster = function(src){
3252
3772
  if (src !== undefined) {
3253
3773
  this.poster_ = src;
3774
+ return this;
3254
3775
  }
3255
3776
  return this.poster_;
3256
3777
  };
@@ -3300,6 +3821,7 @@ vjs.Player.prototype.usingNativeControls_;
3300
3821
  *
3301
3822
  * @param {Boolean} bool True signals that native controls are on
3302
3823
  * @return {vjs.Player} Returns the player
3824
+ * @private
3303
3825
  */
3304
3826
  vjs.Player.prototype.usingNativeControls = function(bool){
3305
3827
  if (bool !== undefined) {
@@ -3309,9 +3831,27 @@ vjs.Player.prototype.usingNativeControls = function(bool){
3309
3831
  this.usingNativeControls_ = bool;
3310
3832
  if (bool) {
3311
3833
  this.addClass('vjs-using-native-controls');
3834
+
3835
+ /**
3836
+ * player is using the native device controls
3837
+ *
3838
+ * @event usingnativecontrols
3839
+ * @memberof vjs.Player
3840
+ * @instance
3841
+ * @private
3842
+ */
3312
3843
  this.trigger('usingnativecontrols');
3313
3844
  } else {
3314
3845
  this.removeClass('vjs-using-native-controls');
3846
+
3847
+ /**
3848
+ * player is using the custom HTML controls
3849
+ *
3850
+ * @event usingcustomcontrols
3851
+ * @memberof vjs.Player
3852
+ * @instance
3853
+ * @private
3854
+ */
3315
3855
  this.trigger('usingcustomcontrols');
3316
3856
  }
3317
3857
  }
@@ -3523,7 +4063,9 @@ vjs.Player.prototype.listenForUserActivity = function(){
3523
4063
  * Container of main controls
3524
4064
  * @param {vjs.Player|Object} player
3525
4065
  * @param {Object=} options
4066
+ * @class
3526
4067
  * @constructor
4068
+ * @extends vjs.Component
3527
4069
  */
3528
4070
  vjs.ControlBar = vjs.Component.extend();
3529
4071
 
@@ -3552,6 +4094,7 @@ vjs.ControlBar.prototype.createEl = function(){
3552
4094
  * Button to toggle between play and pause
3553
4095
  * @param {vjs.Player|Object} player
3554
4096
  * @param {Object=} options
4097
+ * @class
3555
4098
  * @constructor
3556
4099
  */
3557
4100
  vjs.PlayToggle = vjs.Button.extend({
@@ -3570,7 +4113,7 @@ vjs.PlayToggle.prototype.buildCSSClass = function(){
3570
4113
  return 'vjs-play-control ' + vjs.Button.prototype.buildCSSClass.call(this);
3571
4114
  };
3572
4115
 
3573
- // OnClick - Toggle between play and pause
4116
+ // OnClick - Toggle between play and pause
3574
4117
  vjs.PlayToggle.prototype.onClick = function(){
3575
4118
  if (this.player_.paused()) {
3576
4119
  this.player_.play();
@@ -3591,7 +4134,8 @@ vjs.PlayToggle.prototype.onPause = function(){
3591
4134
  vjs.removeClass(this.el_, 'vjs-playing');
3592
4135
  vjs.addClass(this.el_, 'vjs-paused');
3593
4136
  this.el_.children[0].children[0].innerHTML = 'Play'; // change the button text to "Play"
3594
- };/**
4137
+ };
4138
+ /**
3595
4139
  * Displays the current time
3596
4140
  * @param {vjs.Player|Object} player
3597
4141
  * @param {Object=} options
@@ -3665,7 +4209,10 @@ vjs.DurationDisplay.prototype.updateContent = function(){
3665
4209
  };
3666
4210
 
3667
4211
  /**
3668
- * Time Separator (Not used in main skin, but still available, and could be used as a 'spare element')
4212
+ * The separator between the current time and duration
4213
+ *
4214
+ * Can be hidden if it's not needed in the design.
4215
+ *
3669
4216
  * @param {vjs.Player|Object} player
3670
4217
  * @param {Object=} options
3671
4218
  * @constructor
@@ -3727,10 +4274,15 @@ vjs.RemainingTimeDisplay.prototype.updateContent = function(){
3727
4274
  * Toggle fullscreen video
3728
4275
  * @param {vjs.Player|Object} player
3729
4276
  * @param {Object=} options
3730
- * @constructor
4277
+ * @class
4278
+ * @extends vjs.Button
3731
4279
  */
3732
4280
  vjs.FullscreenToggle = vjs.Button.extend({
3733
- /** @constructor */
4281
+ /**
4282
+ * @constructor
4283
+ * @memberof vjs.FullscreenToggle
4284
+ * @instance
4285
+ */
3734
4286
  init: function(player, options){
3735
4287
  vjs.Button.call(this, player, options);
3736
4288
  }
@@ -3750,8 +4302,11 @@ vjs.FullscreenToggle.prototype.onClick = function(){
3750
4302
  this.player_.cancelFullScreen();
3751
4303
  this.el_.children[0].children[0].innerHTML = 'Fullscreen'; // change the button to "Fullscreen"
3752
4304
  }
3753
- };/**
3754
- * Seek, Load Progress, and Play Progress
4305
+ };
4306
+ /**
4307
+ * The Progress Control component contains the seek bar, load progress,
4308
+ * and play progress
4309
+ *
3755
4310
  * @param {vjs.Player|Object} player
3756
4311
  * @param {Object=} options
3757
4312
  * @constructor
@@ -3777,6 +4332,7 @@ vjs.ProgressControl.prototype.createEl = function(){
3777
4332
 
3778
4333
  /**
3779
4334
  * Seek Bar and holder for the progress bars
4335
+ *
3780
4336
  * @param {vjs.Player|Object} player
3781
4337
  * @param {Object=} options
3782
4338
  * @constructor
@@ -3876,7 +4432,8 @@ vjs.SeekBar.prototype.stepBack = function(){
3876
4432
 
3877
4433
 
3878
4434
  /**
3879
- * Shows load progres
4435
+ * Shows load progress
4436
+ *
3880
4437
  * @param {vjs.Player|Object} player
3881
4438
  * @param {Object=} options
3882
4439
  * @constructor
@@ -3903,6 +4460,7 @@ vjs.LoadProgressBar.prototype.update = function(){
3903
4460
 
3904
4461
  /**
3905
4462
  * Shows play progress
4463
+ *
3906
4464
  * @param {vjs.Player|Object} player
3907
4465
  * @param {Object=} options
3908
4466
  * @constructor
@@ -3922,15 +4480,21 @@ vjs.PlayProgressBar.prototype.createEl = function(){
3922
4480
  };
3923
4481
 
3924
4482
  /**
3925
- * SeekBar component includes play progress bar, and seek handle
3926
- * Needed so it can determine seek position based on handle position/size
4483
+ * The Seek Handle shows the current position of the playhead during playback,
4484
+ * and can be dragged to adjust the playhead.
4485
+ *
3927
4486
  * @param {vjs.Player|Object} player
3928
4487
  * @param {Object=} options
3929
4488
  * @constructor
3930
4489
  */
3931
4490
  vjs.SeekHandle = vjs.SliderHandle.extend();
3932
4491
 
3933
- /** @inheritDoc */
4492
+ /**
4493
+ * The default value for the handle content, which may be read by screen readers
4494
+ *
4495
+ * @type {String}
4496
+ * @private
4497
+ */
3934
4498
  vjs.SeekHandle.prototype.defaultValue = '00:00';
3935
4499
 
3936
4500
  /** @inheritDoc */
@@ -3938,8 +4502,10 @@ vjs.SeekHandle.prototype.createEl = function(){
3938
4502
  return vjs.SliderHandle.prototype.createEl.call(this, 'div', {
3939
4503
  className: 'vjs-seek-handle'
3940
4504
  });
3941
- };/**
3942
- * Control the volume
4505
+ };
4506
+ /**
4507
+ * The component for controlling the volume level
4508
+ *
3943
4509
  * @param {vjs.Player|Object} player
3944
4510
  * @param {Object=} options
3945
4511
  * @constructor
@@ -3976,7 +4542,8 @@ vjs.VolumeControl.prototype.createEl = function(){
3976
4542
  };
3977
4543
 
3978
4544
  /**
3979
- * Contains volume level
4545
+ * The bar that contains the volume level and can be clicked on to adjust the level
4546
+ *
3980
4547
  * @param {vjs.Player|Object} player
3981
4548
  * @param {Object=} options
3982
4549
  * @constructor
@@ -4016,6 +4583,10 @@ vjs.VolumeBar.prototype.createEl = function(){
4016
4583
  };
4017
4584
 
4018
4585
  vjs.VolumeBar.prototype.onMouseMove = function(event) {
4586
+ if (this.player_.muted()) {
4587
+ this.player_.muted(false);
4588
+ }
4589
+
4019
4590
  this.player_.volume(this.calculateDistance(event));
4020
4591
  };
4021
4592
 
@@ -4037,6 +4608,7 @@ vjs.VolumeBar.prototype.stepBack = function(){
4037
4608
 
4038
4609
  /**
4039
4610
  * Shows volume level
4611
+ *
4040
4612
  * @param {vjs.Player|Object} player
4041
4613
  * @param {Object=} options
4042
4614
  * @constructor
@@ -4056,14 +4628,14 @@ vjs.VolumeLevel.prototype.createEl = function(){
4056
4628
  };
4057
4629
 
4058
4630
  /**
4059
- * Change volume level
4631
+ * The volume handle can be dragged to adjust the volume level
4632
+ *
4060
4633
  * @param {vjs.Player|Object} player
4061
4634
  * @param {Object=} options
4062
4635
  * @constructor
4063
4636
  */
4064
4637
  vjs.VolumeHandle = vjs.SliderHandle.extend();
4065
4638
 
4066
- /** @inheritDoc */
4067
4639
  vjs.VolumeHandle.prototype.defaultValue = '00:00';
4068
4640
 
4069
4641
  /** @inheritDoc */
@@ -4073,7 +4645,8 @@ vjs.VolumeLevel.prototype.createEl = function(){
4073
4645
  });
4074
4646
  };
4075
4647
  /**
4076
- * Mute the audio
4648
+ * A button component for muting the audio
4649
+ *
4077
4650
  * @param {vjs.Player|Object} player
4078
4651
  * @param {Object=} options
4079
4652
  * @constructor
@@ -4192,7 +4765,8 @@ vjs.VolumeMenuButton.prototype.update = vjs.MuteToggle.prototype.update;
4192
4765
  /* Poster Image
4193
4766
  ================================================================================ */
4194
4767
  /**
4195
- * Poster image. Shows before the video plays.
4768
+ * The component that handles showing the poster image.
4769
+ *
4196
4770
  * @param {vjs.Player|Object} player
4197
4771
  * @param {Object=} options
4198
4772
  * @constructor
@@ -4242,6 +4816,7 @@ vjs.PosterImage.prototype.onClick = function(){
4242
4816
  * Loading spinner for waiting events
4243
4817
  * @param {vjs.Player|Object} player
4244
4818
  * @param {Object=} options
4819
+ * @class
4245
4820
  * @constructor
4246
4821
  */
4247
4822
  vjs.LoadingSpinner = vjs.Component.extend({
@@ -4283,6 +4858,7 @@ vjs.LoadingSpinner.prototype.createEl = function(){
4283
4858
  * big play button is done via CSS and player states.
4284
4859
  * @param {vjs.Player|Object} player
4285
4860
  * @param {Object=} options
4861
+ * @class
4286
4862
  * @constructor
4287
4863
  */
4288
4864
  vjs.BigPlayButton = vjs.Button.extend();
@@ -4290,7 +4866,7 @@ vjs.BigPlayButton = vjs.Button.extend();
4290
4866
  vjs.BigPlayButton.prototype.createEl = function(){
4291
4867
  return vjs.Button.prototype.createEl.call(this, 'div', {
4292
4868
  className: 'vjs-big-play-button',
4293
- innerHTML: '<span></span>',
4869
+ innerHTML: '<span aria-hidden="true"></span>',
4294
4870
  'aria-label': 'play video'
4295
4871
  });
4296
4872
  };
@@ -4784,8 +5360,9 @@ if (vjs.IS_OLD_ANDROID) {
4784
5360
  */
4785
5361
 
4786
5362
  /**
4787
- * HTML5 Media Controller - Wrapper for HTML5 Media API
4788
- * @param {vjs.Player|Object} player
5363
+ * Flash Media Controller - Wrapper for fallback SWF API
5364
+ *
5365
+ * @param {vjs.Player} player
4789
5366
  * @param {Object=} options
4790
5367
  * @param {Function=} ready
4791
5368
  * @constructor
@@ -5072,6 +5649,7 @@ var api = vjs.Flash.prototype,
5072
5649
 
5073
5650
  /**
5074
5651
  * @this {*}
5652
+ * @private
5075
5653
  */
5076
5654
  var createSetter = function(attr){
5077
5655
  var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1);
@@ -5080,6 +5658,7 @@ var createSetter = function(attr){
5080
5658
 
5081
5659
  /**
5082
5660
  * @this {*}
5661
+ * @private
5083
5662
  */
5084
5663
  var createGetter = function(attr){
5085
5664
  api[attr] = function(){ return this.el_.vjs_getProperty(attr); };
@@ -5107,7 +5686,16 @@ vjs.Flash.isSupported = function(){
5107
5686
  };
5108
5687
 
5109
5688
  vjs.Flash.canPlaySource = function(srcObj){
5110
- if (srcObj.type in vjs.Flash.formats || srcObj.type in vjs.Flash.streamingFormats) { return 'maybe'; }
5689
+ var type;
5690
+
5691
+ if (!srcObj.type) {
5692
+ return '';
5693
+ }
5694
+
5695
+ type = srcObj.type.replace(/;.*/,'').toLowerCase();
5696
+ if (type in vjs.Flash.formats || type in vjs.Flash.streamingFormats) {
5697
+ return 'maybe';
5698
+ }
5111
5699
  };
5112
5700
 
5113
5701
  vjs.Flash.formats = {
@@ -5307,6 +5895,9 @@ vjs.Flash.isStreamingSrc = function(src) {
5307
5895
  return vjs.Flash.RTMP_RE.test(src);
5308
5896
  };
5309
5897
  /**
5898
+ * The Media Loader is the component that decides which playback technology to load
5899
+ * when the player is initialized.
5900
+ *
5310
5901
  * @constructor
5311
5902
  */
5312
5903
  vjs.MediaLoader = vjs.Component.extend({
@@ -5335,7 +5926,8 @@ vjs.MediaLoader = vjs.Component.extend({
5335
5926
  player.src(player.options_['sources']);
5336
5927
  }
5337
5928
  }
5338
- });/**
5929
+ });
5930
+ /**
5339
5931
  * @fileoverview Text Tracks
5340
5932
  * Text tracks are tracks of timed text events.
5341
5933
  * Captions - text displayed over the video for the hearing impared
@@ -5357,6 +5949,7 @@ vjs.Player.prototype.textTracks_;
5357
5949
  * Get an array of associated text tracks. captions, subtitles, chapters, descriptions
5358
5950
  * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks
5359
5951
  * @return {Array} Array of track objects
5952
+ * @private
5360
5953
  */
5361
5954
  vjs.Player.prototype.textTracks = function(){
5362
5955
  this.textTracks_ = this.textTracks_ || [];
@@ -5371,6 +5964,7 @@ vjs.Player.prototype.textTracks = function(){
5371
5964
  * @param {String=} label Optional label
5372
5965
  * @param {String=} language Optional language
5373
5966
  * @param {Object=} options Additional track options, like src
5967
+ * @private
5374
5968
  */
5375
5969
  vjs.Player.prototype.addTextTrack = function(kind, label, language, options){
5376
5970
  var tracks = this.textTracks_ = this.textTracks_ || [];
@@ -5404,6 +5998,7 @@ vjs.Player.prototype.addTextTrack = function(kind, label, language, options){
5404
5998
  * Add an array of text tracks. captions, subtitles, chapters, descriptions
5405
5999
  * Track objects will be stored in the player.textTracks() array
5406
6000
  * @param {Array} trackList Array of track elements or objects (fake track elements)
6001
+ * @private
5407
6002
  */
5408
6003
  vjs.Player.prototype.addTextTracks = function(trackList){
5409
6004
  var trackObj;
@@ -5449,8 +6044,10 @@ vjs.Player.prototype.showTextTrack = function(id, disableSameKind){
5449
6044
  };
5450
6045
 
5451
6046
  /**
5452
- * Track Class
5453
- * Contains track methods for loading, showing, parsing cues of tracks
6047
+ * The base class for all text tracks
6048
+ *
6049
+ * Handles the parsing, hiding, and showing of text track cues
6050
+ *
5454
6051
  * @param {vjs.Player|Object} player
5455
6052
  * @param {Object=} options
5456
6053
  * @constructor
@@ -5516,8 +6113,7 @@ vjs.TextTrack.prototype.src = function(){
5516
6113
  vjs.TextTrack.prototype.dflt_;
5517
6114
 
5518
6115
  /**
5519
- * Get the track default value
5520
- * 'default' is a reserved keyword
6116
+ * Get the track default value. ('default' is a reserved keyword)
5521
6117
  * @return {Boolean}
5522
6118
  */
5523
6119
  vjs.TextTrack.prototype.dflt = function(){
@@ -6005,6 +6601,8 @@ vjs.TextTrack.prototype.reset = function(){
6005
6601
 
6006
6602
  // Create specific track types
6007
6603
  /**
6604
+ * The track component for managing the hiding and showing of captions
6605
+ *
6008
6606
  * @constructor
6009
6607
  */
6010
6608
  vjs.CaptionsTrack = vjs.TextTrack.extend();
@@ -6013,12 +6611,16 @@ vjs.CaptionsTrack.prototype.kind_ = 'captions';
6013
6611
  // to be available on global object. e.g. new window['videojs'][Kind + 'Track']
6014
6612
 
6015
6613
  /**
6614
+ * The track component for managing the hiding and showing of subtitles
6615
+ *
6016
6616
  * @constructor
6017
6617
  */
6018
6618
  vjs.SubtitlesTrack = vjs.TextTrack.extend();
6019
6619
  vjs.SubtitlesTrack.prototype.kind_ = 'subtitles';
6020
6620
 
6021
6621
  /**
6622
+ * The track component for managing the hiding and showing of chapters
6623
+ *
6022
6624
  * @constructor
6023
6625
  */
6024
6626
  vjs.ChaptersTrack = vjs.TextTrack.extend();
@@ -6030,6 +6632,8 @@ vjs.ChaptersTrack.prototype.kind_ = 'chapters';
6030
6632
  // Global container for both subtitle and captions text. Simple div container.
6031
6633
 
6032
6634
  /**
6635
+ * The component for displaying text track cues
6636
+ *
6033
6637
  * @constructor
6034
6638
  */
6035
6639
  vjs.TextTrackDisplay = vjs.Component.extend({
@@ -6054,9 +6658,9 @@ vjs.TextTrackDisplay.prototype.createEl = function(){
6054
6658
  };
6055
6659
 
6056
6660
 
6057
- /* Text Track Menu Items
6058
- ============================================================================= */
6059
6661
  /**
6662
+ * The specific menu item type for selecting a language within a text track kind
6663
+ *
6060
6664
  * @constructor
6061
6665
  */
6062
6666
  vjs.TextTrackMenuItem = vjs.MenuItem.extend({
@@ -6083,6 +6687,8 @@ vjs.TextTrackMenuItem.prototype.update = function(){
6083
6687
  };
6084
6688
 
6085
6689
  /**
6690
+ * A special menu item for turning of a specific type of text track
6691
+ *
6086
6692
  * @constructor
6087
6693
  */
6088
6694
  vjs.OffTextTrackMenuItem = vjs.TextTrackMenuItem.extend({
@@ -6122,9 +6728,9 @@ vjs.OffTextTrackMenuItem.prototype.update = function(){
6122
6728
  this.selected(off);
6123
6729
  };
6124
6730
 
6125
- /* Captions Button
6126
- ================================================================================ */
6127
6731
  /**
6732
+ * The base class for buttons that toggle specific text track types (e.g. subtitles)
6733
+ *
6128
6734
  * @constructor
6129
6735
  */
6130
6736
  vjs.TextTrackButton = vjs.MenuButton.extend({
@@ -6183,6 +6789,8 @@ vjs.TextTrackButton.prototype.createItems = function(){
6183
6789
  };
6184
6790
 
6185
6791
  /**
6792
+ * The button component for toggling and selecting captions
6793
+ *
6186
6794
  * @constructor
6187
6795
  */
6188
6796
  vjs.CaptionsButton = vjs.TextTrackButton.extend({
@@ -6197,6 +6805,8 @@ vjs.CaptionsButton.prototype.buttonText = 'Captions';
6197
6805
  vjs.CaptionsButton.prototype.className = 'vjs-captions-button';
6198
6806
 
6199
6807
  /**
6808
+ * The button component for toggling and selecting subtitles
6809
+ *
6200
6810
  * @constructor
6201
6811
  */
6202
6812
  vjs.SubtitlesButton = vjs.TextTrackButton.extend({
@@ -6213,6 +6823,8 @@ vjs.SubtitlesButton.prototype.className = 'vjs-subtitles-button';
6213
6823
  // Chapters act much differently than other text tracks
6214
6824
  // Cues are navigation vs. other tracks of alternative languages
6215
6825
  /**
6826
+ * The button component for toggling and selecting chapters
6827
+ *
6216
6828
  * @constructor
6217
6829
  */
6218
6830
  vjs.ChaptersButton = vjs.TextTrackButton.extend({
@@ -6355,14 +6967,12 @@ vjs.obj.merge(vjs.ControlBar.prototype.options_['children'], {
6355
6967
  * (Parse Method Only)
6356
6968
  * https://github.com/douglascrockford/JSON-js/blob/master/json2.js
6357
6969
  * Only using for parse method when parsing data-setup attribute JSON.
6358
- * @type {Object}
6359
6970
  * @suppress {undefinedVars}
6971
+ * @namespace
6972
+ * @private
6360
6973
  */
6361
6974
  vjs.JSON;
6362
6975
 
6363
- /**
6364
- * @suppress {undefinedVars}
6365
- */
6366
6976
  if (typeof window.JSON !== 'undefined' && window.JSON.parse === 'function') {
6367
6977
  vjs.JSON = window.JSON;
6368
6978
 
@@ -6371,6 +6981,12 @@ if (typeof window.JSON !== 'undefined' && window.JSON.parse === 'function') {
6371
6981
 
6372
6982
  var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
6373
6983
 
6984
+ /**
6985
+ * parse the json
6986
+ *
6987
+ * @memberof vjs.JSON
6988
+ * @return {Object|Array} The parsed JSON
6989
+ */
6374
6990
  vjs.JSON.parse = function (text, reviver) {
6375
6991
  var j;
6376
6992
 
@@ -6479,6 +7095,12 @@ if (document.readyState === 'complete') {
6479
7095
  // Run Auto-load players
6480
7096
  // You have to wait at least once in case this script is loaded after your video in the DOM (weird behavior only with minified version)
6481
7097
  vjs.autoSetupTimeout(1);
7098
+ /**
7099
+ * the method for registering a video.js plugin
7100
+ *
7101
+ * @param {String} name The name of the plugin
7102
+ * @param {Function} init The function that is run when the player inits
7103
+ */
6482
7104
  vjs.plugin = function(name, init){
6483
7105
  vjs.Player.prototype[name] = init;
6484
7106
  };