Commit Graph

3764 Commits

Author SHA1 Message Date
Joey Parrish 0257d7eed8 Make third argument for FakeEventTarget optional.
This makes FakeEventTarget more like EventTarget.

Change-Id: I5c4dd53e7ce665f98ade5909ac3bf5a90dd818e0
2015-03-09 19:10:23 +00:00
Joey Parrish 7989aadadc Add fullscreen events to the polyfill.
Change-Id: I13b6a44630aa87ac06c1f5d6271a5ba1e32c3746
2015-03-09 19:10:14 +00:00
Joey Parrish c4af1ac027 Remove debugging cruft from EmeManager.
Change-Id: I42125e45bab46412f97456303cf6bb2fb1a56040
2015-03-09 19:10:03 +00:00
Joey Parrish cef215817d Ignore meaningless error events from the video tag.
Change-Id: I9041f0e999054da9ecae30143b37d633bb0cc365
2015-03-09 12:09:34 -07:00
Timothy Drews 4a5738d881 Support years and months in xs:duration strings.
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
2015-03-06 13:25:12 -08:00
Joey Parrish f725f0058c Update content restrictions docs.
Change-Id: I103a7b6005420c41fabc9b622efe3b546957f691
2015-03-05 11:41:50 -08:00
Joey Parrish ca3783e22c Add media/ folder to docs.
Change-Id: Ife42e05a790cf747b1d108e39ee7e08f5062c25b
2015-03-05 11:41:50 -08:00
Joey Parrish ae35ac25bb Fix ContentDatabase test crashes on Chrome 42+.
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
2015-03-05 11:41:50 -08:00
Joey Parrish d2d6f67a52 Fix ContentDatabase test failures.
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
2015-03-05 19:34:49 +00:00
Timothy Drews 27ed78203a Merge Segment{Base, List, Template} across levels.
* 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
2015-03-05 01:20:07 +00:00
Joey Parrish f43cfff622 Fix ContentDatabase error reporting.
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
2015-03-04 13:56:25 -08:00
Joey Parrish 66d760e8ae Factor Player's EME code into EmeManager.
Change-Id: I87f1534a619a5859fe4d4aed2cfe329976691909
2015-03-04 11:56:07 -08:00
Joey Parrish 598e042b4a Always use base64url encoding.
This fixes clearkey errors on newer versions of Chrome 42.

Change-Id: I3c0d7336fa21587fe730c747e8aea92657a6cf33
2015-02-28 20:38:00 +00:00
Joey Parrish 50de57efad Fix confusing asset name.
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
2015-02-28 00:21:23 +00:00
Joey Parrish d0503b8af2 Fix incorrect initDataType for clearkey content.
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
2015-02-27 23:55:07 +00:00
Natalie Harris 4a8d26af9b Support of idb URI's.
Change-Id: Ie964da2d435349be6c2ee9a88202f1c058b8ed05
2015-02-27 23:16:15 +00:00
Timothy Drews 85cbc0e223 Fix # of segments computation in MpdProcessor.
* Correctly compute the number of segments when generating
  a SegmentList from a SegmentTemplate with a segment duration.
* Update unit tests.

Change-Id: Ic3edfd8c6eb8173ea52a4c606bbcd38c662de55f
2015-02-26 21:23:43 +00:00
Joey Parrish 0033fd3d3d Add a cycle video button.
This also refactors the cycle audio button to avoid duplication.

Change-Id: Idfbb2f024ce550d9ad1250064634f38f086c9cd6
2015-02-26 19:08:18 +00:00
Natalie Harris c6a74f3171 Additional functionality added to ContentDatabase. Issue #22
Change-Id: Ic00a42b7bfcd0619adf358f4907675e7c7767bb7
2015-02-25 15:52:53 -08:00
Timothy Drews 952057a00c Refactor segment metadata fetching.
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
2015-02-25 01:00:00 +00:00
Joey Parrish 8add78dedc Update the change log and bump version to 1.2.0.
Change-Id: Id5e011b15728a8f429e527264c62e2339e4dcfaf
v1.2.0
2015-02-24 13:19:53 -08:00
Joey Parrish 997ae8f90c Add favicon.
Change-Id: Ie60938c6df8d3b9ac78c19211bbf988a460049e9
2015-02-24 11:25:34 -08:00
Joey Parrish 1a99082bdd Add buffering events.
Closes #25.

Change-Id: I0acac7195de6ddfc1386fa9334b0c2e278389a04
2015-02-24 11:15:31 -08:00
Joey Parrish a62f3bbd10 Fix hang on seek after adaptation.
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
2015-02-24 10:55:03 -08:00
Joey Parrish 520c45b842 Fix flaky tests.
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
2015-02-24 09:15:57 -08:00
Joey Parrish b9d2f6e8cd Fix failed assertion while parsing data-less PSSH.
When there is no data section in the PSSH, we need to skip 0 bytes,
which should not be an issue.

Change-Id: I53ab5d666f6895175a300bcc080a12e0375c3a25
2015-02-23 18:15:23 -08:00
Joey Parrish 8a532c0c7e Update/expand fullscreen polyfill.
Change-Id: I2ecbddbdc2ced03ee489dfc37488e7046c488eb9
2015-02-23 17:46:54 -08:00
Joey Parrish 0a2021af8b Fix encrypted HTTPVideoSource.
This is related to the fix for #2.

Change-Id: I2bec5f9d2b44c4801106d2902054a518d1444d2f
2015-02-23 17:46:54 -08:00
Joey Parrish a253872c8a Update to 9 February 2015 EME spec.
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
2015-02-23 16:51:20 -08:00
Joey Parrish f770a972ea Fix small mistakes in URLs and descriptions.
Change-Id: Ie665b8eea929e2c81a899882d6a3fe18563434b9
2015-02-20 13:58:07 -08:00
Joey Parrish 9fb10fa50c Update the test key for clearkey.
The clearkey implementation in Chrome has gotten more strict and now
requires the alg parameter.

Change-Id: I3f623e89fddf193a40a71c38594342cde43ef109
2015-02-19 18:00:25 +00:00
Joey Parrish 38a0b9e14c Avoid a warning about an unrecognized DRM scheme.
This scheme ID is standard and should not cause a warning.

Change-Id: Ie022c189a741f5b005dc3ebc8a92dca6cede7944
2015-02-19 17:57:57 +00:00
Joey Parrish 4da469d1b5 Rename assets.
* 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
2015-02-19 17:57:31 +00:00
Timothy Drews 3226db0d9d Handle gaps/overlaps in SegmentTimeline.
* 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
2015-02-19 17:47:01 +00:00
Joey Parrish b092231952 Add key status support and video error events.
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
2015-02-17 09:32:43 -08:00
Timothy Drews b244def2f4 Fix-up startNumber behavior.
* 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
2015-02-13 18:45:59 +00:00
Joey Parrish d797c702ec Fix suppression of 'encrypted' events.
If the events happened quickly enough, some extra sessions were being
created.

Change-Id: I73367f3ba44172d3820e1d6283235f49fb1b119b
2015-02-11 17:05:54 -08:00
Joey Parrish f6a7dcf917 Suppress multiple encrypted events for HTTP sources.
Change-Id: Ia70c594fa4ffd0ed4c107e26697a65c88e9b0f25
2015-02-12 01:04:54 +00:00
Timothy Drews 7e5983feac Change SourceBuffer timestamp offset calculation.
* 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
2015-02-11 22:16:23 +00:00
Joey Parrish 6022d98ccd Fix linter errors in the PSSH spec.
I neglected to run the build scripts before submitting that last patch.

Change-Id: I9096f7d41ffbf662cc9dd917caeacec4753be36c
2015-02-06 11:10:47 -08:00
Joey Parrish 08bdb3079b Make PSSH parser more robust.
Includes unit tests and covers zero-sized PSSHs, truncated PSSHs, and
various orderings of both v0 and v1 PSSHs.

Change-Id: I79ecc9475d483be610c003b57e831954a1c9800b
2015-02-06 10:57:47 -08:00
Joey Parrish d3e1e0a329 Fix linter error.
Change-Id: Ia3c351b7b0a037a0c61c4c925ac5e3b2c5434b63
2015-02-04 21:35:13 +00:00
Natalie Harris 302f6faf64 Offline storage module.
Change-Id: I6d67faf99d535c0c77764b3c3b6311736ce8f9e1
2015-02-04 01:24:09 +00:00
Joey Parrish a92d673b1a Add support for the Role tag.
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
2015-01-30 15:18:43 -08:00
Joey Parrish 52ddfd2c8c Prefer video stats in StreamStats.
Closes #16.

Change-Id: Iebdd28a3a90789065977bbf227caf79323a57cf6
2015-01-29 16:43:39 -08:00
Joey Parrish 4f35f23fb5 Fix seeking dead-zone when data gets evicted.
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
2015-01-29 16:36:00 -08:00
Joey Parrish a526cc23ee Remove unused manifestInfoPromise_.
Change-Id: I4340a6bf6effb12d64b1cda68957e6b4cc8a7b45
2015-01-29 16:33:08 -08:00
Joey Parrish da94f7b1d7 Add PSSH v1 support.
Also reject any PSSH version we do not know.

Closes #19.

Change-Id: Ice898f787928341f2547b3254477a6e3145866ca
2015-01-29 09:42:07 -08:00
Joey Parrish f7d9ea5794 Refactor StringUtils into Uint8ArrayUtils.
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.

Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb
2015-01-29 09:41:06 -08:00
Joey Parrish 3afec2cd0f Remove unused requirements in StreamVideoSource.
Change-Id: Ie0b0a52187b38613519b1a68c217a99ba5b5af8b
2015-01-28 16:31:58 -08:00