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
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
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
Removed the class-wide instances of drm engine and manifest
that were in storage to make it easier to understand where
they come from.
Issue: #1248
Change-Id: Iee0932b36a0a66eefd1995a2318981708e588f35
Isolate the use of storage engine in the remove function so that it should
be easier to replace it with the new storage system.
Change-Id: Ia764b680026018dfcb10f8bebc98e4d7435793d8
To make it easier to update storage.js to use the storage muxers
each command is going to be isolated so that the dependency of
each command can be clearly established.
Change-Id: Iedba4bd0cefa96ca2e69db1fa83d3ba074a3fc29
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 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
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
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 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
Instead of storing uris for SegmentDataDB in SegmentDB, store the
actual key so that we don't need to convert back-and-forth so
often.
Issue #1047
Change-Id: I2f6d1bc1e58abd7a210097dea757d1e2fc9d4cac
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
Removed the reserve id from storage engine. Now adding an item to a
storage engine will return a promise that resolves with the id it
was stored under.
Change-Id: Id4d2c4c51a359593f1308aeb5fe580ab460ebeb8
In |Storage.store| there was download logic hidden by error handling.
This change moves the logic into its own function so that the error
handling does not hide the logic as much.
Change-Id: I3fc911573937f4543837015cf2500a1447d923ef
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
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
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
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
Since getStoredContent created a StoredContent from a ManifestDB
instance, createStoredContent better described the action of the
method.
Change-Id: I9893b956e08761d8bb3c4073626ed840240e2ac8
To prevent us from packing and unpacking audio and video from an object
this changes filterNewPeriod to just take audio and video rather than
a map.
Change-Id: I152f2b1762d4ff9ce21cb5b501579bca315e4e4a
Moved all the logic that is used to construct and parse uris for
manifests and segments into the offline scheme file.
Change-Id: Ie4dbd12256667296e3c67ed0ecf47f1752dd86eb
The offline storage system did not completely implement the interface
used by the manifest parsers. This fixes the interface and makes sure
that existing tests will cover the use of this interface.
Closes#988
Change-Id: Ib8ccae56b144edbfdc9d3fcd865924faf620eb44
Previously "UNPLAYABLE_PERIOD" exception is thrown when a browser
doesn't support the container or codecs in a piece of content, which is
confusing to developers and customers.
Changing it to "CONTENT_NOT_SUPPORTED_BY_BROWSER" exception.
Test manifest:
https://media-ci.foxford.ru/dist/hls-issue/issue.master.m3u8Closes#868.
Change-Id: Ied135b687190919abbeb1561c2bff36a7203136e
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 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: Iefde089b2f62ddfdf43944cda5badab438577561
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
We were giving Storage a Player proxy from CastProxy instead of a
local Player instance. This fixes the mistake and adds a new error
code to make it clear when this mistake is made by other apps.
Change-Id: I4f2d49adc45ef5ca3a942a72192a09f001f5100c
After looking into the speeds for removing data from IndexedDB, it was
found that using a cursor was slower than the other methods. This change
takes the remove logic and changes it to remove each key as part of
one transaction.
Closes#756
Change-Id: Iec3916650d8a4fe2b6353b604c070d8a0af7426c
Now DownloadManager will handle the storing of the media segments.
This will make it easier for forks to handle download/storing segments
using background features (e.g. service workers).
Change-Id: I15bd548e30437094d4948a22752cd37ae6ed3c06
The bulk of the logic for gap jumping is handled in Playhead. It
tracks the current buffered ranges and jumps over any gaps that appear.
It listens for a special browser event ('waiting') for when the video
element runs out of playable frames.
This change also removes the logic for jumping gaps at the beginning
of the timeline. This is handled by the more general gap jumping
logic and works cross-browser.
Finally, this updates the buffering logic to only count the amount of
content buffered (i.e. ignoring the gaps). This fixes some bugs where
gaps in the content can result in StreamingEngine buffering forever
since it thinks only a little is buffered.
This includes full implementation of the logic, but this doesn't close
the issue since there aren't any integration tests yet. Those will
be added next.
Issue #555
Change-Id: Id99eb9fe469e8cf2c7464a3d70c3733791e806e0
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