Commit Graph

2532 Commits

Author SHA1 Message Date
Aaron Vaage cb4e35229b Be more explicit in DrmEngine destroy
We do a lot of tear down in DrmEngine at the same time. While this often
works well for common tasks, when tasks focus on different parts, it can
introduce some race conditions.

This change looks at being a little more strict about the order we do things
in DrmEngine destroy.

While this does not fix #1728, the hope is that this will correct the
"read property 'catch' of undefined".

Issue #1728

Change-Id: Id3cd25b416969ecd75a8cdd6d36959e34673fa1b
2019-01-04 21:27:56 +00:00
Aaron Vaage 58d4163401 Add Important Note about Media Source Engine Construction
When we create a media source engine instance, we pass in
a closed captions parser. However a key subtlety was missing
from the parameter description; media source engine is taking
ownership over the parser.

Change-Id: Id49483ccac4cc1812c31ead9e82c09390ce2ed37
2019-01-04 17:18:31 +00:00
Theodore Abshire e5b2428c6f Also use large gap threshold on Chromecast.
It appears that Chromecasts stop a fraction of a second before a gap.
This would sometimes cause them to stall on gaps in a way that the
stall prevention would not fix.
This changes Chromecasts to use the large gap threshold, to fix those
cases.

Issue #1720

Change-Id: Ifc6720e55ab35b81b8592dad2ba7e7293983a755
2019-01-04 03:50:26 +00:00
Michelle Zhuo 4cd5666d84 Clear closed captions map when text engine is destroyed
Change-Id: I610334e6ad187a09e8831cde285d9a0e38876aad
2019-01-02 16:28:53 -08:00
Jacob Trimble c3ce160217 Consolidate default configs in tests.
Instead of duplicating the default configuration values in each test,
this now uses the default configuration methods.

Change-Id: Ifd2ab349db7903a2acb0d06fed4bd0ccd5050b35
2018-12-27 18:00:55 +00:00
Aaron Vaage 25e92be2c8 Isolate and Highlight MuxJS Dependency
To make it clearer that the CloseCaptionParser uses MuxJS (and therefore
it requires MuxJS) it has been renamed to be MuxJSClosedCaptionParser. To
further isolate the dependency on MuxJS, the support check that we must do
before using the Caption Parser has been moved to a static function on the
parser.

Change-Id: If3385f192434d8f8ce0c1cadbc6365a7c5df9d5d
2018-12-26 21:16:49 +00:00
Aaron Vaage e610c09ee5 Make Chromecast Tests Use Platforms
We have a utility to test what platform we are running on. It looks
like the chromecast tests were not making use of it.

Change-Id: I0eddbf1fe1aa2c1707947a3c268672a3808ec4dc
2018-12-26 18:30:14 +00:00
Aaron Vaage 9e180712f4 Update Timer to ES6
Updated the shaka.util.Timer class to ES6. In this upgrade, the implementation
was slightly changed to make better use of arrow-functions.

Documentation for the class was expanded on to better document how multiple
calls to start would work. To ensure consistency, both "schedule*" methods were
merged into a single "start" method.

Issue #1157

Change-Id: Iae86cae4d9cb751f0985ef20c371c0023c40bd53
2018-12-21 23:39:54 +00:00
Theodore Abshire 4b1fffa886 Fix controls.css location in cast receiver html.
When we switched to using less for our css, we forgot to update
the cast receiver to point to the compiled css. This corrects that.

Change-Id: Ib5d9336fc1b14233731004be845b819be2b20307
2018-12-21 23:08:42 +00:00
Theodore Abshire 9fe3b2fe78 Fix fetching ui elements on cast receiver app.
Change-Id: I1f5ef7a573a6cbb85365e6e8a195f777190d956a
2018-12-21 22:37:53 +00:00
Michelle Zhuo 337c1a9f02 Create closed caption parser only when mux.js is loaded
Issue #1404

Change-Id: Ic65bdf1254c379dc44770e26d777728cf255eb82
2018-12-21 21:35:25 +00:00
Aaron Vaage 66377ecfff Use Timer In Playhead Observer
Before, we would schedule (and reschedule) the poll function in the
playhead observer. We do this a lot in other classes and even have a
timer class to do that.

This change updates Playhead Observer to use the Timer class to handle
the polling events.

Change-Id: I5982ab08de47d4f8a71ab467989f63c06d0853d2
(cherry picked from commit b8a807b2ef0b2906ee3856a9b2a5dc4922973679)
2018-12-21 20:04:24 +00:00
Aaron Vaage c861cb8688 Correct Assertion For Initializing Deprecation
It looks like the assertion for deprecation was inverted, it
would expect that the enforcer was created even before the
first call.

Close #1744

Change-Id: I74b0321d8db497612b29aaac59678373587b2a8a
2018-12-20 21:22:28 +00:00
Jacob Trimble ced5ecda48 Add FAQ entry about Chrome robustness warning.
Change-Id: I02515fc254b3947af6816b1ad729bf213f797ea5
2018-12-20 10:10:51 -08:00
Joey Parrish 4f08dab6fb Stop resizing the play button in JS
Make the play button and spinner a simple 15% of video width.

Fixes b/116328412
Fixes #1715

Change-Id: I31708d0066a033e64ebdeb9fa603688c5f99860b
2018-12-18 22:40:10 +00:00
Aaron Vaage 41f0f0e560 Don't include video roles in audio-language-role pairs
Rather than using tracks (that merge the roles) use the streams when
creating the audio-language-role pairs.

The reason we tried using tracks was to remove the need to handle
audio muxed into video streams. With this change, that problem is back
but we fixed the broken behaviour.

Issue #1731

Change-Id: I837406469195956089f33f93f4a9e3c64ffbeab2
2018-12-17 17:19:44 -08:00
Aaron Vaage 275a68c7fb Test Video Roles Are Not Included in Audio-Language-Role
A change to how we collect the audio-lanugage-role pairs allowed
the video roles to be included.

This change adds a test to make sure that does not happen. It
will fail now and be fixed in a later CL.

Issue #1731

Change-Id: I1178fce70f38ff7b6d9ddabfb73157985f6f63b6
2018-12-17 17:19:43 -08:00
Aaron Vaage 8c69ab1a76 Stop passing "is live" to |Player.applyPlayRange_|
|applyPlayRange_| in |Player| was previously passed |isLive| but that
value would come from the timeline that it was already passed. Instead
of passing in |isLive| this updates |applyPlayRange_| to check the
the timeline for the "is live" condition.

Change-Id: I13efccd14b9177d2fd652347dce55338d74b7ec8
(cherry picked from commit d02959f3288ec140098d555559bcab9c51d02ca7)
2018-12-14 23:02:12 +00:00
Tomáš Tichý e3739c9495 Add safeSeekOffset to StreamingConfiguration (#1726)
Closes #1723
2018-12-14 11:01:50 -08:00
Jacob Trimble 5ee470ddbe Favor license URL in configuration over manifest.
This is consistent with our other configuration settings that are
used as overrides and the manifest values are used as the default.
This means for the manifest URL to be used, there needs to be no
license server URL given in the configuration.

Issue #484

Change-Id: Ib332fe66cd0b13613a17b4ca59496c5185ee65c9
2018-12-14 16:25:33 +00:00
Aaron Vaage 7426cfa1f0 Resolve SessionDeleter Compiler Warning
It looks like the lack of a constructor is at the root of the compiler
warnings when you try to alias a class.

To stop the error, I have made a small modification to the session
deleter class so that it could have a constructor.

Change-Id: Iad4614d80dc317b20f01930019096fb388b74ed9
2018-12-13 19:12:42 +00:00
Joey Parrish 6e14d10d91 Update comments in quarantined offline test
This updates the comments to explain why the test fails, what we are
waiting on from Chrome, and under what conditions it could leave
quarantine.

Change-Id: I1def268ebbc59a4e7be57e46d878061b5b7e2efa
2018-12-13 19:07:51 +00:00
Tyler Daines 3c8241f3c7 Add license url parsing (#1644)
This adds parsing license URLs to the DASH parser so the URL can be embedded in the manifest.

Fixes #484
2018-12-13 10:58:27 -08:00
Joey Parrish fc52f263be Work around offline integration test failure
This adds a workaround for a Chrome bug so that the test can be
unquarantined.

Change-Id: I3b076af346db008f3b59e7897c79e78f29fc72df
2018-12-13 09:50:15 -08:00
Joey Parrish 618864e2fe Quarantine failing offline tests
Offline tests are failing due to some combination of 4 related Chrome
bugs:
 - http://crbug.com/690583
 - http://crbug.com/887535
 - http://crbug.com/887635
 - http://crbug.com/883895

Closes b/120553775

Change-Id: I0b75eb64aa924a01fd5bb0afb0f858a68eaff501
2018-12-13 17:50:03 +00:00
Joey Parrish 49fbade422 Simplify the buffering spinner layout
- Drop the containing div
 - Move the SVG inside the play button
 - Drop overlay semantics, let the button simply contain the spinner
 - Change SVG coordinates to fill the viewbox

The SVG size is now matched to the size of the play button, and only
the button needs to be resized to resize both the button and spinner.

Prework for b/116328412, #1715

Change-Id: Ie1386f5f269978763adb36b77defe040e3aab503
2018-12-12 15:34:04 -08:00
Joey Parrish 2872f31e01 Add polyfills for Safari 12
Now that we have Safari 12 in the lab, we have found that it requires
the same MediaSource polyfills as Safari 11.

Fixes b/120434307

Change-Id: I45f8be79d0aca7987ffcba1ce13b8589a2287712
2018-12-12 10:47:39 -08:00
Aaron Vaage 1b90e0f4c1 Integrate Deprecation Tool With Library
This integrates the deprecation tool with our library and updates
all the deprecated warnings to use our new tool.

As some features needed to be removed in 2.5, this change removes them
since their deprecation checks would make us fail.

Change-Id: I28310bbe9df6839719f4763a96026d5968bdcea6
2018-12-12 00:26:50 +00:00
Aaron Vaage 161464b802 Define Deprecation Tools
Define a set of tools that we can use to track, test, and communicate
features that are being deprecated.

When you want to communicate that a feature is now deprecated, you just
need to put:
  ```
  shaka.Deprecate.enforce(MAJOR_VERSION_NUMBER,
                          MINOR_VERSION_NUMBER,
                          'Your message about what is being deprecated');
  ```

This will now print warnings when the feature is waiting to be removed and
print errors and fail asserts when the expiration has passed.

Change-Id: Ic66c53ecdfba7922cf961c7f588ab06beceb16ac
2018-12-12 00:26:50 +00:00
Aaron Vaage 0dbd2d2a4e Define Deprecation Version Class
Define class that will be used by the deprecation system for handling
library versions. We are only going to support deprecating at a
minor-version number level. We are able to use this to our advantage
when implementing Version as it makes the code MUCH simpler.

Change-Id: I041bc8d7c20a277d84fb621479b3116e3751e319
2018-12-12 00:26:50 +00:00
Aaron Vaage c559898f83 Update getGapIndex threshold comment and logic
The original threshold logic in getGapIndex was for IE/Edge
bust was later updated to include Tizen. However the comment
around it was not updated.

This change updates the comment and the code to better
communicate what all is affected.

Change-Id: I05638a5e51e6052946c67c3bc2850d0347c1ce21
2018-12-10 22:10:30 -08:00
Aaron Vaage 4167b1658b Isolate Platform Checks
To make it easier to know where we are check what platform something is
(normally a sign of a work-around), this change isolates the logic to
make the check into functions.

Now looking for uses of |shaka.util.Platform| should show when we are
using platform-specific logic.

Change-Id: Ief49837c503e951f7138ec08a83355fe1c46db88
2018-12-11 05:43:52 +00:00
Joey Parrish 918a86377a Fix support for fullscreen events
When we enter or leave fullscreen without the user clicking our
fullscreen button, we should still react and update the UI as if the
button had been the cause.

This change splits up changing fullscreen state on click from reacting
to a state change, which may or may not be caused by a click.

Fixes #1725

Change-Id: I37b98c6e9eeb508a07c91fec40627e8073295557
2018-12-10 13:44:31 -08:00
Joey Parrish 75174ba2ce Fix container size and resolve some TODOs
This fixes a small bug in the size of the video container (hardly
noticeable) and resolves some TODOs (documenting box-sizing and
abandoning a non-viable refactor TODO about font-family).

Change-Id: I6586e018e79fdf2d0d24a90c0c4c6ec10430e50f
2018-12-10 13:44:24 -08:00
Joey Parrish bd47e6e9b4 Fix focus styling and tab nav
This makes focus styling consistent across browsers and makes the
video element itself non-tab-navigable when the custom controls are
shown.  If native controls are turned on, we make the video element
tab-navigable again.

Fixes #1679 (tab nav styles inconsistent across browsers)
Fixes #1680 (tab nav on video element on Firefox)

Change-Id: I7f7a4af4cc8fc6ab1164d821f57684b5d726ebb7
2018-12-10 13:18:14 -08:00
Joey Parrish 28baafe11c Fix play button size
Make the play button a little bigger by default, to encompass the
default size of the SVG spinner.

This fixes display on browsers where our JS resizing code has no
effect, such as IE 11.

Fixes #1709

Change-Id: Ie91869884ab26cec90099a81143880077cefe3c1
2018-12-10 11:45:44 -08:00
Joey Parrish 742630f5e0 Overhaul range input elements in the UI
For the volume bar and seek bar, we use an input element of type
"range".

These elements are composed of two main parts: a "track", which is the
horizontal bar, and the "thumb", which is the knob which slides along
that bar.

In order to style the track across browsers (cough, IE 11), we need to
do something a bit tricky.  Styling the track is a nightmare,
especially if you want the thumb to be larger.  On IE 11, this gets
clipped at the track size.  So a tiny track with a large thumb is not
easily achieved.  It can be done, but the techniques for it are
incompatible with the gradient background we want to apply to it.

The solution is to put the input inside a div container, and apply the
background gradient styles to the container.  The container will act
as a visible, virtual track, inside which is contained a larger,
invisible track, in which is contained a visible thumb.  This way, the
thumb is not larger than the actual track (for IE 11's sake), but can
be larger than the virtual track.  And since we are still using a
semantically correct input element, the element is inherently
accessible.

Fixes #1703

Change-Id: I80e1c18d56e0d1455efd26310b699561bf2f41b0
2018-12-10 11:45:41 -08:00
Joey Parrish 2379c4485c Refactor and clean up CSS/Less, and controls JS
- Make shaka-overlay-parent a mixin instead of an actual class
   - Fox maximum stylability, it should be the job of the styles to
     position and overlay objects without JS code declaring that it be
     so.
 - The "seek to live" effect of clicking the current time no longer
   depends on the seek bar being used
 - The shaka-transparent class is not needed.  The controls are now
   set to be opaque based on an attribute.
 - Use an attribute for casting state as well.
 - Remove redundant opacity transition on play button.  It is already
   on the controls overlay as a whole.
 - Make layout more generic, which allows us to remove some explicit
   positioning and browser-specific layout hacks.
 - Rename user-select(), whose value is always the default of "none",
   to unselectable().
 - Remove unnecessary or redundant styles.
 - Apply the same default styles to all control elements, whether
   buttons, divs, or inputs.
 - Make overlay-parent() and overlay-child() more resilient with
   settings to fill space by default.
 - Consolidate the setting of displayed & hidden in JS.

Pre-work for #1703, #1709 (IE style fixes)

Makes progress on b/116651454 (hard-coded offsets)

Change-Id: I7ea579429979afa98f5b2c54f68114312c4f508d
2018-12-07 22:07:13 -08:00
Joey Parrish 436baa3343 Tolerate loadNewTextStream during startup
To fix the race in #1696, StreamingEngine now checks its state in
loadNewTextStream to ensure that it does not start a race between
the startup phase and the new text content.

Fixes #1696

Change-Id: I0f323a5d56b0585fb6e356308aa9eedeee8156b2
2018-12-07 16:39:09 -08:00
Joey Parrish 41305dc62e Regression test for language/MediaSource failure
This is fairly tricky to reproduce.

First, we must trigger the auto-display of subtitles.  We didn't have
any tests that covered this before, so we needed this anyway.  This is
triggered by careful choice of content language and language
preferences, which required us to add language information to our
simulated test content.  I also added tests for the cases where we
should *not* trigger auto-display of subtitles.

Second, the setup phase for text must complete more quickly than the
setup for audio & video.  In real life, this happens when text is
non-segmented VTT and audio & video use DASH's SegmentBase.  In the
test, this is accomplished by delaying createSegmentIndex() of
audio and video in our simulated content.

This will cause auto-display of subtitles to trigger a setup race in
StreamingEngine.  When text wins the race, MediaSource errors follow
for audio and video.

Issue #1696

Change-Id: I1c22089925486da642368bec269a55d8556900d1
2018-12-07 16:35:57 -08:00
Joey Parrish 2b004f9380 Clarify code to auto-show subtitles
Vaguely relates to the investigation into issue #1696

Change-Id: I5d16f5cbdabf72361598e28bff196a5be7030967
2018-12-07 16:33:14 -08:00
Joey Parrish bab073932a Improve CSS/Less comments
This doesn't start refactoring, but does move a couple of lines around
to group them in clearer ways.  It also adds lots of comments
explaining what things are, what they are for, and where they appear.

Pre-work for #1703, #1709, and b/116651454

Change-Id: I77a76c569e4e426b040eaf55f900baa38414fc0c
2018-12-07 23:27:00 +00:00
Michelle Zhuo fd91f6ab73 Fix relative location urls
Fixes #1668

Change-Id: Ib9e1a19254f1829795bd69cc930d21f33e136980
2018-12-07 20:01:10 +00:00
Joey Parrish 9f2b4ef617 Split up less/CSS into several files
This doesn't change any styles.  It just splits related styles into
several separate files, so that things are easier to find.

Pre-work for #1703, #1709, and b/116651454

Change-Id: Icd3330a70ca6c8ff313991c127f8036238cae813
2018-12-07 10:09:37 -08:00
Joey Parrish b342045afe Add support for multiple Less sources
I will break up our monolithic less file into pieces, but first the
build system needs to understand this.  It should see changes to any
less file as warranting a rebuild, but the actual compiler command
only takes the top-level less file on the command-line.

Pre-work for #1703, #1709, and b/116651454

Change-Id: I7be8f9467fa6df449f89ed8f5488fc1c735f0b75
2018-12-07 10:09:37 -08:00
Aaron Vaage 5620a86494 Update FakeClosedCaptionparser Block Comment
Updated the block comment for the FakeClosedCaptionParser to
better explain what its purpose is.

Change-Id: I9c9e6995aa1ad09d1c9215ab48728ecf7442ab0f
2018-12-06 17:56:40 -08:00
Michelle Zhuo b6ce485c72 Remove aria-pressed state for captions button
Removing the "aria-pressed" values for the captions button.
Now it's read as "Captions button", and once the button is clicked, it
will read the captions options, like "English button selected".

Issue #1706

Change-Id: I6b4c9208ae688b1b6c1d74126f9aced3876a6d2d
2018-12-07 00:28:29 +00:00
Aaron Vaage f09d5d7a6c Pass ClosedCaptionParser into MediaSourceEngine
Instead of requiring media source engine to create its own closed
caption parser and then allow tests to override it, have it be
passed into the constructor.

This allows us to easily use the fake one in all our tests and
removes the need for a test only method on media source engine.

Change-Id: Ia1d4f0bb988dca30699b30ccaf4522126f357f90
2018-12-07 00:10:13 +00:00
Sandra Lokshina e57bb632b2 Localize picture-in-picture button.
Also fixed the Russian translation for "Cast" while I was at it.

Fixes #1682.
Fixes #1252.

Change-Id: I0f32f1e65a35571f6d60bfc597a4d941064b308a
2018-12-06 22:32:14 +00:00
Aaron Vaage 01052c516f Make FakeClosedCaptionParser non-extendable
Since we are not currently planning to extend from the
FakeClosedCaptionParser, this change marks it as "final" so that
our current intentions are better communicated.

Change-Id: I296e6efb9b4654c632fcb5b2f0d30e224a1b9a0e
2018-12-06 02:38:27 +00:00