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
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
Adding support for CEA closed captions embedded in video streams for
Dash.
1. Dash parser reads and parses closed captions' channel and language
information.
2. Player creates text streams for the closed captions.
3. Media Source Engine calls mux.js Caption Parser API to get the closed
captions embedded in the video streams.
4. Text Engine stores the closed captions, and text displayer shows the
captions.
TODO:
1. Add test cases, will send out another CL.
2. Change closed captions support for hls to the similar way we handle
dash closed captions, will send out another CL.
3. Handle dash content that's missing language indication from the manifest.
Issue: #1404
Change-Id: Ibae8f69623c13561415ec860107d7f5bc86e19e9
If we fail to remove an offline session, don't fail to delete the
content. Instead, store the session ID so we can remove it at a later
time.
Closes#1326
Change-Id: Id76481ece96bd6541367ccc67d13916a2aa51be2
Went through all the class in shaka/offline and removed all uses
of |MapUtils.values|. This required changing many uses of Object
to Map.
Change-Id: I6bd6d37009e7b32ea38e9cbabd64c2d36ffeabbc
This replaces almost every instance of indexOf on both String and
Array. There are very few places where we really wanted an index.
Mostly, indexOf was used to check for inclusion.
Change-Id: I08e299768b6ffdb4bfc30b39b5d82a058c6d1b56
In the Storage unit tests, it should always delete the old data to
ensure it doesn't contaminate other tests. This also removes the
checks in the beforeEach/afterEach blocks since calling pending()
in those doesn't have the desired effect.
Change-Id: Id345882a7ac1ae0ab99d2785851b7553b49a9d3f
Changed the ClosedCaptions field in Stream from an object to an
array of ClosedCaption objects, so that it can be iterated through
and accessed easier.
Issue: #1404.
Change-Id: I67980cf4d5b5746785ba29f95718970fe89056f4
There was an ugly promise chain in Storage.loadInternal. This change looks
to clean up that promise chain and to use async syntax instead.
Part of the refactoring splits |loadInternal| into two more focused methods
as an effort to make the code easier to understand.
Change-Id: Ica113344c6c4ba1d82b6cee281268e20be1aa411
Before, we would need to pass a manifest to DrmEngine to initialize
it. This was a problem as we look to support playback via src=.
When looking at how DrmEngine used the manifest, it appears to just be
a simple way to pass in the variants and the offline session ids. By
changing DrmEngine to accept the variants and offline sessions ids, we
can break the association between DrmEngine and Manifest.
Issue #816
Change-Id: Ie0dc82aaec871d7e6e002fe59b3a984449eda8c7
There are two intents when we initialize Drm Engine and the meaning
of the parameters are nuances depending on what you are trying
to do.
This change creates two different initializing methods so that
initializing drm engine for the intended purpose can be more
clear.
With this, some internal naming was change to better reflect how
some variables were being used to give them a bit more context.
Change-Id: Id8925eca53a34fe870ba5c973f9f0bb584f6e2d6
This change allows storage to be initialized without a player instance.
Since Storage is the same post initialization, the only test being added
is a test that checks that the storage instance was successfully
initialized.
Close#1297
Change-Id: Id2588696eac2a866bba74278322727b1d91f56eb
Our storage progress tests on Edge were sometimes failing as the promise
resolution order would change. This happened because we queue streams to be
downloaded in parallel.
This changes FakeNetworkingEngine to allow us to register an async function
as a callback for a request. This allowed us to update the test to resolve
network requests in lock step ensuring a deterministic order.
Since the progress test rely on a lot of assumptions, the tests were moved
into their own top-level group and now have their own test manifests.
Change-Id: Id366efccd15d90814ee34ca9a17df7d733ab6d67
The DASH parser will now expose Representation IDs via new fields in
the Stream and Track objects. The "id" field will continue to be a
unique, auto-generated numerical ID, and will be supplemented by a
nullable string containing whatever was originally in the manifest.
The HLS parser will now expose the NAME attribute in the originalId
field as well.
Bug: 112087288
Change-Id: I6b8107d27780fb97ab18de767f7abdc6c7110fe7
As part of the effort to allow storage to be initialized with or
without a player instance, this change moves the offline config
into the player config and changes storage to share a configuration
object with a player instance.
We opted to share the instance between the two classes because if
storage was initialized with player, the initializer is implying a
relationship between the two objects and therefore configuration
changes should be shared.
Issue #1297
Change-Id: I991365255e63c284fbfcf147cf63c9588dd764ab
Created the Destroyer class to handle working with IDestroyable so that
IDestroyable can be a simple interface (no more static methods).
Change-Id: I5afd915b895a4c60d758475a2b879bf0eb0096c9
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
Removed all references to "manifest 1" and the like in the storage
unit tests. Before we had values called "manifest 1", "manifest 2", etc.
but they were replaced with more meaningful names. However, some comments
did not get updated and some tests did not need to know what kind of
manifest they were.
This change updates the references to either use the correct name, just
say manifest, or generalize the reference of the manifest.
Change-Id: Id95ac1e3d52f7e1dab883c17b8b082b3f8b79c7a
Added a new test to verify that the progress callback is called when content
is removed from storage.
Issue #1248
Change-Id: I60f1f1ab744d79214685c0060e56f4e21514948c
Tracking progress when removing an asset was missing from the new storage
system. This CL adds that support back.
Issue #1248
Change-Id: Iab275cd75af817cfc34ee0888ddeea257b1ead56
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
In the initial fix for #1013, we changed the name of the channelsCount
field in both the Track and Stream structures. This would break
compatibility for applications. So even though the new name was in
some ways preferable, we must revert the name to avoid more breaking
changes in v2.4.
Issue #1013
Change-Id: Ie8f3d211c42c8046039a3db9f0926c68ad1315d9
Using variant bandwidth to estimate download progress. We use a constant
bandwidth estimate for audio, as most of a variant's bandwidth will be used
by video.
Since we normally don't have bandwidth for text, we use a constant bandwidth
estimate for text so that it can influence progress.
Even through we some times have the actual audio and video bandwidth (DASH)
we choose to use always used the combined amount so that we can have
consistent behaviour between manifest types.
Issue #1248
Change-Id: Ibffe95e2c8d141659855b54949a50ae84c51dded
Changed download manager to take |shakaExtern.Request| as input
instead of |shaka.media.SegmentReference| and |shaka.media.InitSegmentReference|
as it really does not need to know about those types.
Issue #1248
Change-Id: I797c437f4339cf670b5eddad14952b0526b72ea5
Added a preferred audio channel count to configuration, default set
to 2.
Choose the codec with the largest number of audio channels less than
or equal to the configured number of output channels. If this is not
possible, choose the smallest number of channels.
Closes#1013.
Issue #1071.
Change-Id: I6c6a956e33637cf34bd4bd79af563dc10a595e94
To make it easier to understand, we collect all the streams within a
period using a map. This ensures that we will have a set of streams.
We then download each stream in the map. Since the map is indexed by
stream id, we can easily connect the variants and streams.
Issue #1248
Change-Id: I65ae01733b5d9dbf8b6d73c37f802320fffa03d1
Made some changes in how the unit tests were structured so
that it will be easier to identify problems with changes to
storage.
Issue #1248
Change-Id: I8331f18e9c9e360cf8057737ddfd71c7152a744b
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 only time we ever need to update a manifest value is when
we update the expiration time. To make it easier to support
updating expiration time across different version, only allow
that one value to be updated.
Change-Id: I621ec744019802edc65b059baa7f5cf0c476b0b1
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
Made a copy of the storage cell tests for indexeddb but made them
work for the memory storage cell so show that we can expect the
same behavior from them.
This is to give us an extra level of confidence when we use the
memory storage cells in place of the indexeddb storage cells in
our tests.
Issue: #1248
Change-Id: I96eaf57a9d808b4c7e07f97ac2713318a889fc24
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
This is an automated fix to be inline with Google style guides, this
was created with eslint's --fix option.
Change-Id: I860eecbc8152603e730aa17a1393f16d26b3b6fc
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
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: Ib137fbfde50f1330c74c040fc062aa8e2c6d1e57
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
When DBEngine aborts because of an upgrade, include a list of the
original uris for all downloaded content.
This will allow apps to re-download the content if they choose to.
Change-Id: Ic2029d935dd8da60c0d502cd0cdbb08b38bbbe76