Assume a year is 365 days and a month is 30 days. Supporting years and
months is useful as some MPDs that describe live content specify
@minimumUpdatePeriod in terms of years; here, an accurate number of
seconds is not needed, but the duration string should not be treated as
invalid.
Change-Id: Ic4ea26f5a7572711e047c237dced33d80a698840
Chrome 42+ is crashing when we insert roughly 64MB of data into the
database at a time. The database now tries to batch up 1MB of
segments, which means only single segments will be inserted for high
bitrate content, but we will still get a performance boost from
batching up segments for low bitrate content.
Change-Id: I3205b108dc089ea2901ea6b9eae5125901535f0c
Tests were failing if an existing database had a greater version
number. This was an artifact of an older version of ContentDatabase
which used a different version number.
Tests would also fail if one of the 'stores a stream' tests was run
several times in a row, such that the stream ID had more than one
digit. The reference matcher now accepts multi-digit IDs.
Change-Id: I8d8949e46bd0720abd761248790b2ee5965ff4a1
* Instead of overriding SegmentBase, SegmentList, etc. between
levels (e.g., from Period to AdaptationSet) merge them, but
prefer elements and attributes from inner levels.
* Refactor MPD parsing unit tests into separate files.
* Rewrite SegmentBase unit tests, add SegmentList, and
SegmentTemplate unit tests.
Change-Id: I3fdb7657bb9f468e10f63e47e9a52fbf8ebbd40b
Rejected promises now pass an Error object instead of a simple event.
This causes test failures to display useful error messages now.
Change-Id: I9d9a756e84d204185ca9a2e36ca92ef814d05e4d
The asset itself has nothing to do with HTTPS, it is just not going to
fail over HTTPS as the original, externally-hosted on did.
Change-Id: I32d131085601ff10cff7cd3c14b384964b6ec6f5
The initData here is a single key ID, which is the webm format.
The cenc format would be one or more concatenated PSSH boxes.
Change-Id: Ia71e8fabdc5d843154999d1ef76d9f7caf8c2078
* Correctly compute the number of segments when generating
a SegmentList from a SegmentTemplate with a segment duration.
* Update unit tests.
Change-Id: Ic3edfd8c6eb8173ea52a4c606bbcd38c662de55f
Move segment metadata fetching into StreamInfo so that segment metadata
can be retreived outside of Stream. This enables other components to
access segment indexes.
Change-Id: I322bcf7cdabc7daecb5d554834275c1b6d1775ee
By checking not only that a timestamp is buffered, but that the
corresponding segment from the current representation has been
inserted, we can effectively treat the buffer as "dirty" when it
contains multiple representations. This "dirty" state is resolved
by clearing the buffer on seek.
Closes#26.
Change-Id: I62263dc16be70c17abb93aacc00fb92f5bf71eee
This fixes timing-based flakiness on these tests:
* ContentDatabase - deletes the database
* Player - seek - does not hang when seeking to evicted data
Change-Id: Ieb4e1291289fa589ccda94a86698c15f1bde8fba
This removes reliance on MediaKeys.isTypeSupported and instead uses the
supportedConfigurations parameter of requestMediaKeySystemAccess.
A lot of refactoring went into this effort, particularly around
StreamVideoSource, StreamSetInfo, and StreamInfoProcessor.
Closes#2, b/19354928.
Change-Id: Ibf81da909b8207b5babaec5ef0422dd1293d130d
* Rename the bear clip to reflect the fact that it is actually a webm
clip, not an mp4.
* Rename the sidx, cues, and headers files so that karma does not treat
them as text. See also: karma-runner/karma#1070.
Change-Id: Ia73c233b32a34c57d45021d1cc130c0e0672bda0
* Stretch/compress segments within a SegmentTimeline to align them
to the beginning of the next segment.
This does not allow playback of content with actual gaps in it, but
allows MPDs with inaccurate SegmentTimelines to be used.
Closes#24, b/19144876
Change-Id: I183935db23fe26e1d6295e099b201a6af487d53b
This adds support for EME key statuses, which are translated into
Player error events. It also listens for error events on the video
tag, which are also translated into Player error events.
This also updates the prefixed EME polyfill to simulate key statuses
for prefixed EME.
Applications can now detect HDCP failures and message appropriately.
Native key status support was not added to Chrome until Chrome 42.
The prefixed EME events to detect HDCP failures work in Chrome 39 and
Chrome 42, but are broken in Chrome 40 & 41.
Closes#14, b/19244591
Change-Id: I112c489bda63360d2bedca83f190c639559641ea
* Revert 5c7fca90b6, which intended
to allow startNumber to be 0, and maintain the previous behavior,
which requires startNumber to begin at 1 (this appears to be in-line
with the MPD spec).
* Correctly compute the $Time$ placeholder.
* Rename firstSegmentNumber to startNumber to clarify code.
Closes#10
Change-Id: I9b565edc9e23b9ad7c6bc62829d6b0ab565008a4
* Adjust SourceBuffer timestamps forward by the Period's
start time and backwards by the Representation's
presentationTimeOffset.
* Incorporate the start time of a Representation's first
segment in the calculation of a Period's duration.
* Seek to the latest start time before starting playback.
Further adjustments will be required to support live playback.
Closes#17, b/19130302
Change-Id: Ia9fe6d8bbe5a69488130de2d8b146ce54dfff50e
Includes unit tests and covers zero-sized PSSHs, truncated PSSHs, and
various orderings of both v0 and v1 PSSHs.
Change-Id: I79ecc9475d483be610c003b57e831954a1c9800b
AdaptationSets are sorted by language (audio-only), then by those with
the "main" role. Main sets are preferred when there are multiple to
choose from.
Closes#20, b/19214703.
Change-Id: I4fdd601c0bd7c7d29801084199123311ab9dbec3
Checks to see if a seek is within the buffered zone or not.
Clears the SourceBuffer if seeking outside the buffered zone.
This allows the efficient indexed lookup for inserted segments to still
be used while streaming, optimizes buffered seeks, keeps the playback
timeline sane in spite of the browser's eviction strategy, and obviates
the need for an earlier fix for some other MSE weirdness.
Closes#15.
Change-Id: I0226ebb679fab6739d3d0cc071e22f434983c9d2
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.
Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb