Commit Graph

17 Commits

Author SHA1 Message Date
Theodore Abshire 34337ca28d feat(UI): Added polyfill for screen.orientation.
There are some platforms (e.g. iPad) which can be rotated,
but do not support the screen.orientation API. This is relevant
because iPad now supports requestFullscreen, which it did not
before.

Found while investigating #2653

Change-Id: Iacc93433aa1fb50a25d968203dc9fd4f7f16b4ae
2020-06-17 12:31:24 -07:00
Joey Parrish b9b4118938 Add a polyfill for EME encryption scheme queries
Note that the encryptionScheme field isn't being used by Shaka Player
yet, but that this will enable us to experiment with it ahead of the
full launch of the feature in browsers.

See also:
 - https://wicg.github.io/encrypted-media-encryption-scheme/
 - https://github.com/WICG/encrypted-media-encryption-scheme/issues/13
 - https://github.com/w3c/encrypted-media/pull/457

Change-Id: I9e8c2b6ce4ce3f4fe634fa4164669c69959e7fde
2019-11-22 18:18:36 +00:00
Joey Parrish e3b49573a2 Rename PiP polyfill to PiPWebkit
Follow-up to #1902

Change-Id: I760d0006c4cbd7c3aad2ce96801259b578269195
2019-05-03 21:30:17 +00:00
Álvaro Velad Galván caa34ca90d Add PiP pollyfill for Safari (#1902) 2019-05-03 10:50:37 -07:00
Joey Parrish 9a4b73df7c Fix runtime errors in the new demo on IE 11
- Polyfill navigator.languages, which is missing on IE
 - Add missing handler for uncaught exceptions (doesn't work on IE,
   but is a good idea to have for debugging the demo app)
 - Avoid offline setup if it's not supported (as on IE)
 - Fix bad reference to uncompiled link (wrong ID)
 - Log any caught errors to the console
 - Wrap the init functions to catch and log any errors during init

Fixes b/131863587
Fixes #1911 (similar storage error on iOS)

Change-Id: Ib2a53392d5632c71825af17dd3e955cd54279e98
2019-05-03 17:26:44 +00:00
Joey Parrish a121733a11 Add FairPlay EME polyfill and DrmEngine support
This adds a polyfill for Apple's prefixed EME implementation.  This
will be used on all macOS versions prior to 10.14 (Mojave) and on
Safari versions prior to 12.1.

This also adds support for FairPlay license protocol eccentricities
in DrmEngine, so that the proper formatting is used for requests and
responses.

Issue #382

Change-Id: If1274d2f018a475f56c09df97645694f13acbde9
2019-04-30 21:15:11 +00:00
Jacob Trimble bfb42c69c4 Make EME polyfills independent.
Now each EME polyfill can be removed independently; this allows
someone to remove just the IE11 polyfill while still keeping the
others.

This adds a priority ordering to the polyfills so the nop polyfill
will be run last as a fallback if there are no other polyfills.

Issue #1261

Change-Id: I865e1c0d6a73a079dd91505e96572e215e6f6c6a
2018-03-06 21:34:25 +00:00
Joey Parrish 82357486a6 Replace buggy Promise polyfill
A bug in our Promise polyfill caused issues with the recently-added
AbortableOperation class on IE11.  Since external polyfills for this
are smaller, it is easier to remove ours in favor of a third-party
polyfill.  Applications that wish to support IE11 must now load this
additional polyfill.

We are using the "es6-promise-polyfill" module from npm, but any
compliant polyfill should suffice.

One feature our own polyfill offered was the ability to flush all
Promises, which allowed us to write synchronous unit tests that
simulated async processes.  To get this ability back, we are now
using the "promise-mock" module in our tests.

Getting "promise-mock" to load correctly involved switching from
"requirejs" to "cajon", which builds on requirejs and supports
AMD modules more directly.

Closes #1260

Change-Id: I5de48e88a910736ae5c1897a7a509bc5641acb70
2018-01-30 23:10:04 +00:00
Joey Parrish 84a8d1ca18 Polyfill the HTML5 'input' event
The HTML5 'input' event does not work correctly on all input elements
in IE 11.  There are equivalent events that the UI can use on IE.

Instead of remembering this and checking for IE every time the 'input'
event is needed, let the polyfill translate the event type.

Change-Id: I23258a5c6a0bd37e946214380ad07949f3ee7f88
2017-07-12 12:29:14 -07:00
Joey Parrish 53220b5acb Polyfill video.play to silence confusing errors
Closes #836

Change-Id: Ie5b42bc707ce7443641e86c04ec116fd732bbbae
2017-06-05 12:34:31 -07:00
iKinnrot f145dffc9e Fix math round when number > 2^52 on IE11 (#832)
Don't use math round on ie11 if number > 2^52.
2017-06-02 14:51:25 -07:00
Aaron Vaage f0286ae7f8 Fixing DBEngine Failures on Chromecast
The Chromecast reports supporting IndexedDB but whenever an insert
command was performed, the operation would hang indefinitely.

This change introduces a pollyfill for the Chromecast that will
remove the indexed db reference which will have DBEngine's
"is supported" behavior to report no support.

Alone this change would not stop the tests from running, so the
DBEngine tests had to be updated to first check that the DEngine
is supported on the active platform.

Bug: 34927282
Change-Id: I8d4797f0981b014fb42db1c237c85704888bea7f
2017-02-08 00:04:23 +00:00
Jozef Chutka ca299b2822 VTTCue polyfill (#643)
This adds a VTTCue polyfill for IE/Edge (3-arg TextTrackCue) and
Toshiba dTV (6-arg TextTrackCue).

Closes #635
2017-01-17 10:42:54 -08:00
Joey Parrish 8c7c74e950 Polyfill Safari 9 MediaSource bugs
This adds a polyfill for a Safari 9 MediaSource bug where calling
abort() on SourceBuffer causes the decoder to fail.

The reason we call abort() at all is to reset the decoder and smooth
segment transitions on Chrome, Firefox, and Opera.  Safari does not
seem to have this problem in the first place, so it is fine to
completely stub out abort().

Issue #446

Change-Id: Icbaaa3e9ce5372efdee937ddc4cf94a27dce6a47
2016-07-29 18:42:31 +00:00
Joey Parrish 9576c5b2cb Rename MediaKeys polyfills
Newer closure compilers do not seem to recognize the MediaKeys
polyfill classes namespaces because they don't follow normal
conventions.  This leads to errors about missing requires.

This renames the classes as follows:

  PatchedMediaKeys.nop       => PatchedMediaKeysNop
  PatchedMediaKeys.v01b      => PatchedMediaKeysWebkit
  PatchedMediaKeys.v20140218 => PatchedMediaKeysMs

The new names follow normal conventions and refer to the polyfills by
the prefix of the old API rather than by the version number.

This should help us upgrade to a newer compiler.

Closes #456

Change-Id: I5491ecb9a61e2b456ba8fa81a6adb6c110c96817
2016-07-24 16:27:40 -07:00
Joey Parrish 9d70cad0ea Simplify FakeEvent and FakeEventTarget
We now avoid tricky things like CustomEvent and setting properties on
native Events.  This gives us better cross-browser compatibility and
less complexity.

Change-Id: Idc9fcc69c33257e4540d956bcbc949de6d992cf0
2016-02-29 17:58:55 +00:00
Jacob Trimble 47a99253b0 Polyfills now register as plugins.
Change-Id: I498bda84d92f2c733f120e1b1c5a0ccae305ba15
2016-02-02 12:11:49 -08:00