Commit Graph

34 Commits

Author SHA1 Message Date
Joey Parrish 89d8b7e94a Add support for raw values in Promise.all and Promise.race
Change-Id: Ifce7a22bc8f17f026c85bd90de2feced7f549b83
2015-10-26 11:39:05 -07:00
Joey Parrish c55978cc79 Add a Promise polyfill
This will help with porting to IE11.  Chrome, Firefox, Safari, and
Edge all have native Promises.

This polyfill does not support thenables because Shaka does not use
them.  Other than tests related to thenables, this polyfill passes
the A+ test suite.

It is also worth noting that this polyfill is incompatible with
native Promises, so it should not be used to replace a native
implementation or mixed with browser APIs that may use a native
implementation internally.

To safely test in Chrome, force prefixed EME (to avoid native
Promises), set window.Promise to null, then load some content in
the test app.  If using a verison of Chrome after prefixed EME
was dropped, use unencrypted content.

To run the A+ test suite, compile the library, install nodejs and the
module 'promises-aplus-tests', then run ./test_promise_polyfill.js.

Inspired by pull #176

Change-Id: I0d25049f162ff7f3b57bbc795403fcdedf927262
2015-10-21 11:12:18 -07:00
Joey Parrish ff1dcc2820 Refine MediaKeys polyfill error type
Inspired by code in pull #176

Change-Id: I2e29310c8a3583ed208d7bd1ae2e747a92ddf480
2015-10-20 12:42:58 -07:00
Joey Parrish 4cc4e96dbd Overhaul license comments and file annotations
* Updates all Copyright years to 2015.
* Adds licenses annotations to all JS.
* Makes all licenses identical to avoid repeated appearance in the
  compiled output.
* Drops fileoverview annotations, which do not affect docs output.
* The linter still requires fileoverview on externs.

This patch required a newer closure compiler, since the previous
version we used had a bug regarding license annotations that caused
the license comment block to appear in the output once per file
regardless of uniqueness.

Change-Id: I2e9272db680cba7ecc4613d97f1d3a94ac2244cc
2015-09-08 12:02:34 -07:00
Joey Parrish 4d9177240a Revert "Adding license annotation to js files."
This reverts commit 8cb24652cb, due to
the fact that the new annotations caused our binary size to jump
by 52%.

The compiler preserves all 'unique' licenses, which causes trouble
since the comment blocks with the license annotations are not unique
and contain file overview comments as well.

We can re-examine this once we have restructured the license headers.

Change-Id: I418e407a0e0253630633697f30cf496a7fc2ddfc
2015-09-04 18:36:39 -07:00
Yohann Connell 8cb24652cb Adding license annotation to js files.
Change-Id: Id10592ccaf35608ac4f01844cae2fec4a2030d65
2015-09-04 00:05:17 +00:00
Joey Parrish 1c389dfabd Specify sessionTypes
Required in newer drafts of the EME spec.

Closes #128

Change-Id: I014f60aacd0b7e62f3084956dd5eadcf6a0ebb26
2015-09-01 23:58:45 +00:00
Jacob Trimble c320aee683 Updated player error text on missing output protection.
Closes b/23598195

Change-Id: I3bd1f430a529c1682befddef7061f5e01b9c40d4
2015-08-31 09:36:11 -07:00
Joey Parrish 88c38cb278 Remove clearkey alg, no longer required
See w3c/encrypted-media#48

Change-Id: I85062d5842b46855168cc85b131972415c2a2120
2015-08-13 20:01:25 +00:00
Joey Parrish fd49592c8d Change fake key ID
New value recommended in w3c/encrypted-media#32

Change-Id: I66d0b1f99630726222f01278d78e69fe26d39f83
2015-08-13 19:12:15 +00:00
Yohann Connell 94937d7081 Changes to fix compile errors when using the upstream Closure compiler.
Change-Id: I57b4ae73bdb1980938c3a740904e18da46c6ba23
2015-08-05 15:46:40 +00:00
Joey Parrish c5f26f2013 Update VideoPlaybackQuality extern and polyfill
This updates the extern for VideoPlaybackQuality to match the externs
in newer versions of the Closure Compiler.

b/21559591

Change-Id: Id375f8722fa46f6779934e15930bd328310490d5
2015-07-13 20:56:06 +00:00
Joey Parrish 1a9febc9d1 Reverse nullability of BufferSource
This brings our externs in line with newer versions of the Closure
Compiler, where BufferSource is both defined and defaults to
non-nullable.

b/21559591

Change-Id: I5d51043e54b1b3490c25c4bb362025fa51260c07
2015-07-13 20:54:47 +00:00
Joey Parrish dee2f372a6 Be strict about nullability and scope
This fixes errors in newer versions of the Closure Compiler.

b/21559591

Change-Id: I3b9f08ccca81deb0f2bc0c7f2bb755d91285ec1e
2015-07-13 19:01:51 +00:00
Joey Parrish 1e400f536f Avoid load-time uses of Uint8Array.
This is inteded to fix a couple of the load-time exceptions seen
when loading the library on IE9.  Eliminating load-time exceptions
will make it possible to use isBrowserSupported() as intended, to
avoid use of the library on older browsers.

Issue #87

Change-Id: I993d4f955e80a7401bea182ae90df43a8a022ca2
2015-06-02 16:31:27 -07:00
Joey Parrish 5343363168 Fix v01b EME polyfill expiration.
Fix the definition of expiration to be consistent with the details in
w3c/encrypted-media#58 .  In particular, never use infinity.

This means using key status to check if a session is new, rather than
comparing the expiration time to NaN.

Change-Id: Ib1917a34d4dfd0fd29b1c578c6ce60fd996c2698
2015-05-22 19:05:50 +00:00
Joey Parrish 9ebd522c15 Add a polyfill for CustomEvent.
Change-Id: I92ac840976794e62c6ffc18a2065d4ebc4dfb33c
2015-04-21 16:11:47 -07:00
Joey Parrish a61c544de0 Make polyfill installation easier.
Change-Id: Ia8ccfae3c56d7146c9a2c65f8788bd5e5044579e
2015-04-21 10:54:34 -07:00
Joey Parrish 7ea820c399 Fix fullscreen polyfill test.
Only install a getter for fullscreenElement if the property does not
exist.  Previously, we installed the getter if the property existed
but was null.

Change-Id: Ibea5bc63a75a98cd1d50c56ca99fac2aa38e449b
2015-04-21 10:54:34 -07:00
Joey Parrish a4ed00b2ac Disallow ClearKey storage in prefixed EME.
This prevents false positives for clearkey license storage using prefixed EME.

Issue #23.

Change-Id: I28e2d460c8fa796f5ee326fd3d01dfa20dd8fc19
2015-04-03 14:18:57 -07:00
Joey Parrish 0b74f0b9f5 Persistent license support error message for v01b.
Change-Id: I34cad444dac4aad555f835ae657c9869da6a290d
2015-04-02 17:47:02 +00:00
Joey Parrish 9940d96d73 Remove flaky assertion in EME polyfill.
This assertion did not add much value, and it sometimes triggers a
test failure.  Since prefixed EME does not have actual session
management, it's entirely possible for a stray message to come in
for a session we've already destroyed in the polyfill.  Rather than
assert, just ignore it.

Change-Id: I4779d3f36a25bc21ade95c4ea3f25ad1f8a96e7b
2015-03-31 16:34:20 -07:00
Joey Parrish a2520ec159 Tweak FakeEventTarget for Chrome 43.
This fixes FakeEventTarget and FakeEvent tests for Chrome 43+.

Also improves compatibility with strict mode.

Change-Id: I5ccca6798ff8a5f5b2fa98d6b9e8446378b7fab2
2015-03-31 15:16:46 -07:00
Joey Parrish 8149193e52 Correct polyfill treatment of generateRequest/load.
Once generateRequest() or load() have been called on a session,
neither can be called on that session again.

Change-Id: Ieedc0cf0fddfcf8df042479e6203a082fbc17c0a
2015-03-18 18:20:06 +00:00
Joey Parrish eb660e89c6 Update EME polyfill to the latest draft spec.
Fixes the session type strings for persistent sessions.
Adds a comment about the key statuses we deliberately ignore.

Change-Id: I698bc91e46b863cc8cccd0e7509c503d1410d814
2015-03-16 19:03:27 +00:00
Joey Parrish c67e6555e8 Allow EME events to start before video.src set.
In the latest unprefixed EME implementation, sessions can be created
and manipulated independently of video tags.  This simplifies the EME
manager somewhat, and requires a slightly trickier prefixed EME
polyfill to emulate this behavior on Chrome 40 & 41.

Change-Id: Ia5e942449b27cd57b54c92a8b40c0fb5c95577c0
2015-03-10 16:53:13 +00:00
Joey Parrish 7989aadadc Add fullscreen events to the polyfill.
Change-Id: I13b6a44630aa87ac06c1f5d6271a5ba1e32c3746
2015-03-09 19:10:14 +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
Joey Parrish 8a532c0c7e Update/expand fullscreen polyfill.
Change-Id: I2ecbddbdc2ced03ee489dfc37488e7046c488eb9
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 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
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 d4df6987e7 Shaka Player release v1.1 2015-01-15 15:12:58 -08:00
Joey Parrish b3d035be9f Shaka Player release v1.0 2014-12-19 14:26:19 -08:00