shaka-player 3.1.3 → 3.2.2

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.
Files changed (182) hide show
  1. package/AUTHORS +3 -0
  2. package/CHANGELOG.md +175 -3
  3. package/CONTRIBUTORS +3 -0
  4. package/README.md +4 -4
  5. package/build/generateExterns.js +1 -1
  6. package/build/types/polyfill +1 -0
  7. package/demo/common/asset.js +9 -7
  8. package/demo/common/assets.js +11 -2
  9. package/demo/common/message_ids.js +2 -1
  10. package/demo/config.js +5 -2
  11. package/demo/index.html +1 -1
  12. package/demo/locales/en.json +2 -1
  13. package/demo/locales/source.json +8 -4
  14. package/demo/main.js +2 -1
  15. package/dist/controls.css +2 -2
  16. package/dist/controls.css.map +1 -1
  17. package/dist/demo.compiled.debug.js +15 -15
  18. package/dist/demo.compiled.debug.map +2 -2
  19. package/dist/demo.compiled.js +15 -15
  20. package/dist/demo.compiled.map +2 -2
  21. package/dist/deps.js +22 -21
  22. package/dist/locales.js +36 -36
  23. package/dist/receiver.compiled.debug.js +9 -9
  24. package/dist/receiver.compiled.debug.map +2 -2
  25. package/dist/receiver.compiled.js +9 -9
  26. package/dist/receiver.compiled.map +2 -2
  27. package/dist/shaka-player.compiled.d.ts +58 -10
  28. package/dist/shaka-player.compiled.debug.d.ts +58 -10
  29. package/dist/shaka-player.compiled.debug.externs.js +777 -717
  30. package/dist/shaka-player.compiled.debug.js +639 -607
  31. package/dist/shaka-player.compiled.debug.map +4 -4
  32. package/dist/shaka-player.compiled.externs.js +777 -717
  33. package/dist/shaka-player.compiled.js +826 -819
  34. package/dist/shaka-player.compiled.map +4 -4
  35. package/dist/shaka-player.ui.d.ts +58 -10
  36. package/dist/shaka-player.ui.debug.d.ts +58 -10
  37. package/dist/shaka-player.ui.debug.externs.js +529 -469
  38. package/dist/shaka-player.ui.debug.js +676 -645
  39. package/dist/shaka-player.ui.debug.map +4 -4
  40. package/dist/shaka-player.ui.externs.js +529 -469
  41. package/dist/shaka-player.ui.js +963 -955
  42. package/dist/shaka-player.ui.map +4 -4
  43. package/docs/tutorials/fairplay.md +1 -1
  44. package/docs/tutorials/ui.md +5 -5
  45. package/externs/aria.js +6 -0
  46. package/externs/shaka/ads.js +24 -1
  47. package/externs/shaka/manifest.js +6 -1
  48. package/externs/shaka/offline.js +5 -0
  49. package/externs/shaka/player.js +53 -9
  50. package/externs/shaka/text.js +10 -10
  51. package/externs/texttrack.js +3 -0
  52. package/karma.conf.js +1 -0
  53. package/lib/ads/ad_manager.js +16 -15
  54. package/lib/ads/client_side_ad_manager.js +52 -88
  55. package/lib/ads/server_side_ad_manager.js +26 -12
  56. package/lib/cast/cast_proxy.js +11 -2
  57. package/lib/cast/cast_receiver.js +2 -1
  58. package/lib/cast/cast_sender.js +2 -2
  59. package/lib/cast/cast_utils.js +6 -1
  60. package/lib/cea/cea608_data_channel.js +56 -56
  61. package/lib/cea/cea608_memory.js +33 -33
  62. package/lib/cea/cea708_service.js +43 -43
  63. package/lib/cea/cea708_window.js +38 -38
  64. package/lib/cea/cea_decoder.js +13 -14
  65. package/lib/cea/cea_utils.js +23 -23
  66. package/lib/cea/dtvcc_packet_builder.js +7 -7
  67. package/lib/cea/i_caption_decoder.js +2 -3
  68. package/lib/cea/i_cea_parser.js +2 -2
  69. package/lib/cea/mp4_cea_parser.js +6 -6
  70. package/lib/dash/dash_parser.js +98 -2
  71. package/lib/dash/segment_list.js +1 -1
  72. package/lib/dash/segment_template.js +1 -1
  73. package/lib/hls/hls_parser.js +159 -29
  74. package/lib/media/closed_caption_parser.js +1 -2
  75. package/lib/media/drm_engine.js +169 -192
  76. package/lib/media/gap_jumping_controller.js +4 -2
  77. package/lib/media/media_source_engine.js +1 -2
  78. package/lib/media/segment_index.js +3 -1
  79. package/lib/media/segment_reference.js +19 -2
  80. package/lib/media/streaming_engine.js +8 -7
  81. package/lib/net/networking_engine.js +3 -1
  82. package/lib/offline/download_manager.js +1 -2
  83. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  84. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  85. package/lib/offline/manifest_converter.js +3 -1
  86. package/lib/offline/storage.js +12 -14
  87. package/lib/player.js +437 -167
  88. package/lib/polyfill/aria.js +82 -0
  89. package/lib/polyfill/media_capabilities.js +7 -1
  90. package/lib/polyfill/mediasource.js +6 -0
  91. package/lib/polyfill/orientation.js +1 -1
  92. package/lib/polyfill/patchedmediakeys_apple.js +4 -4
  93. package/lib/polyfill/patchedmediakeys_ms.js +4 -4
  94. package/lib/polyfill/patchedmediakeys_webkit.js +4 -4
  95. package/lib/routing/walker.js +2 -3
  96. package/lib/text/mp4_ttml_parser.js +3 -0
  97. package/lib/text/srt_text_parser.js +4 -4
  98. package/lib/text/text_engine.js +16 -4
  99. package/lib/text/ttml_text_parser.js +5 -0
  100. package/lib/text/ui_text_displayer.js +85 -37
  101. package/lib/text/vtt_text_parser.js +2 -2
  102. package/lib/text/web_vtt_generator.js +55 -12
  103. package/lib/util/error.js +6 -0
  104. package/lib/util/fake_event.js +53 -7
  105. package/lib/util/manifest_parser_utils.js +1 -0
  106. package/lib/util/mp4_box_parsers.js +20 -20
  107. package/lib/util/multi_map.js +8 -0
  108. package/lib/util/periods.js +4 -1
  109. package/lib/util/platform.js +13 -1
  110. package/lib/util/player_configuration.js +13 -1
  111. package/lib/util/stream_utils.js +153 -85
  112. package/lib/util/xml_utils.js +31 -12
  113. package/package.json +1 -1
  114. package/roadmap.md +24 -22
  115. package/shaka-player.uncompiled.js +1 -0
  116. package/test/cast/cast_proxy_unit.js +12 -6
  117. package/test/cast/cast_utils_unit.js +2 -1
  118. package/test/cea/cea608_memory_unit.js +1 -1
  119. package/test/cea/cea708_service_unit.js +8 -8
  120. package/test/cea/cea708_window_unit.js +6 -6
  121. package/test/cea/cea_decoder_unit.js +1 -1
  122. package/test/cea/dtvcc_packet_builder_unit.js +2 -2
  123. package/test/dash/dash_parser_manifest_unit.js +230 -2
  124. package/test/hls/hls_parser_unit.js +255 -1
  125. package/test/media/closed_caption_parser_unit.js +6 -1
  126. package/test/media/drm_engine_integration.js +86 -12
  127. package/test/media/drm_engine_unit.js +353 -450
  128. package/test/offline/manifest_convert_unit.js +2 -0
  129. package/test/offline/storage_integration.js +9 -19
  130. package/test/player_integration.js +90 -0
  131. package/test/player_src_equals_integration.js +52 -0
  132. package/test/player_unit.js +11 -33
  133. package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
  134. package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
  135. package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
  136. package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
  137. package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
  138. package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
  139. package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
  140. package/test/test/assets/3675/dash_0.mpd +30 -0
  141. package/test/test/assets/3675/dash_1.mpd +30 -0
  142. package/test/test/assets/3675/dash_2.mpd +30 -0
  143. package/test/test/assets/3675/dash_3.mpd +30 -0
  144. package/test/test/assets/3675/dash_4.mpd +30 -0
  145. package/test/test/assets/3675/dash_5.mpd +26 -0
  146. package/test/test/assets/3675/init-stream0.m4s +0 -0
  147. package/test/test/assets/chapters.srt +11 -0
  148. package/test/test/assets/chapters.vtt +10 -0
  149. package/test/test/util/cea_utils.js +12 -12
  150. package/test/test/util/fake_ad_manager.js +8 -1
  151. package/test/test/util/manifest_generator.js +2 -0
  152. package/test/test/util/manifest_parser_util.js +3 -1
  153. package/test/text/ttml_text_parser_unit.js +9 -0
  154. package/test/text/ui_text_displayer_unit.js +29 -17
  155. package/test/text/web_vtt_generator_unit.js +81 -7
  156. package/test/ui/localization_unit.js +15 -14
  157. package/test/ui/text_displayer_layout_unit.js +13 -1
  158. package/test/util/stream_utils_unit.js +153 -10
  159. package/ui/airplay_button.js +1 -1
  160. package/ui/audio_language_selection.js +2 -5
  161. package/ui/cast_button.js +6 -9
  162. package/ui/constants.js +0 -3
  163. package/ui/controls.js +4 -6
  164. package/ui/fast_forward_button.js +2 -3
  165. package/ui/fullscreen_button.js +1 -3
  166. package/ui/language_utils.js +1 -1
  167. package/ui/less/containers.less +3 -7
  168. package/ui/locales/ru.json +6 -6
  169. package/ui/localization.js +28 -51
  170. package/ui/loop_button.js +1 -3
  171. package/ui/mute_button.js +1 -3
  172. package/ui/overflow_menu.js +2 -3
  173. package/ui/pip_button.js +7 -10
  174. package/ui/playback_rate_selection.js +3 -6
  175. package/ui/presentation_time.js +1 -3
  176. package/ui/resolution_selection.js +4 -7
  177. package/ui/rewind_button.js +2 -3
  178. package/ui/seek_bar.js +2 -4
  179. package/ui/spacer.js +1 -1
  180. package/ui/text_selection.js +8 -11
  181. package/ui/ui_utils.js +1 -1
  182. package/ui/volume_bar.js +1 -3
@@ -18,12 +18,12 @@ goog.require('shaka.util.Error');
18
18
  */
19
19
  shaka.cea.Cea708Service = class {
20
20
  /**
21
- * @param {!number} serviceNumber
21
+ * @param {number} serviceNumber
22
22
  */
23
23
  constructor(serviceNumber) {
24
24
  /**
25
25
  * Number for this specific service (1 - 63).
26
- * @private {!number}
26
+ * @private {number}
27
27
  */
28
28
  this.serviceNumber_ = serviceNumber;
29
29
 
@@ -84,7 +84,7 @@ shaka.cea.Cea708Service = class {
84
84
 
85
85
  /**
86
86
  * Handles G0 group data.
87
- * @param {!number} controlCode
87
+ * @param {number} controlCode
88
88
  * @private
89
89
  */
90
90
  handleG0_(controlCode) {
@@ -102,7 +102,7 @@ shaka.cea.Cea708Service = class {
102
102
 
103
103
  /**
104
104
  * Handles G1 group data.
105
- * @param {!number} controlCode
105
+ * @param {number} controlCode
106
106
  * @private
107
107
  */
108
108
  handleG1_(controlCode) {
@@ -115,7 +115,7 @@ shaka.cea.Cea708Service = class {
115
115
 
116
116
  /**
117
117
  * Handles G2 group data.
118
- * @param {!number} controlCode
118
+ * @param {number} controlCode
119
119
  * @private
120
120
  */
121
121
  handleG2_(controlCode) {
@@ -134,7 +134,7 @@ shaka.cea.Cea708Service = class {
134
134
 
135
135
  /**
136
136
  * Handles G3 group data.
137
- * @param {!number} controlCode
137
+ * @param {number} controlCode
138
138
  * @private
139
139
  */
140
140
  handleG3_(controlCode) {
@@ -155,8 +155,8 @@ shaka.cea.Cea708Service = class {
155
155
 
156
156
  /**
157
157
  * Handles C0 group data.
158
- * @param {!number} controlCode
159
- * @param {!number} pts
158
+ * @param {number} controlCode
159
+ * @param {number} pts
160
160
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
161
161
  * @private
162
162
  */
@@ -206,8 +206,8 @@ shaka.cea.Cea708Service = class {
206
206
  * Processes C1 group data.
207
207
  * These are caption commands.
208
208
  * @param {!shaka.cea.DtvccPacket} dtvccPacket
209
- * @param {!number} captionCommand
210
- * @param {!number} pts in seconds
209
+ * @param {number} captionCommand
210
+ * @param {number} pts in seconds
211
211
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
212
212
  * @throws {!shaka.util.Error} a possible out-of-range buffer read.
213
213
  * @private
@@ -255,7 +255,7 @@ shaka.cea.Cea708Service = class {
255
255
  /**
256
256
  * Handles C2 group data.
257
257
  * @param {!shaka.cea.DtvccPacket} dtvccPacket
258
- * @param {!number} controlCode
258
+ * @param {number} controlCode
259
259
  * @private
260
260
  */
261
261
  handleC2_(dtvccPacket, controlCode) {
@@ -273,7 +273,7 @@ shaka.cea.Cea708Service = class {
273
273
  /**
274
274
  * Handles C3 group data.
275
275
  * @param {!shaka.cea.DtvccPacket} dtvccPacket
276
- * @param {!number} controlCode
276
+ * @param {number} controlCode
277
277
  * @private
278
278
  */
279
279
  handleC3_(dtvccPacket, controlCode) {
@@ -287,7 +287,7 @@ shaka.cea.Cea708Service = class {
287
287
  }
288
288
 
289
289
  /**
290
- * @param {!number} windowNum
290
+ * @param {number} windowNum
291
291
  * @private
292
292
  */
293
293
  setCurrentWindow_(windowNum) {
@@ -300,8 +300,8 @@ shaka.cea.Cea708Service = class {
300
300
 
301
301
  /**
302
302
  * Yields each non-null window specified in the 8-bit bitmap.
303
- * @param {!number} bitmap 8 bits corresponding to each of the 8 windows.
304
- * @return {!Iterable.<!number>}
303
+ * @param {number} bitmap 8 bits corresponding to each of the 8 windows.
304
+ * @return {!Iterable.<number>}
305
305
  * @private
306
306
  */
307
307
  * getSpecifiedWindowIds_(bitmap) {
@@ -315,8 +315,8 @@ shaka.cea.Cea708Service = class {
315
315
  }
316
316
 
317
317
  /**
318
- * @param {!number} windowsBitmap
319
- * @param {!number} pts
318
+ * @param {number} windowsBitmap
319
+ * @param {number} pts
320
320
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
321
321
  * @private
322
322
  */
@@ -336,8 +336,8 @@ shaka.cea.Cea708Service = class {
336
336
  }
337
337
 
338
338
  /**
339
- * @param {!number} windowsBitmap
340
- * @param {!number} pts
339
+ * @param {number} windowsBitmap
340
+ * @param {number} pts
341
341
  * @private
342
342
  */
343
343
  displayWindows_(windowsBitmap, pts) {
@@ -353,8 +353,8 @@ shaka.cea.Cea708Service = class {
353
353
  }
354
354
 
355
355
  /**
356
- * @param {!number} windowsBitmap
357
- * @param {!number} pts
356
+ * @param {number} windowsBitmap
357
+ * @param {number} pts
358
358
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
359
359
  * @private
360
360
  */
@@ -374,8 +374,8 @@ shaka.cea.Cea708Service = class {
374
374
  }
375
375
 
376
376
  /**
377
- * @param {!number} windowsBitmap
378
- * @param {!number} pts
377
+ * @param {number} windowsBitmap
378
+ * @param {number} pts
379
379
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
380
380
  * @private
381
381
  */
@@ -399,8 +399,8 @@ shaka.cea.Cea708Service = class {
399
399
  }
400
400
 
401
401
  /**
402
- * @param {!number} windowsBitmap
403
- * @param {!number} pts
402
+ * @param {number} windowsBitmap
403
+ * @param {number} pts
404
404
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
405
405
  * @private
406
406
  */
@@ -422,7 +422,7 @@ shaka.cea.Cea708Service = class {
422
422
  /**
423
423
  * Emits anything currently present in any of the windows, and then
424
424
  * deletes all windows, cancels all delays, reinitializes the service.
425
- * @param {!number} pts
425
+ * @param {number} pts
426
426
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
427
427
  * @private
428
428
  */
@@ -559,8 +559,8 @@ shaka.cea.Cea708Service = class {
559
559
 
560
560
  /**
561
561
  * @param {!shaka.cea.DtvccPacket} dtvccPacket
562
- * @param {!number} windowNum
563
- * @param {!number} pts
562
+ * @param {number} windowNum
563
+ * @param {number} pts
564
564
  * @throws {!shaka.util.Error}
565
565
  * @private
566
566
  */
@@ -612,10 +612,10 @@ shaka.cea.Cea708Service = class {
612
612
 
613
613
  /**
614
614
  * Maps 64 possible CEA-708 colors to 8 CSS colors.
615
- * @param {!number} red value from 0-3
616
- * @param {!number} green value from 0-3
617
- * @param {!number} blue value from 0-3
618
- * @return {!string}
615
+ * @param {number} red value from 0-3
616
+ * @param {number} green value from 0-3
617
+ * @param {number} blue value from 0-3
618
+ * @return {string}
619
619
  * @private
620
620
  */
621
621
  rgbColorToHex_(red, green, blue) {
@@ -636,34 +636,34 @@ shaka.cea.Cea708Service = class {
636
636
  };
637
637
 
638
638
  /**
639
- * @private @const {!number}
639
+ * @private @const {number}
640
640
  */
641
641
  shaka.cea.Cea708Service.ASCII_BACKSPACE = 0x08;
642
642
 
643
643
  /**
644
- * @private @const {!number}
644
+ * @private @const {number}
645
645
  */
646
646
  shaka.cea.Cea708Service.ASCII_FORM_FEED = 0x0c;
647
647
 
648
648
  /**
649
- * @private @const {!number}
649
+ * @private @const {number}
650
650
  */
651
651
  shaka.cea.Cea708Service.ASCII_CARRIAGE_RETURN = 0x0d;
652
652
 
653
653
  /**
654
- * @private @const {!number}
654
+ * @private @const {number}
655
655
  */
656
656
  shaka.cea.Cea708Service.ASCII_HOR_CARRIAGE_RETURN = 0x0e;
657
657
 
658
658
  /**
659
659
  * For extended control codes in block_data on CEA-708, byte 1 is 0x10.
660
- * @private @const {!number}
660
+ * @private @const {number}
661
661
  */
662
662
  shaka.cea.Cea708Service.EXT_CEA708_CTRL_CODE_BYTE1 = 0x10;
663
663
 
664
664
  /**
665
665
  * Holds characters mapping for bytes that are G2 control codes.
666
- * @private @const {!Map<!number, !string>}
666
+ * @private @const {!Map<number, string>}
667
667
  */
668
668
  shaka.cea.Cea708Service.G2Charset = new Map([
669
669
  [0x20, ' '], [0x21, '\xa0'], [0x25, '…'], [0x2a, 'Š'], [0x2c, 'Œ'],
@@ -675,7 +675,7 @@ shaka.cea.Cea708Service.G2Charset = new Map([
675
675
 
676
676
  /**
677
677
  * An array of 8 colors that 64 colors can be quantized to. Order here matters.
678
- * @private @const {!Array<!string>}
678
+ * @private @const {!Array<string>}
679
679
  */
680
680
  shaka.cea.Cea708Service.Colors = [
681
681
  'black', 'blue', 'green', 'cyan',
@@ -691,12 +691,12 @@ shaka.cea.Cea708Service.Colors = [
691
691
  * order: number
692
692
  * }}
693
693
  *
694
- * @property {!number} pts
694
+ * @property {number} pts
695
695
  * Presentation timestamp (in second) at which this packet was received.
696
- * @property {!number} type
696
+ * @property {number} type
697
697
  * Type of the byte. Either 2 or 3, DTVCC Packet Data or a DTVCC Packet Start.
698
- * @property {!number} value The byte containing data relevant to the packet.
699
- * @property {!number} order
698
+ * @property {number} value The byte containing data relevant to the packet.
699
+ * @property {number} order
700
700
  * A number indicating the order this packet was received in a sequence
701
701
  * of packets. Used to break ties in a stable sorting algorithm
702
702
  */
@@ -18,38 +18,38 @@ goog.require('shaka.util.Functional');
18
18
  */
19
19
  shaka.cea.Cea708Window = class {
20
20
  /**
21
- * @param {!number} windowNum
21
+ * @param {number} windowNum
22
22
  */
23
23
  constructor(windowNum) {
24
24
  /**
25
25
  * A number from 0 - 7 indicating the window number in the
26
26
  * service that owns this window.
27
- * @private {!number}
27
+ * @private {number}
28
28
  */
29
29
  this.windowNum_ = windowNum;
30
30
 
31
31
  /**
32
32
  * Indicates whether this window is visible.
33
- * @private {!boolean}
33
+ * @private {boolean}
34
34
  */
35
35
  this.visible_ = false;
36
36
 
37
37
  /**
38
38
  * Indicates whether the horizontal and vertical anchors coordinates specify
39
39
  * a percentage of the screen, or physical coordinates on the screen.
40
- * @private {!boolean}
40
+ * @private {boolean}
41
41
  */
42
42
  this.relativeToggle_ = false;
43
43
 
44
44
  /**
45
45
  * Horizontal anchor. Loosely corresponds to a WebVTT viewport X anchor.
46
- * @private {!number}
46
+ * @private {number}
47
47
  */
48
48
  this.horizontalAnchor_ = 0;
49
49
 
50
50
  /**
51
51
  * Vertical anchor. Loosely corresponds to a WebVTT viewport Y anchor.
52
- * @private {!number}
52
+ * @private {number}
53
53
  */
54
54
  this.verticalAnchor_ = 0;
55
55
 
@@ -62,19 +62,19 @@ shaka.cea.Cea708Window = class {
62
62
  * 6________7________8
63
63
  * Diagram is valid as per CEA-708-E section 8.4.4.
64
64
  * Each of these locations corresponds to a WebVTT region's "region anchor".
65
- * @private {!number}
65
+ * @private {number}
66
66
  */
67
67
  this.anchorId_ = 0;
68
68
 
69
69
  /**
70
70
  * Indicates the number of rows in this window's buffer/memory.
71
- * @private {!number}
71
+ * @private {number}
72
72
  */
73
73
  this.rowCount_ = 0;
74
74
 
75
75
  /**
76
76
  * Indicates the number of columns in this window's buffer/memory.
77
- * @private {!number}
77
+ * @private {number}
78
78
  */
79
79
  this.colCount_ = 0;
80
80
 
@@ -92,43 +92,43 @@ shaka.cea.Cea708Window = class {
92
92
  this.memory_ = [];
93
93
 
94
94
  /**
95
- * @private {!number}
95
+ * @private {number}
96
96
  */
97
97
  this.startTime_ = 0;
98
98
 
99
99
  /**
100
100
  * Row that the current pen is pointing at.
101
- * @private {!number}
101
+ * @private {number}
102
102
  */
103
103
  this.row_ = 0;
104
104
 
105
105
  /**
106
106
  * Column that the current pen is pointing at.
107
- * @private {!number}
107
+ * @private {number}
108
108
  */
109
109
  this.col_ = 0;
110
110
 
111
111
  /**
112
112
  * Indicates whether the current pen position is italicized.
113
- * @private {!boolean}
113
+ * @private {boolean}
114
114
  */
115
115
  this.italics_ = false;
116
116
 
117
117
  /**
118
118
  * Indicates whether the current pen position is underlined.
119
- * @private {!boolean}
119
+ * @private {boolean}
120
120
  */
121
121
  this.underline_ = false;
122
122
 
123
123
  /**
124
124
  * Indicates the text color at the current pen position.
125
- * @private {!string}
125
+ * @private {string}
126
126
  */
127
127
  this.textColor_ = shaka.cea.CeaUtils.DEFAULT_TXT_COLOR;
128
128
 
129
129
  /**
130
130
  * Indicates the background color at the current pen position.
131
- * @private {!string}
131
+ * @private {string}
132
132
  */
133
133
  this.backgroundColor_ = shaka.cea.CeaUtils.DEFAULT_BG_COLOR;
134
134
 
@@ -141,13 +141,13 @@ shaka.cea.Cea708Window = class {
141
141
  }
142
142
 
143
143
  /**
144
- * @param {!boolean} visible
145
- * @param {!number} verticalAnchor
146
- * @param {!number} horizontalAnchor
147
- * @param {!number} anchorId
148
- * @param {!boolean} relativeToggle
149
- * @param {!number} rowCount
150
- * @param {!number} colCount
144
+ * @param {boolean} visible
145
+ * @param {number} verticalAnchor
146
+ * @param {number} horizontalAnchor
147
+ * @param {number} anchorId
148
+ * @param {boolean} relativeToggle
149
+ * @param {number} rowCount
150
+ * @param {number} colCount
151
151
  */
152
152
  defineWindow(visible, verticalAnchor, horizontalAnchor, anchorId,
153
153
  relativeToggle, rowCount, colCount) {
@@ -185,7 +185,7 @@ shaka.cea.Cea708Window = class {
185
185
 
186
186
  /**
187
187
  * Sets the unicode value for a char at the current pen location.
188
- * @param {!string} char
188
+ * @param {string} char
189
189
  */
190
190
  setCharacter(char) {
191
191
  // Check if the pen is out of bounds.
@@ -238,7 +238,7 @@ shaka.cea.Cea708Window = class {
238
238
  }
239
239
 
240
240
  /**
241
- * @return {!boolean}
241
+ * @return {boolean}
242
242
  */
243
243
  isVisible() {
244
244
  return this.visible_;
@@ -246,7 +246,7 @@ shaka.cea.Cea708Window = class {
246
246
 
247
247
  /**
248
248
  * Moves up <count> rows in the buffer.
249
- * @param {!number} count
249
+ * @param {number} count
250
250
  * @private
251
251
  */
252
252
  moveUpRows_(count) {
@@ -286,8 +286,8 @@ shaka.cea.Cea708Window = class {
286
286
  }
287
287
 
288
288
  /**
289
- * @param {!number} endTime
290
- * @param {!number} serviceNumber Number of the service emitting this caption.
289
+ * @param {number} endTime
290
+ * @param {number} serviceNumber Number of the service emitting this caption.
291
291
  * @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
292
292
  */
293
293
  forceEmit(endTime, serviceNumber) {
@@ -318,8 +318,8 @@ shaka.cea.Cea708Window = class {
318
318
  }
319
319
 
320
320
  /**
321
- * @param {!number} row
322
- * @param {!number} col
321
+ * @param {number} row
322
+ * @param {number} col
323
323
  */
324
324
  setPenLocation(row, col) {
325
325
  this.row_ = row;
@@ -327,28 +327,28 @@ shaka.cea.Cea708Window = class {
327
327
  }
328
328
 
329
329
  /**
330
- * @param {!string} backgroundColor
330
+ * @param {string} backgroundColor
331
331
  */
332
332
  setPenBackgroundColor(backgroundColor) {
333
333
  this.backgroundColor_ = backgroundColor;
334
334
  }
335
335
 
336
336
  /**
337
- * @param {!string} textColor
337
+ * @param {string} textColor
338
338
  */
339
339
  setPenTextColor(textColor) {
340
340
  this.textColor_ = textColor;
341
341
  }
342
342
 
343
343
  /**
344
- * @param {!boolean} underline
344
+ * @param {boolean} underline
345
345
  */
346
346
  setPenUnderline(underline) {
347
347
  this.underline_ = underline;
348
348
  }
349
349
 
350
350
  /**
351
- * @param {!boolean} italics
351
+ * @param {boolean} italics
352
352
  */
353
353
  setPenItalics(italics) {
354
354
  this.italics_ = italics;
@@ -394,7 +394,7 @@ shaka.cea.Cea708Window = class {
394
394
 
395
395
  /**
396
396
  * Sets the start time for the cue to be emitted.
397
- * @param {!number} pts
397
+ * @param {number} pts
398
398
  */
399
399
  setStartTime(pts) {
400
400
  this.startTime_ = pts;
@@ -403,7 +403,7 @@ shaka.cea.Cea708Window = class {
403
403
 
404
404
  /**
405
405
  * Caption type.
406
- * @const @enum {!number}
406
+ * @const @enum {number}
407
407
  */
408
408
  shaka.cea.Cea708Window.TextJustification = {
409
409
  LEFT: 0,
@@ -415,12 +415,12 @@ shaka.cea.Cea708Window.TextJustification = {
415
415
  /**
416
416
  * Can be indexed 0-31 for 4:3 format, and 0-41 for 16:9 formats.
417
417
  * Thus the absolute maximum is 42 columns for the 16:9 format.
418
- * @private @const {!number}
418
+ * @private @const {number}
419
419
  */
420
420
  shaka.cea.Cea708Window.MAX_COLS = 42;
421
421
 
422
422
  /**
423
423
  * Maximum of 15 rows that can be indexed from 0 to 14.
424
- * @private @const {!number}
424
+ * @private @const {number}
425
425
  */
426
426
  shaka.cea.Cea708Window.MAX_ROWS = 15;
@@ -6,15 +6,14 @@
6
6
 
7
7
  goog.provide('shaka.cea.CeaDecoder');
8
8
 
9
- goog.require('shaka.cea.Cea708Service');
10
9
  goog.require('shaka.cea.Cea608DataChannel');
10
+ goog.require('shaka.cea.Cea708Service');
11
11
  goog.require('shaka.cea.DtvccPacketBuilder');
12
12
  goog.require('shaka.cea.ICaptionDecoder');
13
13
  goog.require('shaka.log');
14
14
  goog.require('shaka.util.DataViewReader');
15
15
  goog.require('shaka.util.Error');
16
16
  goog.requireType('shaka.cea.DtvccPacket');
17
- goog.requireType('shaka.cea.ICaptionDecoder.ClosedCaption');
18
17
 
19
18
 
20
19
  /**
@@ -44,13 +43,13 @@ shaka.cea.CeaDecoder = class {
44
43
 
45
44
  /**
46
45
  * Number of consecutive bad frames decoded on CEA-608.
47
- * @private {!number}
46
+ * @private {number}
48
47
  */
49
48
  this.badFrames_ = 0;
50
49
 
51
50
  /**
52
51
  * A map containing the stream for each mode.
53
- * @private {!Map<!string, !shaka.cea.Cea608DataChannel>}
52
+ * @private {!Map<string, !shaka.cea.Cea608DataChannel>}
54
53
  */
55
54
  this.cea608ModeToStream_ = new Map([
56
55
  ['CC1', new shaka.cea.Cea608DataChannel(0, 0)], // F1 + C1 -> CC1
@@ -61,20 +60,20 @@ shaka.cea.CeaDecoder = class {
61
60
 
62
61
  /**
63
62
  * The current channel that is active on CEA-608 field 1.
64
- * @private {!number}
63
+ * @private {number}
65
64
  */
66
65
  this.currentField1Channel_ = 0;
67
66
 
68
67
  /**
69
68
  * The current channel that is active on CEA-608 field 2.
70
- * @private {!number}
69
+ * @private {number}
71
70
  */
72
71
  this.currentField2Channel_ = 0;
73
72
 
74
73
  /**
75
74
  * Map of service number to CEA-708 services, initially empty. Since there
76
75
  * can be up to 63 services, they are created dynamically only when needed.
77
- * @private {!Map<!number, shaka.cea.Cea708Service>}
76
+ * @private {!Map<number, shaka.cea.Cea708Service>}
78
77
  */
79
78
  this.serviceNumberToService_ = new Map();
80
79
 
@@ -361,8 +360,8 @@ shaka.cea.CeaDecoder = class {
361
360
 
362
361
  /**
363
362
  * Checks if a byte has odd parity (Odd number of 1s in binary).
364
- * @param {!number} byte
365
- * @return {!boolean} True if the byte has odd parity.
363
+ * @param {number} byte
364
+ * @return {boolean} True if the byte has odd parity.
366
365
  * @private
367
366
  */
368
367
  isOddParity_(byte) {
@@ -377,29 +376,29 @@ shaka.cea.CeaDecoder = class {
377
376
 
378
377
  /**
379
378
  * itu_t_35_provider_code for ATSC user_data
380
- * @private @const {!number}
379
+ * @private @const {number}
381
380
  */
382
381
  shaka.cea.CeaDecoder.ATSC_PROVIDER_CODE = 0x0031;
383
382
 
384
383
  /**
385
384
  * When provider is ATSC user data, the ATSC_user_identifier code
386
385
  * for ATSC1_data is "GA94" (0x47413934)
387
- * @private @const {!number}
386
+ * @private @const {number}
388
387
  */
389
388
  shaka.cea.CeaDecoder.ATSC1_USER_IDENTIFIER = 0x47413934;
390
389
 
391
390
  /**
392
- * @private @const {!number}
391
+ * @private @const {number}
393
392
  */
394
393
  shaka.cea.CeaDecoder.NTSC_CC_FIELD_1 = 0;
395
394
 
396
395
  /**
397
- * @private @const {!number}
396
+ * @private @const {number}
398
397
  */
399
398
  shaka.cea.CeaDecoder.NTSC_CC_FIELD_2 = 1;
400
399
 
401
400
  /**
402
401
  * 0xB5 is USA's code (Rec. ITU-T T.35)
403
- * @private @const {!number}
402
+ * @private @const {number}
404
403
  */
405
404
  shaka.cea.CeaDecoder.USA_COUNTRY_CODE = 0xb5;