Commit Graph

26 Commits

Author SHA1 Message Date
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07: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
Chris Fillmore d846e58af6 Add originalUri as a property on shaka.extern.Response (#1972)
This property tracks the original request uri, which would be
useful to know in the event of a redirect.

Fixes #1971
2019-06-01 13:30:41 -07:00
Joey Parrish 393b0ecea7 Fix HTTP test failures
This makes progress callbacks into a required parameter on all network
scheme plugins.  This does not mean that every plugin must make use of
the callback, but every caller must supply the callback.

In production, NetworkingEngine already supplies this callback
universally, so our HTTP plugins make use of it whenever progress data
is available.

Our tests, however, did not always supply this callback, leading to
test failures.  These failures were more likely to show up in Jasmine
3 than Jasmine 2 for some reason, which caused us to downgrade back to
Jasmine 2 recently.

By making the callback required, we can clean up this inconsistency
between test and production and give the HTTP plugins what they expect
in all cases.

Issue #1949

Change-Id: I8a6e1904e73cf7ca6ae8f3964261c339f404854d
2019-05-22 15:42:06 +00:00
Jacob Trimble 4c2469ce5e Convert offline files to ES6.
Issue #1157

Change-Id: I74e8db322bfcff7d502307d12108e9b4157a11e1
2019-05-21 16:03:53 +00:00
Jacob Trimble c81389741f Prefer const over let.
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
2019-05-08 09:22:10 -07:00
Aaron Vaage 27134f2d34 Make Offline Get Segment Abortable
There was a TODO in OfflineScheme to make |getSegment| abortable. This
updates the method to use abortable operation, allowing it to be
aborted.

Change-Id: Iaa8a29c0c71ac5ed5044f448bf89057b70e89548
2019-03-08 01:26:44 +00:00
Aaron Vaage 546942fc3a Created Destroyer Class To Handler IDestroyable
Created the Destroyer class to handle working with IDestroyable so that
IDestroyable can be a simple interface (no more static methods).

Change-Id: I5afd915b895a4c60d758475a2b879bf0eb0096c9
2018-07-09 22:19:19 +00:00
Joey Parrish fd0449d8f7 Re-enable some disabled style rules
This re-enables the following style rules:
  - "block-spacing"
  - "brace-style"
  - "comma-dangle"
  - "comma-spacing"
  - "new-cap"
  - "no-multi-spaces"
  - "no-multiple-empty-lines"
  - "one-var"
  - "padded-blocks"
  - "prefer-rest-params"

Change-Id: I15d616e8d5b88b273ded6128b4f9ad86bdb26bd1
2018-07-09 19:44:56 +00:00
Aaron Vaage 8040f78883 Integrate StorageMuxer and Player
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
2018-05-09 18:41:21 +00:00
Sandra Lokshina 8065bd54a8 Change namespace from shakaExterns to shaka.externs
Change-Id: I16432351e2a266aa8fd175669aa27c44bfdffeae
2018-04-11 17:26:26 +00:00
Aaron Vaage 6ae49efc96 Move Offline Uri Functions in Class
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
2018-03-26 19:17:35 +00:00
Theodore Abshire f58afd21da Typo fixes and rewording in comments, part 5
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.

This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.

Change-Id: Ibcaf21382bd78b91e589122983dd14e001bfdad5
2018-03-21 17:25:13 +00:00
Jacob Trimble 4004bd42fd Convert 'var' to 'let'/'const' (7 of 9).
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
2018-02-15 21:16:33 +00:00
Chris Fillmore 4ac1a40578 Provide RequestType in error data from HttpPlugin. (#1254)
Closes #1253
2018-02-12 10:01:58 -08:00
Joey Parrish 2f55d2a3bd Use AbortableOperation in networking
This uses AbortableOperation in all networking, from the scheme
plugins all the way to the request interface.

This also updates all default scheme plugins, docs, and sample code.

Backward compatibility is provided for scheme plugins and the
request API in NetworkingEngine.  This compatibility will be
removed in v2.5.

Two cancelation-related tests have been disabled in
player_integration until the new abort interface has been adopted
in the manifest parsers.

Issue #829

Change-Id: I91c8e6efe97798d111e8ddca5655cddc1f6bcbf3
2018-01-29 19:23:47 +00:00
Aaron Vaage 46685fbd15 Moving Offline Uri
Moving offline uri code to avoid an upcoming circular dependency in
the upgrade code.

Change-Id: I952386f17c6d4e7806d97e2f540887b915f68de7
2017-12-14 00:00:23 +00:00
Aaron Vaage b98ce99f08 Add Type Structure to Storage Engine
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
2017-12-04 22:41:23 +00:00
Aaron Vaage b68623180c Simplified Offline Schema
Before, segments required knowledge of the manifest and stream to
be created but that information was never used. This change removes
that information from the segments and breaks the circular dependency
between manifests, periods, and segments.

Change-Id: I94064220dd8e3693ff69f5c9100ec1b91aa3c34d
2017-11-27 21:17:07 +00:00
Aaron Vaage ee006d4523 Consolidate Mocking IStorageEngine In Tests
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
2017-11-08 16:28:16 -08:00
Aaron Vaage 07e81f7bc9 Move all uri parsing and creation to Scheme
Moved all the logic that is used to construct and parse uris for
manifests and segments into the offline scheme file.

Change-Id: Ie4dbd12256667296e3c67ed0ecf47f1752dd86eb
2017-10-27 20:08:28 +00:00
Jacob Trimble 575f2ad109 Add an indicator for critical errors.
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
2017-04-04 23:57:59 +00:00
Aaron Vaage 3db0f3357a Creating IStorageEngine Interface
To better support alternate storage mechanisms, this change abstracts
shaka.offline.DBEngine into an interface called
shaka.offline.IStorageEngine.

DBEngine has been changed to implement this interface, and allows the
addition of implementations that do not use IndexedDB.

Change-Id: I6a94067001ee53049df11cb68604bb57912300bb
2017-02-10 21:27:32 +00:00
Joey Parrish 18da8e04dc Export all plugins
This exports all plugins from the library, to make delegating and
subclassing easier for applications.

This also fixes a couple of issues with the generated documentation.

Closes #551

Change-Id: I23798f6117e1944d7ffc67bcb50ae36f3943710a
2016-11-14 23:58:09 +00:00
Jacob Trimble beb902e826 Move common code in offline to offline_utils.
Added new offline_utils.js to hold utility methods for offline
support.  This also removes a circular dependency between
Storage and DownloadManager.

Closes #431

Change-Id: I98842c63c7ba57d4d02d7fe6bace57227982317c
2016-06-30 19:49:51 +00:00
Jacob Trimble 387ed49e92 Add offline storage manager and manifest parser.
This contains two major parts: the Storage class, which manages
storing, listing, and deleting the stored content, and the offline
manifest parser, which loads the stored content into a manifest so the
Player can play it.

This does not include support for storing encrypted content.  The
EME sessions will not be stored properly and will fail to play.

Issue #343

Change-Id: I7ecb3400391ec8100155aa972f9b09bb7ae24d9d
2016-06-09 23:10:46 +00:00