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
* 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
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
This updates the extern for VideoPlaybackQuality to match the externs
in newer versions of the Closure Compiler.
b/21559591
Change-Id: Id375f8722fa46f6779934e15930bd328310490d5
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
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
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
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
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
This fixes FakeEventTarget and FakeEvent tests for Chrome 43+.
Also improves compatibility with strict mode.
Change-Id: I5ccca6798ff8a5f5b2fa98d6b9e8446378b7fab2
Once generateRequest() or load() have been called on a session,
neither can be called on that session again.
Change-Id: Ieedc0cf0fddfcf8df042479e6203a082fbc17c0a
Fixes the session type strings for persistent sessions.
Adds a comment about the key statuses we deliberately ignore.
Change-Id: I698bc91e46b863cc8cccd0e7509c503d1410d814
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
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
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
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
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.
Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb