Commit Graph

23 Commits

Author SHA1 Message Date
Joey Parrish db42d7e436 Revert "Fix bogus text track in UI with src= mode"
This partially reverts commit ad3d4604, because that fix seems to have
caused #2523.

This also adds a regression test for #2523.

Reopens #2516
Closes #2523

Change-Id: If3ed5942fff029f522e24048edcb4a04e7cc30e9
2020-04-23 21:33:28 +00:00
Joey Parrish ad3d4604af Fix bogus text track in UI with src= mode
When the non-UI TextDisplayer is constructed, it creates an extra
TextTrack that can never be removed.  This leads to a bogus text track
showing up in the UI when content is played in src= mode.

This changes the TextDisplayer to disable the extra TextTrack (since
there is no API to remove it) and changes the Player to ignore
disabled TextTracks when generating a track list for src= playbacks.

Closes #2516

Change-Id: I2e651f737445049da5fa46a798a2bc0751de2822
2020-04-21 13:26:14 -07:00
Joey Parrish b2c4ef5cf3 Fix flaky src= integration test on IE/Edge
For some reason, on Edge and IE, starting this particular piece of
content at time 5 results in playback beginning at 4.9.  It could be
that the number is rounded to a keyframe or something.

This changes the test to expect the start time to be within 200ms of
the requested start time.

Change-Id: I5399a1eaf8a84b57a88359db2584f043e4a11e81
2020-04-10 17:59:44 +00:00
Joey Parrish 99de217c23 Remove periods from manifest structure
This removes periods from the internal manifest structure and cleans
up code and tests accordingly.  This leaves us unable to play
multi-period DASH & offline streams until the main period-flattening
algorithm is completed in shaka.util.Periods.

Three test cases have been disabled for the moment.

Multi-period playback will be restored in a smaller, more focused
follow-up commit, with disabled tests re-enabled.

Issue #1339 (flatten periods)
Issue #1698 (rapid period transitions issue)
Issue #856 (audio change causes bitrate change)
Closes #892 (refactor StreamingEngine)

Change-Id: I0cbf3b56bfdb51add15229df323b902f0b2e643a
2020-04-09 19:22:16 +00:00
Joey Parrish 94f07dd410 Fix ratechange events w/ src= playback
The Player ratechange event is a filtered version of the video
ratechange event.  This is necessary because we manipulate
playbackRate as part of our buffering state management.

The UI uses this Player ratechange event to drive the playback rate UI
menu, but the event was not firing for src= playbacks (native HLS or
plain MP4s).

This fixes the ratechange event for src= playbacks, and also fixes a
small mistake in the MediaSource setup that could have resulted in the
ratechange event being triggered before playRateController_ was
created.

Closes #2488

Change-Id: If85e489d681cfbb1ae6141b490d82264e1d932bd
2020-04-07 23:36:07 +00:00
Theodore Abshire 6a6a47c5ca Added stats for time taken in load stages.
Change-Id: I3b9c8397999468e606b241f160174a2063b23ae0
2020-01-29 18:57:45 +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
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 5411838f7c Add startTime support in src= mode (#2271)
Closes #2267
2020-01-03 13:45:53 -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
Jacob Trimble 52522c7dca Fix cases where errors weren't propagated.
This propagates errors in several places and fixes waiting for some
async calls.

Change-Id: Idf4519b473538c1fa00bfe63e634194610ba29f2
2019-06-19 20:35:30 +00:00
Jacob Trimble 799e96c05c Convert test utils to ES6.
This also removes the unused SimpleIDB type and removes the duplicate
code in Utils that appears in Waiter.

Issue #1157

Change-Id: Ib3cfc16212b9d169b360825a25a084c5ebd7b80f
2019-06-03 18:41:17 +00:00
Jacob Trimble e59187adf5 Convert player tests to ES6.
Issue #1157

Change-Id: Ib405576ff77e324e5586b93cdbfddcde69d264ab
2019-05-22 16:14:19 +00:00
Jacob Trimble f225c047f6 Reorder eslint rules and add some more.
This reorders the rules so they mostly are ordered the same as the
eslint documentation.  The exception is the few at the top, most of
which should be removed.  This also removes some rules that appear in
the recommended or the Google set.  Lastly this adds some more rules:

- Require parenthesis when using "new".
- Disallow confusing regex (e.g. /=/).
- Disallow some confusing coercions (e.g. +foo).
- Disallow some Unicode characters in a regex.
- Disallow using "async" in a Promise constructor.

Change-Id: I597b472bdaee5b4cb92354f057e7ae6aeb96eefa
2019-05-09 22:14:18 +00:00
Joey Parrish c0c203cf2d Fix compiler errors found by a newer compiler
Change-Id: I83d81bcdc955331dc7afcc25c45802e77b7b7c02
2019-05-03 18:43:35 +00:00
Joey Parrish e8a12ed7a5 Fix src= test expectations for Edge & Safari
The test expecatations were not flexible enough to cover differences
in browser implementations.

Issue #816
Issue #997

Change-Id: I918c4d08f5b195046834ee534e84f4b8787487d5
2019-05-02 22:43:32 +00:00
Joey Parrish c0366cbf14 Replace 'canplaythrough' events with 'canplay'
I recently introduced two uses of the 'canplaythrough' event, but it
was pointed out to me that this implies that content is buffered
enough to avoid ever buffering again until the end.  Instead, we
should simply be using the 'canplay' event, which only implies that we
could start playback.

Change-Id: I3176f8c943ea7bf3f39967a616d9deffd5a4e791
2019-05-01 19:27:05 +00:00
Joey Parrish 8391fe1684 Extend Player track methods to cover native HLS
Track methods are now implemented for native HLS and other src=
playbacks.  This will allow the UI to select text and audio languages.

This change adds best-effort methods to get track information for src=
playbacks, including native HLS on Safari.  In many cases, it relies
on the audioTracks and videoTracks members of HTMLVideoElement which
are only implemented on Safari.  They are in the spec, though, so
there's no harm in using them when they exist.

This is fully parallel to the manifest-based paradigm for MSE-based
playbacks.  Each of these top-level methods in Player has an "if" to
decide which way to supply the requested info, except for the language
methods, which now delegate to the track methods.

With this, Safari's native HLS can supply audio and text language
information to the UI/app, and the UI/app can have some control over
those things through the tracks API.  I believe this is important to
the success of our new iOS support.

Issue #997
Issue #382

Change-Id: Icc44a932927fafedda1b62a9d4c6e2ed3dc7db30
2019-04-30 21:15:00 +00:00
Joey Parrish 8044961174 Fix src= test failure on Safari
This test was only passing by winning a race before.  Now, it waits on
the appropriate event before testing seekRange.

Fixes b/131604508

Change-Id: I1301719bbccb12895a3402af565bbcf00e88553a
2019-04-29 11:57:10 -07:00
Joey Parrish ea9a7d2b32 Relax restrictions on load state
Allow indirect access to members (such as DRM engine, manifest, etc)
from Player methods as soon as they become available, instead of
waiting until the very end of the load process.

This fixes application access to several methods during the
"manifestparsed" event.  The point of the "manifestparsed" event was
to allow early access to manifest and other metadata before streaming
begins.

This also lays the foundations for improvements in native HLS support
in those same methods, including the ability to get track information.

Issue #382
Issue #997
Fixes b/131604508

Change-Id: Ifee7b06fc2ccdcf5bcdf1c44f2f851d1d7e67fa1
2019-04-29 17:46:12 +00:00
Joey Parrish eff0d47c08 Factor out Tizen workaround
There is a workaround for a Tizen bug which appears in many of our
test suites.  To avoid having to add this to yet more, this change
factors out the workaround such that it applies to all tests.

Change-Id: Ie34c81bfcac94310bf3cd021fd4f2d55905b647a
2019-04-18 09:27:51 -07:00
Joey Parrish 322876dbb6 Fix src= tests
The integration tests for src= failed almost universally on Tizen, but
a few failed on other platforms, as well.  The issue was the fixed
delays in those tests.  This replaces those fixed delays with an
event-based utility that solved the same problem in other Player
integration tests.

Issue #816
Issue #997

Change-Id: Ib43cbb139ef77be1219e60d1fd5009aa403cc4cb
2019-04-16 20:43:41 +00:00
Aaron Vaage 39179c7836 Define Player Api src= Tests
Define an initial set of tests to ensure that the public player api
behaves correctly when the player has loaded content with src=.

Issue #816
Issue #997

Change-Id: Ie40bc926d1e56d37318f0ba7711903cdf8e6aa3e
2019-04-11 15:50:19 +00:00