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
We recently updated the Storage API to return AbortableOperation
instead of Promise. These tests did not get updated at that time.
The runtime backward compatibility kept the tests from failing.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: I05f75a5e4443b111c63d7969950777db78133626
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 method should probably never have been in the library, since it
creates a fixed-sized, muted element.
Change-Id: I53b474305465bef34d43ce40ec5e7dedceb20a25
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
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
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 makes some of our integration tests more robust by using
integration test utilities for observing playback status.
b/128923302
Change-Id: Iae5efe55308660bfe1cde9a7f735ee54dbc0b526
Before we would just wait X seconds and hope that playback would reach a
certain point. In some cases this would mean waiting 10 seconds.
In this change, those tests are changed to poll the media element's
current time. To allow context-specific timeouts, we include a timeout
time with each call. This equates to "we expect to see playback pass
time=X within Y real seconds".
Change-Id: I8293c7dd5fdccf2c1d910fb48e037c93a25e3199
There was an access suppression tag in the offline tests, however there
was not accesses to suppress. Removing the tag did not yield any
compiler errors or runtime errors.
Change-Id: I4a6d4a5611791427d752b1fd2157e9aa7ae35ec1
In cases of corruption or version mismatch, we must be able to delete
the database without loading anything from it. This comes up in
testing when you run an older version of Shaka Player after a newer
one has created the database.
Our ability to erase the database in these cases was lost when we
fixed#1277. This reverts that change and changes the contract of the
storage classes to ensure that we will always be able to erase the
database, no matter what.
Change-Id: Iccfbe1fa2ca880877e4743e5ca6bd42cba44abe0
Before, when clearing storage with Storage.deleteAll, offline
licenses were not released. Now before erasing storage, all
sessions ids are collected and requested to be removed.
Closes#1277
Change-Id: Ib88a14f5132d3b2a34bd339cc45f121792b65ebc
This CL replaces the old storage system with the storage muxer system.
In addition to replacing the old system, this CL removes all the
code that was only used by the old system.
As of this change Storage Muxer support shaka player's V1, V2, and V2
indexeddb schemes and exposes a plug-in system for other offline storage
components.
Issue #1248
Change-Id: I1a4914477ad8db29fd0e7ad7de2f149b6497f67e
Adding "mechanism" and "cell" fields to offline uri. But since
they are not used anywhere, this change sets them to dummy values
so that all the constructors could be updated.
Moved the manifest reconstruction code into a instance class as
the mechanism and cell for the asset is needed in order to create
all the segment uris.
Change-Id: I2b5738805b17c4aa33d39b3166fddf1528aed489
The offline uri is going to soon contain more information (routing
information used by the storage muxer) so this change makes offline
uri a class so that all components can be accessed.
Change-Id: I5137f278e0dab059191d450876cab42745e4ed0b
This is an automated fix to be inline with Google style guides, this
was created with eslint's --fix option.
Change-Id: I860eecbc8152603e730aa17a1393f16d26b3b6fc
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: Ib137fbfde50f1330c74c040fc062aa8e2c6d1e57
This digests and organizes many of the automatic settings in eslint,
and changes several of them to be more strict. This also fixes the
following errors:
- array-callback-return
- no-catch-shadow
- no-multi-spaces
- no-new
- no-throw-literal
- no-useless-call
- no-useless-concat
- no-useless-return
Several checks have been organized into a group of checks we should
use, but need more time to implement and fix. Some other checks have
been delegated to the Closure compiler, which can more precisely
whitelist exceptions.
Issue #1157
Change-Id: I8fe4966959e08050f8159e6a1fee161e7d71177e
Edge does not like it when we delete the old stores in the
database when upgrading. Since this can't seem to be worked
around, instead of delete the store, just clear it.
This will leave two empty stores in the database, but since
they will be empty, they should not waste any space.
Change-Id: I11d5b8b105b34277d92e9c1f7f83b36fc6171960
This change:
- Fixes the use of temporary licenses with manifests without init data
- Re-enables an integration test which was accidentally disabled
- Makes that test use a manifest without init data, to cover #1159
- Makes the test less flaky
- Reduces the minBufferTime of offline manifests, which both speeds
up load of offline content and makes the test faster / less flaky
Closes#1159
Change-Id: I3342e5112564a607f16f5d10c457a032443c57cb
Changed the storage remove API to use the offline uri instead of
the stored content as that is all that is needed to remove the
content.
Updated the demo app to remove using the Uri and not stored content.
Change-Id: I72a1049838759452eb16c78c8f1f7f4170e4e841
Before, stored content always needed an offline uri. As the id
will soon not be available before saving to storage, stored
content needed a way to represent content that was being
downloaded.
This change allows the offline uri to be null to represent content
that is being downloaded. It also allowed stored content to be
created from a Manifest (for content to be downloaded) and to be
created from a ManfiestDB (for content already downloaded).
Change-Id: I3039069995f0b061112ed0c636a53ceef5673389
An improved workaround for https://crbug.com/690583 and #1093, on top
of PR #1168.
If we don't wait at all, we end up trying to use the same session ID
too quickly, which causes a playback failure.
Change-Id: I8c9d1a0f09432054b862e033b80b0c2f47739c74
The offline integration tests were writing to one DB Engine instance
but reading from another. This meant that it could never find what it
wrote.
Change-Id: I1d641e18401e27d906d437c70d7691f9ab448ff3
Changed the Storage Engine interface to know about the types that it
is expected to store. This allow the implementation to do more internally
as the scope of the object has been limited.
Change-Id: I388e2bde5e7e3f99e8b28bd16e08a8f6d5fc6453
To make it easier (and more consistent) to mock the default storage
engine in our tests, this change introduces StorageEngineFactory and
MockStorageEngineFactory.
StorageEngineFactory is now used to create instances of IStorageEngine
in the library. MockStorageEngineFactory makes it easy to override
specific parts of StorageEngineFactory.
Change-Id: Icd28b7f4913add1318a24f436e54b3c694312d2c
Moved all the logic that is used to construct and parse uris for
manifests and segments into the offline scheme file.
Change-Id: Ie4dbd12256667296e3c67ed0ecf47f1752dd86eb
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: Ic37437a1ad2305bc50a814cdcc562e74703222ac
This changes the order of the things tested in the offline tests,
cleans them up a little, adds comments, and extends the playback
time by 5 additional seconds to deflake the tests.
Closes#903
Change-Id: I9c0656882cf31e3f61c67946b7867d3ef25ba953
The new isPersistentLicense option was not documented in #878.
This adds docs and renames it to usePersistentLicense.
Closes#873
Change-Id: I59ed32c98660ad7c155392a1708eab98f63131c3
Based on app configuration, we could store protected content offline
without a persistent license. The offline content would then require
a network connection, but only briefly for licensing. This makes
sense in a lot of commuter or airplane WiFi scenarios.
Closes#873
This adds a severity field to Error objects. This can be used to
detect whether an error is recoverable. All the same errors are still
reported so the field can be ignored.
There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
load() again
Closes#564
Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
This adds a method on Player to get the license expiration times for
the current EME sessions. This also adds the expiration times to the
stored content structure for offline content. This will update the
stored expiration while playing content (e.g. license duration changes
when playback starts).
Closes#727
Change-Id: I18770a79413423695bbb2ed5f31f6b19038a33d2
These tests will no longer be lumped into the same group as "external"
asset tests. This will allow us more control over test coverage in
different scenarios in our lab.
Change-Id: I0b0f2ae5ed6e74fdf87ad4ecf94ce41d94763537
This implements the workaround for a race in IndexedDB on IE/Edge.
If we don't get an 'upgradeneeded' event when we expect it, we will
close the connection and retry.
b/35993864
Change-Id: I78d1c18e4798c098167a1a6a184623780002a34f
StreamingEngine continues to buffer until the amount buffered is
greater than or equal to the goal. Playhead's watchdog checked that
the amount buffered was strictly greater than the goal, leading to a
race in which we could get stuck buffering forever.
The race was between buffering and the first watchdog timer callback.
If data gets buffered before the first callback fires, the watchdog
will see that bufferedAhead is greater than threshold, and it will
not enter a buffering state.
If the callback fires before anything is buffered, it sees
bufferedAhead == 0 and enters a buffering state. If the config is
such that bufferingGoal and rebufferingGoal are the same, then
Playhead is stuck in buffering. StreamingEngine won't buffer more
until something plays, and Playhead won't leave the buffering state
until something more is buffered.
This turned out to be the root cause of failures in one of our
quarantined tests. While debugging this test, I noticed that
video.playbackRate was 0, which we set while buffering. This led me
to investigate buffering logic in Playhead, where I noticed that
bufferedAhead was exactly rebufferingGoal in the instances where the
test failed.
In 100 test runs, the test failed 9 times. No other tests had to be
run to trigger the failure, so this one test was run in a for loop.
Once I understood the cause of the race, I found that I could trigger
the failure in 100 out of 100 tests by changing startWatchdogTimer_()
to onWatchdogTimer_() in the Playhead constructor. This ensures that
the timer callback fires synchronously, before anything can be
buffered.
With the underlying bug fixed, the test has now been removed from
quarantine.
Change-Id: Ief5c11b2211045a32dc0a9f711b17a4ec1bf55af
This hides 6 tests behind the --quarantined flag. Without this flag,
these tests will be skipped. This allows us to get consistent results
from the build bot while we work to fix these tests.
Change-Id: I6cf3921228da1831f71a89cd5802ea48c66752bd
Tests that use a remote license server should be behind the --external
flag. This introduces a new shim that makes it easy to mark tests as
external. This also lays the groundwork to hide tests behind other
flags.
Change-Id: I035de24e02035e732c515522378247c692e74b7c
All tests now have the same timeout value. This should simplify the
process of addressing timeouts on Safari.
Change-Id: I3b455bd639758007ec8b2b86ef236c56e919c15a