Commit Graph

2275 Commits

Author SHA1 Message Date
Joey Parrish 48836912a9 Reimplement "Avoid Platform.supportsMediaType when loading."
This reverts commit 6667ea5edf and
reimplements it using a fallback to an arbitrary media element when
there isn't one yet.

This also adds a regression test that would have caught the issue
sooner.

Closes #2326

Change-Id: I44573ae551db51f788d7c97b9680dfd45adee0a0
2020-01-07 12:30:09 -08:00
Joey Parrish 51c3717305 Update fullscreen externs
This updates the fullscreen externs to:
 - Add a newer definition for requestFullscreen which includes options
   for the method
 - Remove prefixed methods which are now built into the compiler and
   are no longer necessary
 - Drop document.webkitSupportsFullscreen method, which does not seem
   to exist as defined, even on iOS (confusion with similar property
   on video element: https://apple.co/39TLC5I)

This enables PR #2325 to resolve issue #2324

Change-Id: Ie7bea7e7d4fd59d6d801431e2ba996649e185dc1
2020-01-06 19:42:18 +00:00
Jacob Trimble 011749e95f Standardize argument comments.
This changes the eslint rule to enforce a strict pattern for the
argument comments.  The comment must appear before the argument and
must be /* foo= */.  This still ignores line comments.

Change-Id: I3afb01c65e1088eda13facb3aeeaa7595a2f5aee
2020-01-06 19:40:52 +00:00
Álvaro Velad Galván cdbf8c5fbc Add licenseTime to stats (#2297)
This gives the cumulative time spent fetching licenses.
2020-01-06 11:11:28 -08:00
Shaka Player BuildBot 1108d843db Merge remote-tracking branch 'github/master' 2020-01-06 10:58:23 -08:00
Joey Parrish a48f8792a9 Move test-only method to test utils
This method should probably never have been in the library, since it
creates a fixed-sized, muted element.

Change-Id: I53b474305465bef34d43ce40ec5e7dedceb20a25
2020-01-06 18:57:28 +00:00
Álvaro Velad Galván bdca05ff4b Add pixelAspectRatio property from DASH (#2294) 2020-01-06 10:56:28 -08:00
Álvaro Velad Galván 5411838f7c Add startTime support in src= mode (#2271)
Closes #2267
2020-01-03 13:45:53 -08:00
Álvaro Velad Galván 3e0bb2bb67 AirPlay support HLS with FairPlay (#2257)
Closes #2177
2020-01-03 12:20:13 -08:00
Joey Parrish 26583c5787 Add missing events to CastProxy Player
There were several events missing from the proxied event list.  This
adds all of them.

Closes #2318

Change-Id: Iaba752adcf8dbe1c1a9f28bfe36fd3084221bb98
2020-01-03 10:53:52 -08:00
Joey Parrish 41a8664dba Make segment references independent of periods
This is a step along the way to flattening periods, and also
simplifies a few small things in StreamingEngine and tests.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: Ie17cd5e15ed6ec9290a918c3a69c05c74581e0fc
2020-01-02 19:03:18 +00:00
Joey Parrish 8a3708de76 Update encryption scheme polyfill
The new release includes support for encryption scheme queries in
MediaCapabilities.

Change-Id: I041773ed4e8e957123bfd3b666749999a72a7da3
2019-12-20 22:50:38 +00:00
Jacob Trimble 6667ea5edf Avoid Platform.supportsMediaType when loading.
While we are loading, we have a specific media element we are trying
to play with, so there is no need to use Platform to pick an arbitrary
one.

This is important for Shaka Player Embedded where playback support may
depend on the specific video element so we should query the correct
element.  This also avoids calling "document.createElement" since we
already have a video.

Change-Id: I289dc05398a73e8f978d8ae213f236dd5cd652cf
2019-12-20 18:36:07 +00:00
Joey Parrish c13830e535 Augment SegmentReference with offset and window
SegmentReference used to have presentationTimeOffset, which,
subtracted from the period start time, was then _added_ to the
timestamps in the segment by MediaSource.

Now, SegmentReference has a timestampOffset field, which is exactly
what MediaSource's timestampOffset field is set to on the SourceBuffer
before this segment is appended.  For DASH, this is periodStart minus
presentationTimeOffset.

This also adds append window start & end times to the
SegmentReference.  Now segments can be appended to SourceBuffers
without reference to the period.

Note that start & end times of the SegmentReference in each segment
index are still relative to the period.  This will change in a
follow-up.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: I9d54eb2b529ec643c9475b8e9d218c3e2e826a26
2019-12-19 11:35:14 -08:00
Joey Parrish 52aa032f18 Fix compiler error with upcoming compiler release
An upcoming release of the compiler gets confused about robustness
fields being potentially undefined.  Adding a fallback to a blank
string satisfies the compiler.

Change-Id: I794b49002c86dde7236a09061c8ed2390ae26136
2019-12-19 09:29:17 -08:00
Jacob Trimble f7e645f110 Update changelog and bump version number for v2.5.7
Change-Id: Ifa79dbf31540bb19a8b8216e7d076ecc40a07bce
2019-12-17 14:14:14 -08:00
Theodore Abshire d95ab947e9 Added check for E-AC3 JOC in DASH.
Closes #2296

Change-Id: I776acf68f43e1e48f762a1bd68376c028e777c98
2019-12-16 17:01:23 -08:00
Álvaro Velad Galván 02fa8c6876 Add audioSamplingRate property (#2290) 2019-12-10 18:00:16 -08:00
Álvaro Velad Galván fcff08b58d Filter image adaptation sets (#2276)
* Filter image adaptation sets

* Add comment about the change

* Add test

* Change Test  name
2019-12-06 12:18:33 -08:00
Álvaro Velad Galván 956eaf315d Add AV1 check and more file extensions for src mode (#2280) 2019-12-05 14:24:15 -08:00
Álvaro Velad Galván 8cbe54575a Allow disabling the text parsing, decoding, etc in DASH/HLS with a config (#2278) 2019-12-04 13:50:56 -08:00
Álvaro Velad Galván f6da953112 Allow ignoreSuggestedPresentationDelay in DASH (#2260)
* Add ignoreSuggestedPresentationDelay configuration

* Add test

* Change test name

* Add missing locale
2019-12-03 11:22:40 -08:00
Álvaro Velad Galván 05c03fcf64 Allow disable the video parsing/decoding/.. in DASH/HLS with a config (#2259)
* Add disableVideo configuration

* Add missing locale
2019-12-03 11:11:06 -08:00
Joey Parrish 0ad9aa3fd9 Fix EME polyfill issues
This fixes several inter-related issues:
 1. Catch errors in polyfill installation so that test setup isn't
    interrupted half-way through
 2. Use the compiled polyfill in tests, fixing polyfill installation
    error during tests on IE
 3. Require at least version 1.0.2 of the polyfill, since 1.0.0 had
    bugs in the module export and 1.0.1 had an infinite recursion bug

Change-Id: I38c973152409d9b3168e70e82f20579566663208
2019-12-02 12:28:28 -08:00
Sandra Lokshina 1b3b78ea16 Add ad position info to the UI. (Ad x of y).
Issue #2222.

Change-Id: I9bf946552bc6f669164c387480fadc100087708a
2019-11-22 22:04:05 +00:00
Joey Parrish aff3ad78cd Fix shaka.polyfill missing in externs
The generated externs did not include shaka.polyfill because we used
the wrong annotation on the class.  This fixes it.

Raised in PR #1273

Change-Id: I348064a117a7e1878b439ad8bd1ce49df56bfd39
2019-11-22 10:47:39 -08:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00: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
Sandra Lokshina 64e42fa9b6 Integrate skip button into ad experience.
Change-Id: I49e78c56c178bab47b3773f01f06c171bb422cb8
2019-11-21 18:59:24 +00:00
Theodore Abshire 2b1ffa3648 Add support for ttml regions.
Closes #2191

Change-Id: I2a4d5cc9bc354b8ea429ab93476a9ad53b6f8e50
2019-11-14 23:15:09 +00:00
Germán Krauss b4bfa1550d Disable indexedDB support if an error is thrown (#2236) 2019-11-14 11:16:03 -08:00
Sandra Lokshina 47c857d100 Make it possible to exclude ads from the build.
Closes #2231

Change-Id: I3ef4ce09fa3a08bfcaffa2d53aae4bbec70b33c1
2019-11-14 18:13:55 +00:00
Joey Parrish c395a75b3c Fix exception on adaptation decisions
Because aborting requires knowledge of the new stream, this process
must be done asynchronously.  This makes the abort logic async, and
checks carefully for any stream or operation changes during the
process.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: Ic187676eeca907603efeb0ffa11855b9af2fc5ca
2019-11-07 11:32:58 -08:00
Sandra Lokshina a70676826a Add a method to select variants by label.
This also addresses an old TODO about switching
variants and text separately.

Closes #924.

Change-Id: I46644ca04dfc8b36696696078c4f14ee15774356
2019-11-07 18:31:41 +00:00
Jacob Trimble 8e956ccaeb Update changelog and bump versions for v2.5.6
Change-Id: Id5c3aea9de80e28d2e87244e49b1cd6b9b6273e4
2019-11-06 20:54:38 +00:00
Joey Parrish 289d473dfd Drop the nearly-unused createUris method of SegmentReference
Change-Id: I0ec00e614b2870b8a18d2bb0cd0fc95232c6c28d
2019-11-06 10:51:04 -08:00
Joey Parrish 0c08793392 Clean up async issues in "lazily create SegmentIndex"
Instead of making many internal methods async to accomodate
createSegmentIndex being called lazily, just call createSegmentIndex
during the update cycle instead.  This greatly simplifies things and
allows me to revert some of the changes I made in the earlier commit.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: I72be8e88f0cf8b04b63d3cda129fa38cef727c0f
2019-11-06 18:50:53 +00:00
Jacob Trimble c56fe7db19 Fix and cleanup offline without init data.
The PR to add support for pulling EME init data from the segments was
incorrect and had some bugs.  This stops re-initializing DrmEngine since
this isn't needed and could cause problems with the offline licenses.
This also just uses the Pssh helper once to parse and extract the
init data.  Lastly this throws the old error if we don't have any
sessions when we are done;  if we try to store WebM content, we should
still throw if there is no init data in the manifest.

Issue #1531

Change-Id: Ie524abda993a076397e233008709f11a2e68a8f8
2019-11-05 23:33:54 +00:00
Jacob Trimble ea84dfe494 Avoid creating buffers in PSSH.
Now shaka.util.Pssh will only create a view on the buffer instead of
re-creating the PSSH boxes for each element.  This also removes the
boundaries field since the data fields are the useful ones.

This also fixes a possible bug in BufferUtils, updates comments, and
adds some more tests for negative offsets.

Change-Id: Ibe1b7d61d5f5c7e52dfd7aa954db98f0592da4a5
2019-11-05 23:32:37 +00:00
Jacob Trimble 91b8797812 Fix Mp4Parser start calculation.
The "reader" reads the payload of the box, so we need to add the header
size to the start index to get a correct value for the "start" field.
The "start" field isn't used anywhere, so this wasn't caught.

Change-Id: Ia870d01620524ac6e87dea2b7f1bc8571425a976
2019-11-05 23:32:29 +00:00
Joey Parrish d749c5d156 Performance: lazily create SegmentIndex
In StreamingEngine, rather than wait to enable ABR after indexes have
been created for all streams, create each stream's SegmentIndex
on-demand as needed during playback.  This means ABR can be enabled
much more quickly, and also eliminates some complexity from
StreamingEngine's startup sequence.

This required several test changes, since many of our tests were
accidentally structured to depend on certain operations either being
synchronous or happening early during startup.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: I4bc1d0cdf9022aad14a008accf0aac37c870a83f
2019-11-05 09:40:58 -08:00
Sandra Lokshina d47362ac5e Integrate play button icon change with ads and fix fade out.
1) Play buttons' icons now toggle between play and pause
depending on ad state during ad playback.

2) Controls fade in and out on mouse out/in during
ad playback similar to how they do it during the
presentation.

Issue #2222.

Change-Id: I97ce3b5aa70bdfdd758a54894a3d94b38bccf953
2019-11-01 14:02:19 -07:00
Sandra Lokshina 8fff91531f Toggle ad's fullscreen mode when document.fullscreen changes.
Issue #2222.

Change-Id: I2ab145391cf8dacad261e0a21f69f68508ef3884
2019-11-01 11:27:50 -07:00
Sandra Lokshina 688d8881d9 Change controls behavior when an ad is playing.
This CL makes the controls switch between controlling
the ad and the presentation. If there's an ad currently
playing, pause button will pause the ad instead of the
presentation, mute button will mute the ad, etc.

Change-Id: I42f57df9a5ce491ed842f39e0f1e6031d1e3a93c
2019-11-01 16:25:52 +00:00
Jacob Trimble 67941d7ae9 Update comments in persistent-license tests.
Most of the persistent-license bugs on Chrome have been fixed, so this
updates the comments to point to the only remaining issue.  The tests
have also been updated to pass (except for the flaky failure caused by
the remaining bug).  The tests are still quarantined since they are
fairly flaky, even with a large delay.

This also adds some more logging to DrmEngine, makes it use the
"session.closed" property when closing, and removes the close
workaround for Chrome since it has been fixed.

Change-Id: I2dbd0b7005e288ae2a4d9694516daae6f5e0b49a
2019-10-31 17:07:23 +00:00
Jacob Trimble 17432912a8 Add integration tests for Player buffering.
Change-Id: I3efc5f1c23090fca566bc2a63f707a6b4ae655b7
2019-10-30 22:30:51 +00:00
Theodore Abshire 8004e47c46 Ignore delayLicenseRequestUntilPlayed for storage.
When storing assets offline with the storage system, the DRM
engine is used if the asset is protected. However, we never attach
the DRM engine, which means it never gets an associated video.
When the delayLicenseRequestUntilPlayed config value is set, the
DRM engine checks the paused status of the video; thus, if there is no
video element, the DRM engine errors and the download fails.
It would be fairly simple to make the DRM engine attach the video, but
honestly, the delayLicenseRequestUntilPlayed parameter doesn't make
sense for offline storage anyway. So this just changes the DRM engine
to ignore delayLicenseRequestUntilPlayed if it has no video.

Fixes #2218

Change-Id: If4e8d24fdcd1eca81cc39b845e5a833a3f1ce5e6
2019-10-28 16:02:02 -07:00
Sandra Lokshina 02847e3b1f Show ad controls and update ad counter when ad starts.
(Also hide ad controls when ad ends).

Change-Id: Ifd5b8ec47fe08ef277d86f96632677c7c07cfbd4
2019-10-28 22:10:55 +00:00
Jacob Trimble 450d8a60c4 Fix check for captions in appendBuffer.
An empty list is still truthy, so the if statement should check for a
non-empty list instead.  This ensures we don't try to append captions
when we play audio-only content.

Fixes #2187

Change-Id: I589a5508878ab28ad1ac69211f331ea829fa8b28
2019-10-28 20:52:09 +00:00
Jacob Trimble ef28a58125 Allow 'rebufferingGoal' to change after startup.
Fixes #2217

Change-Id: If525ebbeef8dccbc814f53b0bf9c9d562c5b448e
2019-10-28 20:51:07 +00:00