Tracking progress when removing an asset was missing from the new storage
system. This CL adds that support back.
Issue #1248
Change-Id: Iab275cd75af817cfc34ee0888ddeea257b1ead56
During a recent refactor, startTime || null got introduced.
This would not only use null as a default, but would also convert 0
into null, which changes the meaning of 0 from "exactly timestamp 0"
to "default start position" (which is non-zero for live streams).
This fix adds a regression test that fails without the fix.
Change-Id: I01e1628df9d141697fdb7d9fb5e77a16ac3dab5b
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
Only create Text media state when the subtitle is visible.
As a follow up for commit Icaa1477d35633fc3afabcf7baf38acde0cd775ef.
Closes#1412.
Change-Id: I4810c4790fd904f4e45dfd1481dab19c7c887920
For non-external subtitles we wait to create media state until
the captions are actually enabled. This change adds logic to treat
external text the same way.
Closes#1412
Change-Id: Icaa1477d35633fc3afabcf7baf38acde0cd775ef
While working with integrating storage muxer into the codebase, there
were some painful points in the API. This change addresses those
painful points.
1. Getting cells - many times we know that the cell should be under
a specific path. So resolving the path and
checking for null got annoying. This adds
a call that assume it should find the cell.
2. Get active cell - when getting the active cell, we often need
the cell and the path to the cell. So this
creates a "Handle" which pairs the cell and
path together.
3. Adjusting registry - when testing we need to change what storage
cells are actually available. Instead of
unregistering and registering cells, this
adds methods to add and remove a temporary
override.
Issue #1248
Change-Id: Ifd45ee5912f53b1da444476b560cf03669a19b11
If the value passed to |player.configure| has errors in it, the method
will now return false. This allows the app to programmatically detect
errors in the config object.
Change-Id: I7236f565320e8fd39afcb3224b7901c601d211ba
Previously, we would choose codecs based on bandwidth alone. This
would lead to 2-channel audio being preferred over 6-channel audio
when the two used different codecs. (Content with different channel
counts using the same codec are not affected.)
Now, we consider the channel preference before choosing a codec. This
fixes app selection of 6-channel codecs over 2-channel codecs when
they differ.
Closes#1013
Change-Id: Iee6058b2df04b8b8036f59909fd82df26b1173ae
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
Need to close database connections when destroying the
indexeddb storage mechanism or else it will get in the
way of deleting the database.
Issue #1248
Change-Id: I56466851e8172282c60c3128e5b4113001a10970
Create the indexeddb storage mechanism which will allow us to
connect to indexeddb storage cells. As we don't have a V1 Cell
yet, this only connects V2 and V3 cells. However the code does
assume that V1 will be added and only omits connecting the cell
when it sees the V1 object stores indexeddb.
Issue #1248
Change-Id: I7395b8a334cd68795aab02ff656a5b49d1f5742b
This upgrades to the latest compiler release and drops the linter.
Since we adopted it, the closure linter has produced far more problems
than it has caught. It takes no command-line arguments and can't be
configured. Eslint takes care of traditional linting tasks, and it is
unclear what we would stand to gain by conforming to the demands of
newer versions of the closure linter.
This also fixes a few issues caught by the new compiler:
- Type adjustments for the evolving Fetch externs
- Drops our custom extern for AbortController, which the compiler
now has built-in
- Adds a type annotation to player.js to fix a type inference
failure in the new version of the compiler
- Drops more non-nullable annotations on functions, which are
implicitly non-nullable
Change-Id: Ia03936a5426277d970612c0eacef40fbaf6ee35d
1. The channel preference was not correctly used for the initial
content selection if the config was changed between construction
and load().
2. The AbrManager's options were not updated if the user manually
chose a track with a different number of channels. When Abr was
re-enabled, the channel count reverted to its configured setting.
3. If tracks changed due to a key status change, the current channel
count and config were ignored, and AbrManager got to choose from
all tracks again.
Tests were added/updated for all three issues.
Closes#1013
Change-Id: Iec49361aa6e8c7193a572ad7914dfd853454791d
If a single manifest update takes a long time, it should not hinder
future ones; but if there are repeated slow updates, we should delay
updates. This uses an EWMA to keep a rolling average of update times.
Closes#1399
Issue #1408
Change-Id: I6a662ce51ba9c3e1e4a87b2418e35fc3948043c1
Limit the scope of storage and download manager to |store|. This
will make it easier to swap it with storage muxer.
Issue #1248
Change-Id: I3ec5de4457cbb534eb0c9b44d518602a1295d709
Added a method to get a cell from storage muxer. Unlike resolve path
this will return a rejected promise if the cell can not be found.
Issue #1248
Change-Id: Ia594b7741351d515e564e574321e49ad51073005
Added a toString method to StorageCellPath so that it will be
easier to read when added to a string.
Issue #1248
Change-Id: Iad7c2e633b6327bd39475d29d23426217f042ee3
Changed |findAll| to |forEachCell| as it provides better usability in the
codebase where we would have used |findAll|.
Issue #1248
Change-Id: I6ca993ffb85aa0bf15d6ac250ac85a00e966fcbe
Make storage muxer implement the IDestroyable interface so that
it can be used with |shaka.util.IDestroyable.with|.
Issue #1248
Change-Id: I6e8c71b57e939ea30d5c24c75ede9c2de80026db
It appears that closure did not notice that a return type
was not consistent. This corrects the return type to match
what the download method in download manager actually
returns.
Issue #1248
Change-Id: I796e31d9e7ad1d812bd53a55f5f1c745ac0b187c
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
Move the use of storage engine out of download manager and back into
storage. Storage creates and manages the life of storage engine, so
it is easier for it to handle all storage functions.
Now, the callback that is given to download manager is used to pass
the downloaded array buffer back to storage so that it can be saved
into storage engine.
This moves all uses of storage engine into storage which will make it
easier to replace with Storage Muxer.
Issue #1248
Change-Id: I555788478af09d1d79c3db7534431e1d9daf4e20
This makes it easy to dump and restore databases from IndexedDB. This,
in turn, makes it easy for us to test that all database versions can
be read. Before we close the backward compatibility issue that has
plagued v2.3, we will add tests that use this utility to load DB
snapshots from various older schemas and prove that they can still be
read.
This also adds dumps of all database versions to the assets folder,
including a snapshot of a what our broken upgrade in v2.3.0 did to the
v2 database schema.
Issue #1248
Change-Id: If7e8995f50abbdee67e3fa93e79f07a49582c5e8
Because we changed how we collect the streams before downloading we
no longer used the variant id parameter. This change removes the
parameter.
Issue: #1248
Change-Id: Iab4323c7b358ed83812b2ff36e9632022e65f88a
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
Group downloads by stream id so that download manager does not
need to know about the stream types.
Issue: #1248
Change-Id: Id61df4e67a419ee085dfd96a863bb56f01a4b732
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
This exports shaka.util.AbortableOperation, which plugin writers will
realistically need to update their scheme plugins.
Change-Id: Idfc149f06d22699a78c4d989d331619d5e74f097
Changed the loops used to check for similar tracks to be simpler. Yes,
there are some double checks, but over all it is easier to read. Since
this code is ran very rarely, the minor redundant checks should not be
a problem to the user.
Issue #1248
Change-Id: I6589dda233e94defb5729934ee859b78e3af193f
Created a static method that will handle destroying a destroyable
object when you are done with it.
Issue #1248
Change-Id: I4df0569f5f5e00002600702cf24caf1ed2da7c5b
Every time we would get network engine in storage we would need
to assert that it was not null. To make this easier (especially)
with promises, we add a function that will only return an non-null
networking engine.
Issue #1248
Change-Id: Iba415426ea42007addbb26c7a6b99a54a5064440
ABR should not select key-system restricted tracks since we can't play
them. Rather than updating AbrManager to do it, the Player should
just filter out the restricted tracks so a custom AbrManager doesn't
need to worry about it.
Change-Id: I5fa5cdcd9a035136fdccf9bee1a54752a0cacf1f
Normally, we expect that only media playlists contain segment tags
(EXT-X-KEY, EXTINF, etc). We determine if a playlist is a media
playlist by the presence of an appropriate playlist tag (EXT-X-MAP,
EXT-X-PLAYLIST-TYPE, etc).
However, we were checking tags one-by-one, on a single while loop.
This meant that we would reject manifests where a segment tag appears
before a playlist tag, as we did not yet know that the playlist was a
media playlist.
This changes the manifest text parser so that it checks for playlist
type first.
Issue #1382
Change-Id: I1b9f674a58c60ab291d6d004462b0c0cae49631d
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