Using goog.asserts will work with the compiler. So rather than
simply casting a nullable value when passing to a method, we can use
an assert which will correct the type and print a log if it somehow
is null.
This is not the same goog.asserts found in closure library, this
simply calls console.assert, but it is not required to do anything
for the compiler help.
Change-Id: I2548e39e772f0aa7ec41437cf9f5a2be383e0fbd
Before there were two style to indent comments after an annotation,
using 2 and 4 spaces. Now this only uses 2 spaces.
Change-Id: Id06415d7193cc154a2768fb3932aff7a06b7ed32
Fixes the following issues:
=====
lib/player.js:106: ERROR - Property id never defined on TextTrack
lib/util/xml_utils.js:42: ERROR - inconsistent return type
found : (Node|null)
required: (Element|null)
lib/dash/content_protection.js:256: ERROR - Parameter must have JSDoc.
function(element) {
lib/dash/content_protection.js:284: ERROR - Parameter must have JSDoc.
function(elem) {
lib/media/drm_engine.js:47: ERROR - Private property configuration_ is never read
lib/polyfill/patchedmediakeys_20140218.js:269: ERROR - Private property keySystem_ is never read
lib/polyfill/patchedmediakeys_20140218.js:389: ERROR - Private property type_ is never read
lib/util/language_utils.js:84: ERROR - The value 0.0 is duplicated in this enum.
MIN: 0, MAX: 2
lib/util/language_utils.js:84: ERROR - The value 2.0 is duplicated in this enum.
MIN: 0, MAX: 2
demo/assets.js:171: ERROR - Value assigned to local variable headers is never read
lib/dash/content_protection.js:188: ERROR - Value assigned to local variable repUnknown is never read
lib/dash/dash_parser.js:400: ERROR - Value assigned to local variable suggestedDelay is never read
lib/dash/segment_base.js:41: ERROR - Value assigned to local variable SegmentBase is never read
lib/dash/segment_template.js:291: ERROR - Value assigned to local variable periodStart is never read
lib/media/drm_engine.js:172: ERROR - Value assigned to local variable onEncrypted is never read
test/dash_parser_live_unit.js:358: ERROR - Value assigned to local variable manifest is never read
test/drm_engine_unit.js:383: ERROR - Value assigned to local variable cert1 is never read
test/drm_engine_unit.js:384: ERROR - Value assigned to local variable cert2 is never read
test/media_source_engine_unit.js:24: ERROR - Value assigned to local variable dummyData is never read
test/media_source_engine_unit.js:504: ERROR - Value assigned to local variable p2 is never read
test/media_source_engine_unit.js:505: ERROR - Value assigned to local variable p3 is never read
test/media_source_engine_unit.js:506: ERROR - Value assigned to local variable p4 is never read
test/media_source_engine_unit.js:535: ERROR - Value assigned to local variable p2 is never read
test/media_source_engine_unit.js:601: ERROR - Value assigned to local variable p2 is never read
test/media_source_engine_unit.js:602: ERROR - Value assigned to local variable p3 is never read
test/media_source_engine_unit.js:603: ERROR - Value assigned to local variable p4 is never read
test/media_source_engine_unit.js:632: ERROR - Value assigned to local variable p2 is never read
test/mpd_utils_unit.js:20: ERROR - Value assigned to local variable HUGE_NUMBER_STRING is never read
test/streaming_engine_integration.js:55: ERROR - Value assigned to local variable onSeek is never read
test/streaming_engine_unit.js:1263: ERROR - Value assigned to local variable reportedContentType is never read
test/streaming_engine_unit.js:1264: ERROR - Value assigned to local variable reportedPeriodIndex is never read
test/streaming_engine_unit.js:1540: ERROR - Value assigned to local variable size is never read
test/util/dash_parser_util.js:77: ERROR - Value assigned to local variable retry is never read
test/util/dash_parser_util.js💯 ERROR - Value assigned to local variable retry is never read
test/vtt_text_parser_unit.js:272: ERROR - Value assigned to local variable result is never read
Change-Id: I707700250541e04ccbfe81d7298b3f0c5a82dcdc
There were several situations where if stop() was called while an
update was occurring then it would either fail or continue to update.
This fixes those and also adds more tests for these cases.
Change-Id: I652198d289f65e60647a8d2aac00185cab43dead
Before, we would squash AdaptationSets that belong to the same group.
However, this is incorrect. Now it squashes AdaptationSets according
to the AdaptationSetSwitching info.
Closes#293
Change-Id: I2f7e37aa797d1fd8f453a924c0b0c9682fd84505
This properly externalizes manifest parsers so that they can be
implemented in application-space. This also moves all parameters
from the factory function to start().
Change-Id: I66801bc1cb13214d576e0043cebc2d9b9cb5a641
Before, we simply converted each byte from an ArrayBuffer into a
character; however, this is only valid for ASCII characters. This
changes it to fully support UTF-8 encoded network responses.
Change-Id: I9c49f29b09960501d345b98aa7af1bb711972abf
The use of strings as indexers in the DASH manifest parser would
not work when the library is compiled. This fixes it as well as
adding type-safety to those parts.
Change-Id: Id07068bc0eefdab4730dadc114e66b661cd4bb3e
This fixes the ContentProtection parsing to support non-IOP-compliant
manifests. This enables the unit tests for it, as well as adding
several more.
b/26982075
Change-Id: I0da2dbaa24ea2a6acf657b97f0a2e2d24ee3a16d
Sometimes the calculated $Time$ value is not an integer due to
floating-point rounding errors, but the $Time$ value filled into the
template must be an integer.
Change-Id: I5e61ac5143222620e8b5e1dfeb1847241c6a6876
It is the more common case for SegmentBase if the init segment comes
from the same URL as the media segments.
Change-Id: Ia9993471c892e103929729e2d496e0bc2f836b88
This also changes from using Node types to using Element types. This
is more correct since the code only deals with XML elements and not
with other Node types (e.g. text content nodes).
Change-Id: I0e8c7bf2adc1800a494e575b16661e8c69a7deb0
This fails on Chrome:
var fn = Promise.resolve;
fn();
But this does not:
var fn = Promise.resolve.bind(Promise);
fn();
It seems that the native implementation of function "Promise.resolve"
needs the context of "Promise" as "this" to execute.
Change-Id: I4e06e6a85f966ef0af2f630da50cbfc60f12ed50
DASH sec. 5.8.5.2 states that with the mp4protection scheme, the
@value attribute should be the scheme type. Rather than verify
the value is correct and ignore it anyway, this simply ignores it
entirely.
Change-Id: Ic1d089aecc1b5444b05cc5021606d9318e727a3a
This fixes small incompatibilities for IE11:
- XML parser sometimes fails by throwing rather than returning null
- bug in Promise polyfill prevented use of Promise.all([null, p])
- IE11 does not have ArrayBuffer.prototype.slice, used by integration
tests to clone a buffer in StreamGenerator
Change-Id: I9ace6bd17cd60272f85ce388342ca456f14d04c9
This adds some utility functions to NetworkingEngine for common
actions. This also cleans up the related unit tests.
Change-Id: I1105b77b6dac3637d566c1a4e2f77004ad705e8b
A prelude to a more complete DrmEngine. Should allow development of
DRM-related DASH parsing to proceed in parallel with DrmEngine
development.
Change-Id: Ie51504955f530898469fcacd897cb51588caa7d4
When possible, use xhr.responseURL to detect 302 redirects and make
the information available in the Response object.
Use redirect URI as BaseURL for manifest parsing.
See also #225, #266
Change-Id: Ie24abeb3b8418b3e89fed6666eb525aecd74f03b
* Move redesign docs to docs/design/
* Put all build output (including closure deps) in dist/
* Restore doc-building scripts
* Fix small doc error in MPD utils
Change-Id: I930f4f976370885b3c3c37c59f1ae7fcc5522413
When computing common DRM schemes among representations, we were not
previously combining the init datas. Because of this, if different
Representations with different PSSHs had their PSSHs in the manifest,
we would only request a license for one of them.
b/25596430
Closes#229
Change-Id: I150f67174df9dc0dbe1c7b32ab7b1a6dea633328
* For SegmentTemplate with @duration, treat @startNumber as the number
of segments absent from the start of the Period.
* For SegmentList, fix off-by-one error when computing segment start times.
* Add more @startNumber documentation and unit tests.
Issue #192
Change-Id: I0b7950cc6cda0a2cbd345e13bd769a50f83d4982
* Supports live streams of a fixed length.
* Live streams that stop now correctly end the video.
* Only uses local MPD when @availabilityStartTime is in the future.
* Added configuration option liveStreamEndTimeout.
A live stream is considered "ended" when the play-head moves past
the last segment for liveStreamEndTimeout amount of time. This allows
the MPD to be updated with new segments.
Closes#139Closes#140Closes#145
Issue #172
Change-Id: I0675203931f35ca3e0dee60a87c54ba74cbdbaea
When the availabilityStartTime is in the future, the
StreamVideoSource will re-process the local MPD once the
availabilityStartTime passes.
Closes#172
Change-Id: I1432ae06fbff6c4978ed93bc51263f7cac37e136
For static content that uses SegmentTemplate + @duration, compress
the last SegmentReference so that it does not go beyond the
Period's duration.
Issue #173Closes#187
Change-Id: Ifb9404ddfe267915541c035a5d6286f63f7bc032
* Ensure AdaptationSets with different languages but with the same group
end up in different StreamSetInfos.
* Set the main flag in a StreamSetInfo if any one of the source
AdaptationSets has their main flag set (commit
689c2a47aa broke Role 'main' support).
Closes#182
Change-Id: Ia017e294e0b359c62133adc42a8d701d614f3b0d