This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs. This does not
affect the compiled output, and is only done for consistency.
Issue #2638
Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
In many places in the tests, we used "Object" or "*" or just no type
at all for various fakes. These were all flagged by the new Closure
Compiler version we are adopting.
In some other places, we mixed up similar types or had the wrong
nullability on a type.
In still others, types were missing fields.
These issues were caught by a compiler upgrade.
Issue #2528
Change-Id: I324e0b28f7e30a4102aa26ec2c9901fa9732211b
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
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
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
During startup, there was a race between the video element's ready
state and seeking to the requested start position. If the video
became ready before the seek to the start position, there could
briefly be 0 tracks. Reproducing this required a first period start
> 0 and a start position > 0, such that a lookup of the "current"
period during this brief window would return null.
The problem was more likely to be seen on Chromecast, where the time
between load() and the completion of a seek was much larger than on
desktops.
The bug was caused by Playhead, which both seeks to the start position
and manages the concept of "current time", returning the start
position during startup and the video element's position thereafter.
This fixes the race, making sure that startup is not considered
complete by Playhead until the initial seek is over. This adds an
appropriate regression test and simulated content that can reproduce
the conditions in the original bug report.
Fixes b/138941217
Fixes#2045
Change-Id: Ie8a57283468d88697619349a29e37a804586e5ef
Some platforms (e.g. IE11 and Tizen) don't support passing an object as
the third argument to addEventListener. When we do, it interprets it
as a "true" for the capture value and causes the listener to be called
at the wrong time. This now detects whether the browser supports this
and calls the boolean version if not.
Fixes#1979
Change-Id: I05b3f5e536a9bcb5c275cac7f243a9ccc88f8149
This is an automated change to convert use of "function" functions
to arrow functions. This doesn't change all uses of bind() that
could be converted. This also doesn't remove all "function" functions.
Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
- Disallow mixing different types of some operators (e.g. && ||).
- Disallow useless constructors.
- Require a newline between class members.
- Require spacing around arrow functions.
- Require using the compound assignment when possible (e.g. +=).
- Check for possible errors in assignments involving "await".
Change-Id: Ib48167aea61a62b33f0b76bb869abe18398ee5b7
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
This change moves the trick play logic out of the video wrapper so that
it will be more available to the src= code. By doing this, I hope that
we can make it clearer how we are working with the playback rate and
ensure a tighter integration with it.
Issue #816
Issue #997
Change-Id: Id462cda2c5eb82c3713237341424b91891bd38ea
We need to have a playhead for media source and src=, however the
current playhead implementation is tied very tightly to manifests.
Rather than working to refactor playhead, this change defines an
interface and makes the old playhead the Media Source implementation of
the interface.
In a later change the src= version will be introduced to allow playhead
functionality when we don't have a manifest.
Issue #816
Issue #997
Change-Id: Ie74e50839c79c3cd3acf14000849e3d5fa71a42f
This change takes playhead and its internal members and moves them
over to use the IReleasable interfaces instead of the IDestroyable
interface.
Change-Id: Iddb525725591a29a61ca6b5e2ad519ab708164eb
Instead of duplicating the default configuration values in each test,
this now uses the default configuration methods.
Change-Id: Ifd2ab349db7903a2acb0d06fed4bd0ccd5050b35
The workaround for Tizen stalls broke the gap-jumping tests on
IE/Edge/Tizen because those platforms will trigger gap jumping when
they are within 0.5 seconds of the gap. So this adjusts the timer
so it doesn't put the playhead 0.5 seconds from the gap.
Change-Id: I78b0fe199bad209bd5e18263112f6f2971bed119
Sometimes the Tizen TV will stall inside a buffered range. We have
stall-detection logic, but for Tizen's case, it doesn't change the
readyState of the video, so our logic doesn't trigger. This changes
the logic to work for other kinds of stall too.
This also changes the tests since they waited too long. Since the
tests would wait for a second, the stall-detection logic would trigger
and move the playhead. So now the tests move time more frequently to
more accurately represent the moving playhead time.
Fixes: 110093558
Change-Id: If4dd36dd3da309d5a9bc67d539bf2f9cb27df862
https://goo.gl is being turned-down, so we can't use it for new URLS.
So we have consistent short links, this converts them to be
https://bit.ly.
Change-Id: I07a86cba807b67157664893341f648023918d0de
Playhead.onSeeking_ assumes that seeking is nearly instant;
thus, it has 0.001s tolerance. That works fine on most platforms, but
on some slow platforms (e.g. v1 Chromecasts), this can actually be a
problem. Specifically, it can cause them to get stuck in a loop of
repeatedly seeking, when playing HLS livestreams.
This changes Playhead.onSeeking_ so that it will only attempt to undo
a seek once every second. This way, if running on a slow platform, it
won't get stuck trying to seek to start time.
Closes#1411
Change-Id: Ia4fa6da8bcd90eb04b80d80c3f793bba2a7f382d
On Chromecast, some streams were unable to keep up with the narrow
seek window, and got stuck perpetually seeking forward.
This change increases the seek window to 3 seconds long, which some
initial testing has shown to be the shortest value to play without
uncomfortable choppiness.
Unfortunately, v1 Chromecasts still have issues, even with this.
It seems like they have a separate issue.
Issue #1411
Change-Id: I597315cd418861b18e63a859197a8c2585cb4fd0
Our support for CEA 708 closed captions only works if the container
video file is transmuxed. Because of that, we were not successfully
reading such captions on platforms with native TS support.
This change adds a configuration option to force TS to be transmuxed
even when unnecessary, to account for that situation.
It also adds an integration test to ensure that CEA 708 captions can
be extracted on every platform.
Closes#276
Change-Id: Id8b2a67f2327d1b69c9cdfc443e9592c99baf0db
This fixes a weird edge case where StreamingEngine could get stuck
waiting for Playhead.
If StreamingEngine is playing close to the left edge of a live stream,
a manifest update can evict segments it needs. This causes
StreamingEngine to wait for segment references. This condition won't,
change, though, until Playhead seeks back into the seek range.
Playhead wouldn't seek back into the seek range until video.seeking
became false, which couldn't happen until StreamingEngine appended
some content that intersected with video.currentTime.
There seems to be no good reason for Playhead to care about the
video.seeking.
This resolves a startup failure while trying to play live streams at
the left edge of the seek range on slow embedded devices such as the
v1 Chromecast.
Bug: 75276747
Change-Id: Iaa084e8220ace174909d3ad91abe0c1eac00cea9
Fixing the seek after load not working issue where our customer wants to
start the video from a certain time when playback.
Deleted earlySeekTimer.
Closes#1298.
Change-Id: Ifa293c20c1baf76193948e3b5a7778a2f262222e
This unblocks conversion of tests to async. We ran into issues in
compiler version v20171203 which have already been fixed upstream.
We are not, however, updating the linter. The matching linter version
reports errors about our tests not using goog.require, which we do on
purpose. We will wait to update the linter until we have resolved
that.
This change also fixes issues discovered by the upgraded compiler:
1. Missing property definition in playhead_unit
2. Wrong type name in storage_unit
3. Wrong type name in FakeManifestParser
Change-Id: I4ba3f43e6a6471e182a69c85cfc619de3380c559
To allow playing live stream from certain offset from live edge, we
allow setting the value of opt_startTime parameter for player's load()
function.
Closes#1178.
Change-Id: I23a2375ba8ee5946791ee79714ed017c4e677c9a
When there is a zero-width seek range, don't repeatedly try to
reposition the playhead to keep within that range. This simply adds a
small buffer around zero-width seek ranges.
Closes#1331
Change-Id: I87b787f1454750eaa2caafa7c23cb9e37d3328e6
Google style guide requires adding curly braces to all block statements
even if it is only has one line. This fixes it by using eslint's
--fix flag followed by running clang-format to reformat the change.
Change-Id: Idc086c2aa8c02df5ef8b2140a11bfb9128eeb4bd
The browser should handle extremely small gaps for us. So having the
browser handle these gaps, this avoids an infinite loop if there are
rounding errors.
Closes#1309
Change-Id: I365f44185f570571f6b093bdcaad92fef49b5b16
Rather than using the availability window, Playhead should use the
seek range to restrict the playhead's position.
Closes#1224
Change-Id: I8612bfafb53bbb214e32aae2d71af52d748a3aee
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: If4792c1bd3d5a82c24a4b2f0f84790d4eed22e67
This splits some of the independent code from Playhead into several
new helper classes. This allows Playhead to be simpler and easier to
understand.
This keeps the new behaviors and classes as private pieces of Playhead
to keep Playhead conceptually in-charge of handing the Playhead. It
still has the same responsibilities, but the code is split into other
files.
Issue #1224
Change-Id: Ia828f902ba9490d128f4ca9cb1e34119ec93f188
This was only being used in tests which verified its own behavior. This
removes the useless method to make tests that use mock
PresentationTimeline cleaner. Code should use the availability window
methods indead of explicitly using the availability duration.
Change-Id: I0a9be8f319977ea8eb3ab50c65e458f49d9a3a75
This changes onPollGapJump_ to not gap jump if the video is seeking
but a seeking event has not yet occurred.
This also adds a unit test that tests for the bug in issue #1061.
Closes#1061
Change-Id: I8662f5878006ed8626ca8df55f0506edb2dd970e
Seeking to or starting playback at the duration does not work well
across browsers. Any seek or startup time at or past the duration of
VOD or IPR content will be bumped back by a configurable amount
(default 1s).
Closes#1014
Bug: 69874888
Change-Id: I6d21ecd8e211f0f823a093b8eb8b95d329b4385f
On Edge & IE, the timing of "loadedmetadata" and "timeupdate" events
is different, and exposed a race condition in the fix for #1105.
This solves the race by canceling any pending "early seek" handling
once "loadedmetadata" fires.
A fix for the fix of issue #1105
Change-Id: I5587a72e12c6b28beb0b3ea36f2665a0f1e39f08
We shall not buffer live stream, when the video is paused and the
playhead falls out of the seek range.
Closes#1121.
Change-Id: I66bbe1e62017f6ae8d121f072f324763f73da0f4
There are two ways Playhead should be able to recover from a drifting
stream:
1. Wait until the initial position is available
2. Seek to another position
Neither of these was working. For one, we couldn't detect seeks
before content was loaded. For another, we were constantly updating
the initial streaming position, so a drifted stream would never catch
up to our expectations.
This fixes both issues so that a drifting stream can at least recover.
Relates to issue #999 (drift tolerance)
Closes#1105
Change-Id: I8d2eedcff25b92b42ecd2e1f361d45ecbddd26ba
This also changes the tests so they mirror the |video.seeking|
property to reveal the problem that change created. That change
broke seeking into gaps and gaps before the start.
Issue #1149
Issue #1150Reopens#1061
Change-Id: I18fb65b1529acdacd0becd77078780625e0a955b
When the user seeks using Edge's native controls, Edge sets
playbackRate to 0 first. This confused Playhead and resulted in a
playbackRate stuck at 0 after the seek.
To fix it, we filter out rate changes to 0 in the code that remembers
the previous setting during a buffering event.
Closes#951
Change-Id: Ia7a9a2a6d65dcf2d74ea6fb4d92594070a1ebe6a
When the availability window of a live stream is very narrow, in
at least some cases, the playhead can end up starting before the
availability window. In that case, the stream will fail to load unless
gap jumping is set up to jump long gaps.
This makes the playhead jump ahead if it falls behind the availability
window, to avoid that situation (and others that might have the same
effect.)
Closes#916
Change-Id: I87f8c70ba6053d3524a1546e57d55cb6528cc683
This is part of adding a new conformance rule to add additional type
safety. This will disallow using properties of unknown types or using
unknown properties.
The first parts will be fixing errors caused by the new rule. These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.
Change-Id: I48335fc6659d3c33a6d55b00d087b59410c79cf7