shaka-player 3.2.2 → 3.3.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 (188) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +1 -1
  3. package/.github/ISSUE_TEMPLATE/question.md +1 -1
  4. package/.github/workflows/build_and_test.yaml +73 -0
  5. package/.github/workflows/release.yaml +53 -0
  6. package/AUTHORS +6 -5
  7. package/CHANGELOG.md +314 -1
  8. package/CONTRIBUTORS +4 -2
  9. package/build/checkversion.py +1 -1
  10. package/build/conformance.textproto +183 -169
  11. package/build/test.py +6 -0
  12. package/build/types/core +3 -0
  13. package/build/types/offline +1 -0
  14. package/build/types/polyfill +1 -0
  15. package/build/types/ui +2 -0
  16. package/demo/common/assets.js +18 -0
  17. package/demo/common/message_ids.js +13 -1
  18. package/demo/config.js +31 -1
  19. package/demo/index.html +1 -1
  20. package/demo/locales/en.json +12 -0
  21. package/demo/locales/source.json +48 -0
  22. package/dist/controls.css +26 -2
  23. package/dist/controls.css.map +1 -1
  24. package/dist/demo.compiled.debug.js +19 -16
  25. package/dist/demo.compiled.debug.map +3 -3
  26. package/dist/demo.compiled.js +19 -16
  27. package/dist/demo.compiled.map +3 -3
  28. package/dist/deps.js +21 -14
  29. package/dist/locales.js +31 -29
  30. package/dist/receiver.compiled.debug.js +11 -9
  31. package/dist/receiver.compiled.debug.map +3 -3
  32. package/dist/receiver.compiled.js +11 -9
  33. package/dist/receiver.compiled.map +3 -3
  34. package/dist/shaka-player.compiled.d.ts +232 -18
  35. package/dist/shaka-player.compiled.debug.d.ts +232 -18
  36. package/dist/shaka-player.compiled.debug.externs.js +293 -17
  37. package/dist/shaka-player.compiled.debug.js +481 -422
  38. package/dist/shaka-player.compiled.debug.map +4 -4
  39. package/dist/shaka-player.compiled.externs.js +293 -17
  40. package/dist/shaka-player.compiled.js +846 -817
  41. package/dist/shaka-player.compiled.map +4 -4
  42. package/dist/shaka-player.ui.d.ts +250 -30
  43. package/dist/shaka-player.ui.debug.d.ts +250 -30
  44. package/dist/shaka-player.ui.debug.externs.js +322 -28
  45. package/dist/shaka-player.ui.debug.js +630 -553
  46. package/dist/shaka-player.ui.debug.map +4 -4
  47. package/dist/shaka-player.ui.externs.js +322 -28
  48. package/dist/shaka-player.ui.js +1048 -1006
  49. package/dist/shaka-player.ui.map +4 -4
  50. package/docs/design/bg-fetch-after.gv +29 -0
  51. package/docs/design/bg-fetch-after.gv.png +0 -0
  52. package/docs/design/bg-fetch-before.gv +18 -0
  53. package/docs/design/bg-fetch-before.gv.png +0 -0
  54. package/docs/design/bg-fetch.md +134 -0
  55. package/docs/tutorials/blob-url.md +15 -0
  56. package/docs/tutorials/index.json +1 -0
  57. package/docs/tutorials/ui-customization.md +66 -0
  58. package/docs/tutorials/ui.md +5 -5
  59. package/externs/cmcd.js +186 -0
  60. package/externs/ima.js +3 -0
  61. package/externs/shaka/ads.js +5 -0
  62. package/externs/shaka/manifest.js +12 -1
  63. package/externs/shaka/manifest_parser.js +10 -1
  64. package/externs/shaka/net.js +20 -4
  65. package/externs/shaka/offline.js +31 -2
  66. package/externs/shaka/player.js +138 -5
  67. package/externs/shaka/text.js +24 -0
  68. package/externs/webcrypto.js +18 -0
  69. package/karma.conf.js +19 -15
  70. package/lib/abr/ewma.js +14 -0
  71. package/lib/abr/ewma_bandwidth_estimator.js +16 -2
  72. package/lib/abr/simple_abr_manager.js +6 -0
  73. package/lib/ads/ad_manager.js +1 -0
  74. package/lib/ads/client_side_ad.js +8 -0
  75. package/lib/ads/client_side_ad_manager.js +8 -4
  76. package/lib/ads/server_side_ad.js +7 -0
  77. package/lib/cast/cast_proxy.js +3 -0
  78. package/lib/cast/cast_receiver.js +3 -0
  79. package/lib/cast/cast_utils.js +1 -0
  80. package/lib/dash/dash_parser.js +79 -33
  81. package/lib/dash/segment_base.js +25 -1
  82. package/lib/dash/segment_list.js +18 -9
  83. package/lib/dash/segment_template.js +23 -10
  84. package/lib/hls/hls_parser.js +116 -23
  85. package/lib/hls/manifest_text_parser.js +1 -0
  86. package/lib/media/quality_observer.js +274 -0
  87. package/lib/media/region_observer.js +39 -33
  88. package/lib/media/region_timeline.js +17 -19
  89. package/lib/media/segment_index.js +8 -1
  90. package/lib/media/segment_reference.js +37 -4
  91. package/lib/media/streaming_engine.js +47 -6
  92. package/lib/net/http_fetch_plugin.js +31 -11
  93. package/lib/net/http_plugin_utils.js +1 -0
  94. package/lib/net/http_xhr_plugin.js +40 -14
  95. package/lib/net/networking_engine.js +85 -18
  96. package/lib/offline/download_info.js +68 -0
  97. package/lib/offline/download_manager.js +13 -5
  98. package/lib/offline/indexeddb/base_storage_cell.js +35 -0
  99. package/lib/offline/indexeddb/storage_mechanism.js +1 -1
  100. package/lib/offline/indexeddb/v5_storage_cell.js +5 -0
  101. package/lib/offline/storage.js +401 -293
  102. package/lib/offline/stored_content_utils.js +2 -0
  103. package/lib/player.js +254 -27
  104. package/lib/polyfill/media_capabilities.js +30 -15
  105. package/lib/polyfill/random_uuid.js +52 -0
  106. package/lib/text/cue.js +18 -0
  107. package/lib/text/ttml_text_parser.js +109 -60
  108. package/lib/text/ui_text_displayer.js +19 -13
  109. package/lib/util/cmcd_manager.js +672 -0
  110. package/lib/util/error.js +6 -0
  111. package/lib/util/fake_event_target.js +21 -1
  112. package/lib/util/language_utils.js +12 -0
  113. package/lib/util/mutex.js +52 -0
  114. package/lib/util/periods.js +98 -64
  115. package/lib/util/player_configuration.js +18 -0
  116. package/lib/util/stream_utils.js +86 -10
  117. package/lib/util/xml_utils.js +19 -0
  118. package/package.json +3 -6
  119. package/shaka-player.uncompiled.js +3 -0
  120. package/test/dash/dash_parser_content_protection_unit.js +2 -0
  121. package/test/dash/dash_parser_live_unit.js +144 -1
  122. package/test/dash/dash_parser_manifest_unit.js +37 -2
  123. package/test/dash/dash_parser_segment_base_unit.js +2 -0
  124. package/test/dash/dash_parser_segment_list_unit.js +2 -1
  125. package/test/dash/dash_parser_segment_template_unit.js +2 -1
  126. package/test/hls/hls_live_unit.js +2 -0
  127. package/test/hls/hls_parser_unit.js +76 -0
  128. package/test/media/drm_engine_unit.js +3 -3
  129. package/test/media/quality_observer_unit.js +142 -0
  130. package/test/media/region_observer_unit.js +40 -5
  131. package/test/media/region_timeline_unit.js +40 -22
  132. package/test/media/segment_reference_unit.js +16 -1
  133. package/test/media/streaming_engine_integration.js +4 -2
  134. package/test/media/streaming_engine_unit.js +147 -0
  135. package/test/net/http_plugin_unit.js +20 -15
  136. package/test/offline/storage_integration.js +108 -4
  137. package/test/player_integration.js +140 -8
  138. package/test/player_src_equals_integration.js +41 -8
  139. package/test/player_unit.js +19 -9
  140. package/test/test/assets/chapters.vtt +2 -2
  141. package/test/test/assets/chapters2.vtt +10 -0
  142. package/test/test/util/dash_parser_util.js +4 -0
  143. package/test/test/util/fake_ad.js +7 -0
  144. package/test/test/util/fake_drm_engine.js +9 -2
  145. package/test/test/util/manifest_generator.js +3 -2
  146. package/test/test/util/test_scheme.js +14 -1
  147. package/test/test/util/ttml_utils.js +81 -0
  148. package/test/test/util/util.js +10 -7
  149. package/test/text/mp4_ttml_parser_unit.js +11 -18
  150. package/test/text/ttml_text_parser_unit.js +544 -228
  151. package/test/ui/text_displayer_layout_unit.js +8 -7
  152. package/test/ui/ui_unit.js +250 -0
  153. package/test/util/cmcd_manager_unit.js +291 -0
  154. package/test/util/stream_utils_unit.js +36 -30
  155. package/third_party/closure-uri/uri.js +21 -0
  156. package/ui/airplay_button.js +1 -0
  157. package/ui/audio_language_selection.js +7 -0
  158. package/ui/cast_button.js +1 -0
  159. package/ui/context_menu.js +109 -0
  160. package/ui/controls.js +44 -7
  161. package/ui/controls.less +1 -0
  162. package/ui/enums.js +4 -0
  163. package/ui/externs/ui.js +28 -1
  164. package/ui/fast_forward_button.js +14 -5
  165. package/ui/fullscreen_button.js +1 -0
  166. package/ui/less/buttons.less +0 -4
  167. package/ui/less/containers.less +74 -0
  168. package/ui/less/overflow_menu.less +0 -10
  169. package/ui/less/tooltip.less +97 -0
  170. package/ui/locales/en.json +1 -0
  171. package/ui/locales/source.json +4 -0
  172. package/ui/localization.js +12 -36
  173. package/ui/loop_button.js +5 -0
  174. package/ui/mute_button.js +2 -1
  175. package/ui/overflow_menu.js +5 -25
  176. package/ui/pip_button.js +5 -0
  177. package/ui/play_button.js +2 -2
  178. package/ui/playback_rate_selection.js +8 -9
  179. package/ui/resolution_selection.js +7 -0
  180. package/ui/rewind_button.js +15 -6
  181. package/ui/seek_bar.js +4 -2
  182. package/ui/settings_menu.js +36 -4
  183. package/ui/small_play_button.js +1 -0
  184. package/ui/statistics_button.js +253 -0
  185. package/ui/text_selection.js +12 -4
  186. package/ui/ui.js +30 -0
  187. package/ui/volume_bar.js +1 -1
  188. package/externs/media_capabilities.js +0 -16
@@ -12,297 +12,311 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
-
16
15
  # Conformance requirements:
17
16
  # See: https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework
18
17
 
19
-
20
18
  # Disallow throwing non-Error types.
21
19
  requirement: {
22
20
  type: CUSTOM
23
- java_class:
24
- 'com.google.javascript.jscomp.ConformanceRules$BanThrowOfNonErrorTypes'
25
- error_message: 'Throwing non-Error types or Error itself is not allowed; '
26
- 'throw shaka.util.Error instead.'
27
- whitelist_regexp: 'test/'
28
- whitelist_regexp: 'node_modules/'
21
+ java_class: "com.google.javascript.jscomp.ConformanceRules$BanThrowOfNonErrorTypes"
22
+ error_message:
23
+ "Throwing non-Error types or Error itself is not allowed; "
24
+ "throw shaka.util.Error instead."
25
+ whitelist_regexp: "test/"
26
+ whitelist_regexp: "node_modules/"
29
27
  }
30
28
  requirement: {
31
29
  type: BANNED_CODE_PATTERN
32
- value: 'function template() { throw new Error(); }'
33
- error_message: 'Throwing non-Error types or Error itself is not allowed; '
34
- 'throw shaka.util.Error instead.'
35
- whitelist_regexp: 'test/'
36
- whitelist_regexp: 'node_modules/'
30
+ value: "function template() { throw new Error(); }"
31
+ error_message:
32
+ "Throwing non-Error types or Error itself is not allowed; "
33
+ "throw shaka.util.Error instead."
34
+ whitelist_regexp: "test/"
35
+ whitelist_regexp: "node_modules/"
37
36
  }
38
37
 
39
-
40
38
  # Ban accessing members of unknown types.
41
39
  requirement: {
42
40
  type: CUSTOM
43
- java_class: 'com.google.javascript.jscomp.ConformanceRules$'
44
- 'BanUnknownTypedClassPropsReferences'
45
- error_message: 'Using properties of unknown types is not allowed; add an '
46
- 'explicit type to the variable.'
47
- whitelist_regexp: 'demo/'
41
+ java_class:
42
+ "com.google.javascript.jscomp.ConformanceRules$"
43
+ "BanUnknownTypedClassPropsReferences"
44
+ error_message:
45
+ "Using properties of unknown types is not allowed; add an "
46
+ "explicit type to the variable."
47
+ whitelist_regexp: "demo/"
48
48
  }
49
49
  requirement {
50
50
  type: CUSTOM
51
- java_class: 'com.google.javascript.jscomp.ConformanceRules$BanUnknownThis'
52
- error_message: 'Failed to infer type of "this"; '
53
- 'please be explicit or use bind!'
51
+ java_class: "com.google.javascript.jscomp.ConformanceRules$BanUnknownThis"
52
+ error_message:
53
+ "Failed to infer type of \"this\"; "
54
+ "please be explicit or use bind!"
54
55
  # Until we can get this rule updated for ES6 static methods
55
56
  # (https://github.com/google/closure-compiler/issues/2880):
56
- whitelist_regexp: 'test/test/util/canned_idb.js'
57
- whitelist_regexp: 'test/assets/assets_integration.js'
57
+ whitelist_regexp: "test/test/util/canned_idb.js"
58
+ whitelist_regexp: "test/assets/assets_integration.js"
58
59
  }
59
60
 
60
-
61
61
  # Reject unresolved types.
62
62
  requirement {
63
63
  type: CUSTOM
64
- java_class: 'com.google.javascript.jscomp.ConformanceRules$BanUnresolvedType'
65
- error_message: 'Failed to resolve type!'
64
+ java_class: "com.google.javascript.jscomp.ConformanceRules$BanUnresolvedType"
65
+ error_message: "Failed to resolve type!"
66
66
  }
67
67
 
68
-
69
68
  # Reject global variables.
70
69
  requirement {
71
70
  type: CUSTOM
72
- java_class: 'com.google.javascript.jscomp.ConformanceRules$BanGlobalVars'
73
- error_message: 'Global variables are not allowed!'
74
- whitelist_regexp: 'demo/'
75
- whitelist_regexp: 'test/'
76
- whitelist_regexp: 'node_modules/'
71
+ java_class: "com.google.javascript.jscomp.ConformanceRules$BanGlobalVars"
72
+ error_message: "Global variables are not allowed!"
73
+ whitelist_regexp: "demo/"
74
+ whitelist_regexp: "test/"
75
+ whitelist_regexp: "node_modules/"
77
76
  }
78
77
 
79
-
80
78
  # Disallow using "!" on nullable numbers in boolean assignment.
81
79
  # Note: we can't use the pattern "var b = !n" because it causes too many
82
80
  # false positives.
83
81
  requirement: {
84
82
  type: BANNED_CODE_PATTERN
85
- value: '/** @param {boolean} b @param {?number} n */ '
86
- 'function template(b, n) { b = !n; }'
87
- error_message: 'Using "!" on nullable numbers in boolean assignment '
88
- 'is not allowed; use an explicit comparison instead.'
89
- whitelist_regexp: 'node_modules/'
83
+ value:
84
+ "/** @param {boolean} b @param {?number} n */ "
85
+ "function template(b, n) { b = !n; }"
86
+ error_message:
87
+ "Using \"!\" on nullable numbers in boolean assignment "
88
+ "is not allowed; use an explicit comparison instead."
89
+ whitelist_regexp: "node_modules/"
90
90
  }
91
91
 
92
92
  requirement: {
93
93
  type: BANNED_CODE_PATTERN
94
- value: '/** @param {*} a'
95
- ' @param {(number|string|boolean|null|undefined)} x */'
96
- 'function template(a, x) { expect(a).toEqual(x); }'
97
- value: '/** @param {*} a'
98
- ' @param {(number|string|boolean|null|undefined)} x */'
99
- 'function template(a, x) { expect(a).not.toEqual(x); }'
100
- error_message: 'Use expect.toBe for primitives'
94
+ value:
95
+ "/** @param {*} a"
96
+ " @param {(number|string|boolean|null|undefined)} x */"
97
+ "function template(a, x) { expect(a).toEqual(x); }"
98
+ value:
99
+ "/** @param {*} a"
100
+ " @param {(number|string|boolean|null|undefined)} x */"
101
+ "function template(a, x) { expect(a).not.toEqual(x); }"
102
+ error_message: "Use expect.toBe for primitives"
101
103
  }
102
104
 
103
105
  requirement: {
104
106
  type: BANNED_CODE_PATTERN
105
- value: '/** @param {BufferSource} a */'
106
- 'function template(a) { new Uint8Array(a) }'
107
- value: '/** @param {BufferSource} a */'
108
- 'function template(a) { new Int8Array(a) }'
109
- value: '/** @param {BufferSource} a */'
110
- 'function template(a) { new Uint8ClampedArray(a) }'
111
- value: '/** @param {BufferSource} a */'
112
- 'function template(a) { new Unt16Array(a) }'
113
- value: '/** @param {BufferSource} a */'
114
- 'function template(a) { new Int16Array(a) }'
115
- value: '/** @param {BufferSource} a */'
116
- 'function template(a) { new Uint32Array(a) }'
117
- value: '/** @param {BufferSource} a */'
118
- 'function template(a) { new Int32Array(a) }'
119
- value: '/** @param {BufferSource} a */'
120
- 'function template(a) { new Float32Array(a) }'
121
- value: '/** @param {BufferSource} a */'
122
- 'function template(a) { new Float64Array(a) }'
123
- error_message: 'Use shaka.util.BufferUtils.view* instead.'
124
- whitelist_regexp: 'lib/util/buffer_utils.js'
107
+ value:
108
+ "/** @param {BufferSource} a */"
109
+ "function template(a) { new Uint8Array(a) }"
110
+ value:
111
+ "/** @param {BufferSource} a */"
112
+ "function template(a) { new Int8Array(a) }"
113
+ value:
114
+ "/** @param {BufferSource} a */"
115
+ "function template(a) { new Uint8ClampedArray(a) }"
116
+ value:
117
+ "/** @param {BufferSource} a */"
118
+ "function template(a) { new Unt16Array(a) }"
119
+ value:
120
+ "/** @param {BufferSource} a */"
121
+ "function template(a) { new Int16Array(a) }"
122
+ value:
123
+ "/** @param {BufferSource} a */"
124
+ "function template(a) { new Uint32Array(a) }"
125
+ value:
126
+ "/** @param {BufferSource} a */"
127
+ "function template(a) { new Int32Array(a) }"
128
+ value:
129
+ "/** @param {BufferSource} a */"
130
+ "function template(a) { new Float32Array(a) }"
131
+ value:
132
+ "/** @param {BufferSource} a */"
133
+ "function template(a) { new Float64Array(a) }"
134
+ error_message: "Use shaka.util.BufferUtils.view* instead."
135
+ whitelist_regexp: "lib/util/buffer_utils.js"
125
136
  }
126
137
 
127
138
  requirement: {
128
139
  type: BANNED_CODE_PATTERN
129
- value: 'function template () { new Date().getTime() }'
130
- error_message: 'Use Date.now() instead.'
140
+ value: "function template () { new Date().getTime() }"
141
+ error_message: "Use Date.now() instead."
131
142
  }
132
143
 
133
144
  # Disallow console logging.
134
145
  requirement: {
135
146
  type: BANNED_PROPERTY_CALL
136
- value: 'Console.prototype.debug'
137
- value: 'Console.prototype.log'
138
- value: 'Console.prototype.info'
139
- value: 'Console.prototype.warn'
140
- value: 'Console.prototype.error'
141
- error_message: 'Using "console" is not allowed; '
142
- 'use shaka.log instead'
143
- whitelist_regexp: 'demo/'
144
- whitelist_regexp: 'lib/debug/log.js'
145
- whitelist_regexp: 'test/test/boot.js'
146
- whitelist_regexp: 'node_modules/'
147
- whitelist_regexp: '[synthetic:es6/promise/promise]'
147
+ value: "Console.prototype.debug"
148
+ value: "Console.prototype.log"
149
+ value: "Console.prototype.info"
150
+ value: "Console.prototype.warn"
151
+ value: "Console.prototype.error"
152
+ error_message:
153
+ "Using \"console\" is not allowed; "
154
+ "use shaka.log instead"
155
+ whitelist_regexp: "demo/"
156
+ whitelist_regexp: "lib/debug/log.js"
157
+ whitelist_regexp: "test/test/boot.js"
158
+ whitelist_regexp: "node_modules/"
159
+ whitelist_regexp: "[synthetic:es6/promise/promise]"
148
160
  }
149
161
 
150
162
  # Disallow querySelector and querySelectorAll since they aren't supported on
151
163
  # Shaka Player Embedded.
152
164
  requirement: {
153
165
  type: BANNED_PROPERTY_CALL
154
- value: 'Element.prototype.querySelector'
155
- value: 'Document.prototype.querySelector'
156
- value: 'Element.prototype.querySelectorAll'
157
- value: 'Document.prototype.querySelectorAll'
158
- error_message: 'Use getElementsByTagName'
159
- whitelist_regexp: 'demo/'
160
- whitelist_regexp: 'ui/'
161
- whitelist_regexp: 'test/'
162
- whitelist_regexp: 'node_modules/'
166
+ value: "Element.prototype.querySelector"
167
+ value: "Document.prototype.querySelector"
168
+ value: "Element.prototype.querySelectorAll"
169
+ value: "Document.prototype.querySelectorAll"
170
+ error_message: "Use getElementsByTagName"
171
+ whitelist_regexp: "demo/"
172
+ whitelist_regexp: "ui/"
173
+ whitelist_regexp: "test/"
174
+ whitelist_regexp: "node_modules/"
163
175
  }
164
176
 
165
-
166
177
  # Disallow Element.children.
167
178
  requirement: {
168
179
  type: BANNED_PROPERTY
169
- value: 'Element.prototype.children'
170
- error_message: 'Using "Element.children" is not allowed; '
171
- 'use Node.childNodes instead'
180
+ value: "Element.prototype.children"
181
+ error_message:
182
+ "Using \"Element.children\" is not allowed; "
183
+ "use Node.childNodes instead"
172
184
  }
173
185
 
174
186
  requirement: {
175
187
  type: BANNED_PROPERTY
176
- value: 'DataView.prototype.buffer'
177
- value: 'TypedArray.prototype.buffer'
178
- error_message: 'Using "TypedArray.buffer" is not safe since it doesn\'t '
179
- 'handle sub-arrays'
180
- whitelist_regexp: 'lib/util/buffer_utils.js'
181
- whitelist_regexp: 'lib/util/object_utils.js'
182
- whitelist_regexp: 'test/util/buffer_utils_unit.js'
188
+ value: "DataView.prototype.buffer"
189
+ value: "TypedArray.prototype.buffer"
190
+ error_message:
191
+ "Using \"TypedArray.buffer\" is not safe since it doesn\'t "
192
+ "handle sub-arrays"
193
+ whitelist_regexp: "lib/util/buffer_utils.js"
194
+ whitelist_regexp: "lib/util/object_utils.js"
195
+ whitelist_regexp: "test/util/buffer_utils_unit.js"
183
196
  }
184
197
 
185
-
186
198
  # Disallow Element.innerHTML and outerHTML.
187
199
  requirement: {
188
200
  type: BANNED_PROPERTY
189
- value: 'Element.prototype.innerHTML'
190
- value: 'Element.prototype.outerHTML'
191
- error_message: 'Using "Element.innerHTML" or "Element.outerHTML" is not '
192
- 'allowed due to security concerns; use textContent, '
193
- 'appendChild, or removeChild instead'
194
- whitelist_regexp: 'test/test/util/util.js'
201
+ value: "Element.prototype.innerHTML"
202
+ value: "Element.prototype.outerHTML"
203
+ error_message:
204
+ "Using \"Element.innerHTML\" or \"Element.outerHTML\" is not "
205
+ "allowed due to security concerns; use textContent, "
206
+ "appendChild, or removeChild instead"
207
+ whitelist_regexp: "test/test/util/util.js"
195
208
  }
196
209
 
197
-
198
210
  # Disallow DOMRect.x and y.
199
211
  requirement: {
200
212
  type: BANNED_PROPERTY
201
- value: 'DOMRect.prototype.x'
202
- value: 'DOMRect.prototype.y'
203
- error_message: 'DOMRect "x" and "y" are not supported on legacy Edge; '
204
- 'use "left" and "top" instead.'
213
+ value: "DOMRect.prototype.x"
214
+ value: "DOMRect.prototype.y"
215
+ error_message:
216
+ "DOMRect \"x\" and \"y\" are not supported on legacy Edge; "
217
+ "use \"left\" and \"top\" instead."
205
218
  # The built-in set and map polyfills trigger this ban somehow.
206
- whitelist_regexp: 'synthetic:es6/'
219
+ whitelist_regexp: "synthetic:es6/"
207
220
  }
208
221
 
209
-
210
222
  # Disallow fdescribe.
211
223
  requirement: {
212
224
  type: BANNED_NAME
213
- value: 'fdescribe'
214
- error_message: 'Using "fdescribe" is not allowed'
225
+ value: "fdescribe"
226
+ error_message: "Using \"fdescribe\" is not allowed"
215
227
  }
216
228
 
217
-
218
229
  # Disallow fit.
219
230
  requirement: {
220
231
  type: BANNED_NAME
221
- value: 'fit'
222
- error_message: 'Using "fit" is not allowed'
223
- whitelist_regexp: 'test/player_external.js'
232
+ value: "fit"
233
+ error_message: "Using \"fit\" is not allowed"
234
+ whitelist_regexp: "test/player_external.js"
224
235
  }
225
236
 
226
-
227
237
  # Disallow setInterval.
228
238
  requirement: {
229
239
  type: BANNED_NAME
230
- value: 'window.setInterval'
231
- error_message: 'setInterval has several drawbacks, most of '
232
- 'all difficulty canceling and surprising behavior '
233
- 'when the device goes to sleep. Please use '
234
- 'shaka.util.Timer instead.'
235
- whitelist_regexp: 'demo/'
236
- whitelist_regexp: 'test/'
240
+ value: "window.setInterval"
241
+ error_message:
242
+ "setInterval has several drawbacks, most of "
243
+ "all difficulty canceling and surprising behavior "
244
+ "when the device goes to sleep. Please use "
245
+ "shaka.util.Timer instead."
246
+ whitelist_regexp: "demo/"
247
+ whitelist_regexp: "test/"
237
248
  }
238
249
  requirement: {
239
250
  type: BANNED_NAME
240
- value: 'setInterval'
241
- error_message: 'setInterval has several drawbacks, most of '
242
- 'all difficulty canceling and surprising behavior '
243
- 'when the device goes to sleep. Please use '
244
- 'shaka.util.Timer instead.'
245
- whitelist_regexp: 'demo/'
246
- whitelist_regexp: 'test/'
251
+ value: "setInterval"
252
+ error_message:
253
+ "setInterval has several drawbacks, most of "
254
+ "all difficulty canceling and surprising behavior "
255
+ "when the device goes to sleep. Please use "
256
+ "shaka.util.Timer instead."
257
+ whitelist_regexp: "demo/"
258
+ whitelist_regexp: "test/"
247
259
  }
248
260
 
249
261
  # Disallow setTimeout.
250
262
  requirement: {
251
263
  type: BANNED_NAME
252
- value: 'window.setTimeout'
253
- error_message: 'setTimeout has several drawbacks, most of '
254
- 'all difficulty canceling it. Please use '
255
- 'shaka.util.Timer instead.'
256
- whitelist_regexp: 'demo/'
257
- whitelist_regexp: 'test/'
258
- whitelist_regexp: 'lib/util/delayed_tick.js'
264
+ value: "window.setTimeout"
265
+ error_message:
266
+ "setTimeout has several drawbacks, most of "
267
+ "all difficulty canceling it. Please use "
268
+ "shaka.util.Timer instead."
269
+ whitelist_regexp: "demo/"
270
+ whitelist_regexp: "test/"
271
+ whitelist_regexp: "lib/util/delayed_tick.js"
259
272
  }
260
273
  requirement: {
261
274
  type: BANNED_NAME
262
- value: 'setTimeout'
263
- error_message: 'setTimeout has several drawbacks, most of '
264
- 'all difficulty canceling it. Please use '
265
- 'shaka.util.Timer instead.'
266
- whitelist_regexp: 'demo/'
267
- whitelist_regexp: 'test/'
275
+ value: "setTimeout"
276
+ error_message:
277
+ "setTimeout has several drawbacks, most of "
278
+ "all difficulty canceling it. Please use "
279
+ "shaka.util.Timer instead."
280
+ whitelist_regexp: "demo/"
281
+ whitelist_regexp: "test/"
268
282
  }
269
283
 
270
-
271
284
  # Disallow eval, except when testing for modern JS syntax in demo
272
285
  requirement: {
273
286
  type: BANNED_NAME
274
- value: 'window.eval'
275
- error_message: 'Using "eval" is not allowed'
276
- whitelist_regexp: 'demo/demo_utils.js'
277
- whitelist_regexp: 'node_modules/google-closure-library/closure/goog/base.js'
278
- whitelist_regexp: 'test/util/functional_unit.js'
287
+ value: "window.eval"
288
+ error_message: "Using \"eval\" is not allowed"
289
+ whitelist_regexp: "demo/demo_utils.js"
290
+ whitelist_regexp: "node_modules/google-closure-library/closure/goog/base.js"
291
+ whitelist_regexp: "test/util/functional_unit.js"
279
292
  }
280
293
  requirement: {
281
294
  type: BANNED_NAME
282
- value: 'eval'
283
- error_message: 'Using "eval" is not allowed'
284
- whitelist_regexp: 'demo/demo_utils.js'
285
- whitelist_regexp: 'node_modules/google-closure-library/closure/goog/base.js'
286
- whitelist_regexp: 'test/util/functional_unit.js'
295
+ value: "eval"
296
+ error_message: "Using \"eval\" is not allowed"
297
+ whitelist_regexp: "demo/demo_utils.js"
298
+ whitelist_regexp: "node_modules/google-closure-library/closure/goog/base.js"
299
+ whitelist_regexp: "test/util/functional_unit.js"
287
300
  }
288
301
 
289
-
290
302
  # Disallow ES6 methods.
291
303
  requirement: {
292
304
  type: BANNED_PROPERTY
293
- value: 'ArrayBuffer.prototype.slice'
294
- error_message: 'ArrayBuffer.slice is not allowed because it '
295
- 'is not supported on Tizen 2016'
305
+ value: "ArrayBuffer.prototype.slice"
306
+ error_message:
307
+ "ArrayBuffer.slice is not allowed because it "
308
+ "is not supported on Tizen 2016"
296
309
  }
297
310
 
298
311
  # Disallow the general use of fetch, which is not available on all supported
299
312
  # platforms.
300
313
  requirement: {
301
314
  type: BANNED_NAME_CALL
302
- value: 'fetch'
303
- value: 'window.fetch'
304
- error_message: 'Using "fetch" directly is not allowed; '
305
- 'use shaka.test.Util.fetch or NetworkingEngine.request '
306
- 'instead.'
307
- whitelist_regexp: 'lib/net/http_fetch_plugin.js'
315
+ value: "fetch"
316
+ value: "window.fetch"
317
+ error_message:
318
+ "Using \"fetch\" directly is not allowed; "
319
+ "use shaka.test.Util.fetch or NetworkingEngine.request "
320
+ "instead."
321
+ whitelist_regexp: "lib/net/http_fetch_plugin.js"
308
322
  }
package/build/test.py CHANGED
@@ -229,6 +229,11 @@ class Launcher:
229
229
  default=None,
230
230
  const=2,
231
231
  nargs='?')
232
+ running_commands.add_argument(
233
+ '--spec-hide-passed',
234
+ help='If provided, configure the spec reporter to hide passing tests.',
235
+ action='store_true',
236
+ default=False)
232
237
  running_commands.add_argument(
233
238
  '--test-custom-asset',
234
239
  help='Run asset playback tests on a custom manifest URI.',
@@ -358,6 +363,7 @@ class Launcher:
358
363
  'single_run',
359
364
  'uncompiled',
360
365
  'delay_tests',
366
+ 'spec_hide_passed',
361
367
  'test_custom_asset',
362
368
  'test_custom_license_server',
363
369
  'test_timeout',
package/build/types/core CHANGED
@@ -28,6 +28,7 @@
28
28
  +../../lib/media/playhead.js
29
29
  +../../lib/media/playhead_observer.js
30
30
  +../../lib/media/presentation_timeline.js
31
+ +../../lib/media/quality_observer.js
31
32
  +../../lib/media/region_observer.js
32
33
  +../../lib/media/region_timeline.js
33
34
  +../../lib/media/segment_index.js
@@ -58,6 +59,7 @@
58
59
  +../../lib/util/abortable_operation.js
59
60
  +../../lib/util/array_utils.js
60
61
  +../../lib/util/buffer_utils.js
62
+ +../../lib/util/cmcd_manager.js
61
63
  +../../lib/util/config_utils.js
62
64
  +../../lib/util/data_view_reader.js
63
65
  +../../lib/util/delayed_tick.js
@@ -82,6 +84,7 @@
82
84
  +../../lib/util/mp4_box_parsers.js
83
85
  +../../lib/util/mp4_parser.js
84
86
  +../../lib/util/multi_map.js
87
+ +../../lib/util/mutex.js
85
88
  +../../lib/util/networking.js
86
89
  +../../lib/util/object_utils.js
87
90
  +../../lib/util/operation_manager.js
@@ -1,5 +1,6 @@
1
1
  # The offline storage system and manifest parser plugin.
2
2
 
3
+ +../../lib/offline/download_info.js
3
4
  +../../lib/offline/download_manager.js
4
5
  +../../lib/offline/download_progress_estimator.js
5
6
  +../../lib/offline/indexeddb/base_storage_cell.js
@@ -13,6 +13,7 @@
13
13
  +../../lib/polyfill/patchedmediakeys_nop.js
14
14
  +../../lib/polyfill/patchedmediakeys_webkit.js
15
15
  +../../lib/polyfill/pip_webkit.js
16
+ +../../lib/polyfill/random_uuid.js
16
17
  +../../lib/polyfill/storage_estimate.js
17
18
  +../../lib/polyfill/video_play_promise.js
18
19
  +../../lib/polyfill/videoplaybackquality.js
package/build/types/ui CHANGED
@@ -9,6 +9,7 @@
9
9
  +../../ui/big_play_button.js
10
10
  +../../ui/airplay_button.js
11
11
  +../../ui/cast_button.js
12
+ +../../ui/context_menu.js
12
13
  +../../ui/controls.js
13
14
  +../../ui/constants.js
14
15
  +../../ui/enums.js
@@ -31,6 +32,7 @@
31
32
  +../../ui/small_play_button.js
32
33
  +../../ui/skip_ad_button.js
33
34
  +../../ui/spacer.js
35
+ +../../ui/statistics_button.js
34
36
  +../../ui/text_selection.js
35
37
  +../../ui/ui.js
36
38
  +../../ui/ui_utils.js
@@ -58,6 +58,10 @@ shakaAssets.AdTag = {
58
58
  'single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&' +
59
59
  'unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%' +
60
60
  '3Dlinear&correlator=',
61
+ SINGLE_NON_LINEAR_AD: 'https://pubads.g.doubleclick.net/gampad/ads?' +
62
+ 'sz=480x70&iu=/124319096/external/single_ad_samples&ciu_szs=300x250 ' +
63
+ '&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1' +
64
+ '&cust_params=deployment%3Ddevsite%26sample_ct%3Dnonlinear&correlator=',
61
65
  SINGLE_SKIPPABLE_AD: 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/' +
62
66
  '124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&' +
63
67
  'gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=' +
@@ -315,6 +319,20 @@ shakaAssets.testAssets = [
315
319
  .addFeature(shakaAssets.Feature.SURROUND)
316
320
  .addFeature(shakaAssets.Feature.OFFLINE)
317
321
  .addLicenseServer('com.widevine.alpha', 'https://cwip-shaka-proxy.appspot.com/no_auth'),
322
+ new ShakaDemoAssetInfo(
323
+ /* name= */ 'Angel One (HLS, MP4, multilingual, Widevine, single non-linear ad)',
324
+ /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/angel_one.png',
325
+ /* manifestUri= */ 'https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine-hls/hls.m3u8',
326
+ /* source= */ shakaAssets.Source.SHAKA)
327
+ .addKeySystem(shakaAssets.KeySystem.WIDEVINE)
328
+ .setAdTagUri(shakaAssets.AdTag.SINGLE_NON_LINEAR_AD)
329
+ .addFeature(shakaAssets.Feature.HLS)
330
+ .addFeature(shakaAssets.Feature.MP4)
331
+ .addFeature(shakaAssets.Feature.MULTIPLE_LANGUAGES)
332
+ .addFeature(shakaAssets.Feature.SUBTITLES)
333
+ .addFeature(shakaAssets.Feature.SURROUND)
334
+ .addFeature(shakaAssets.Feature.OFFLINE)
335
+ .addLicenseServer('com.widevine.alpha', 'https://cwip-shaka-proxy.appspot.com/no_auth'),
318
336
  new ShakaDemoAssetInfo(
319
337
  /* name= */ 'Sintel 4k (multicodec)',
320
338
  /* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/sintel.png',