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
Adding the count of channels, as a new field for tracks and streams.
Used for HLS audio tracks.
Resolves#826.
Change-Id: I1448b4a8cfaf6dd798670bb2f0f3981d6c7e40c3
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
This change is to expose an audio track's role in order to differentiate
among a main / caption / commentary track that shares the same
language.
Issue #767.
Change-Id: I05d38cba2170d0005611cf160b7ae45996fe77dd
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
On android the quota for offline content is much smaller than on
desktop. It was observed that when this quote was exceeded that
downloading offline content would stall but not throw and error.
It was found that instead of an error, IndexDB called onabort for
the transaction.
To fix this we now route onabort through the same code path as
onerror so that the abort will be treated and communicated as an
error back to the application.
Closes#747
Change-Id: I10d536a4edc29d51790f0588f6163a5d83eccf33
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
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
On IE/Edge, it is possible for the IndexedDB database to not be deleted
when the success callback is fired. If we immediately create a new
connection to that database, it will connect to the old database. Once
the database is deleted, the connection will no longer have the data.
This adds some assertions that we get an upgrade event. This also adds
the framework for the workaround, but doesn't add it so we can give
this revision in the bug report. This deliberately increases the
failure rates on IE/Edge.
b/35993864
Change-Id: I3d142bdee6386fbe63f1b2def462a0e039723a38
By default, we will now store all text tracks, regardless preferences.
This not only helps with our demo, but makes sense for applications
that have not bothered to configure the track callback for offline
storage.
This also fixes bugs in the default track selection algorithm,
changes the default audio track selection to fall back on primary
variants in cases where the audio language preference cannot be met,
and adds tests for the default selection algorithm to verify correct
behavior.
Change-Id: Iead0499039e9ec596514aa7577265a7472914621
Rather than having it in the DashParser as a network response filter,
we should have it in StreamingEngine. This will give it access to the
segment times so we can calculate the presentation times for the event.
Otherwise, there is no way to know when the event should actually occur
since the app can't know which segment is being downloaded or which it
came from.
This also adds startTime and endTime fields to the event so the app
doesn't have to calculate them. For reverse compatibility, the old
fields will still exist.
Closes#698
Change-Id: Icbaf3619aedfca7ea06bc8b1fe49e9cce65b0cc2
There was a bug where Storage would always store every track,
independent of what was chosen. This fixes it and adds a test so this
doesn't happen again.
This also updates the ManifestParser API usage Storage. It was
updated in 2ca962a3 and Storage was not updated.
Change-Id: Id3b8ee143cec6c4d099a9628c90dc3c927ea8625
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
We were not able to get our externs generated by the Closure compiler.
There were many issues with the Closure-generated externs, including
the order of the externs and the replacement of record types and enums
with their underlying types.
We made a few attempts to patch the compiler, but could not get our
patches accepted upstream.
This change introduces a new script to generate our externs from
scratch. It uses a JavaScript parser called 'esprima'.
Some interfaces need to be exported to the generated externs, but are
not actually attached to the namespace by the compiler. For this, we
introduce a new annotation. These are the currently-supported export
annotations:
- @export: truly exported (attached to namespace) by the compiler
- @expose: truly exposed (not renamed) by the compiler
- @exportDoc: considered part of the exports in the docs
- @exportInterface: considered part of the exports in generated externs
These annotations are now documented in docs/design/export.md
Change-Id: I33bf7384889c14c9edb0fa5f11caa7c4f4d79af6
Rather than accepting multiple callback methods as separate arguments,
now start() will accept an object. This will allow us to add new
callbacks without breaking backwards compatibility or adding
additional arguments.
Change-Id: I839cbb12e71c2e7270aa218802c79440c458e964
Add UI options to select current audio and text language.
Split selectTrack() into selectText() and selectVariant().
Stop automatically disabling ABR manager when a variant is selected.
Add a warning if selectVariant() is called while abr is enabled.
Issue #412.
Issue #626.
Change-Id: I15f1c3c4fdc6d6b641f708fbef19dbcf10cbcfc6
Parses DASH trick mode tracks and puts the extra trick mode Stream
into the manifest. StreamingEngine can now use this info to optimize
streaming during trick play mode.
Includes:
- a new demo asset with a trick mode track
- updates to tests (we now require at least one audio or video stream
and we require bandwidth attributes on them)
- updates to the parser's trickmode test
- a new StreamingEngine test
Closes#538
Change-Id: Id38264ca64bc7905a5c33a269269741cfd12dd4d
This bans the use of Array and String methods introduced in ES6.
These are not implemented in IE11, so their use is not allowed.
This also replaces our recently-introduced use of these methods to
fix test failures on IE11.
Change-Id: I3175a2e60b708d490997387a41d42ca4662e5fa8
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
Behavior for IPR streams:
* offline storage disallowed
* segment references will not be stretched to the period
* seek range starts at 0
* seek range end is calculated like the live edge
* seek bar is from 0 to duration, not the seek range
Closes#477
Change-Id: Ia36874bb7208c2473c79cb817395ce03925b8c95
Chrome App Content Security Policy prohibits use of new Fuction()
method. Revert the change that introduced it.
Closes#487
Change-Id: Id38522318affb9c5be8f6d2f4446e2967b43f58b
If a key status is 'output-restricted', treat the key as unusable.
In many cases it is, and we have no way of differentiating when it is
or is not. So our treatment of this status should be conservative,
and we should treat the key as unusable. This will prevent
HDCP-related failures that may be caused by adapting to a stream whose
output restrictions may not be met. The hasOutputRestrictions flag on
streams and tracks is now gone.
The caveat to this change is that if content is encoded with the same
key for SD and HD, and HD streams have HDCP restrictions that cannot
be met, we will now consider both the SD and HD streams to be
unplayable, even though we could still play the SD streams. Because
we can't separate the status of the two streams, we don't know for
sure if the SD streams can be played.
We will no longer support such content due to the complexity of doing
so, and due to the risk of playback failures on adaptation to
restricted streams. Streams with different security requirements
should always be encrypted with different keys. Content which does
not follow this best practice will no longer be playable in Shaka
without modifying the player.
Change-Id: Ia29db8efa0b6f83c0376199dea5210c9b468bc40
When storing multiple tracks with the same type/kind/language, issue
a warning, since adaptation does not make much sense when playing
stored content.
Change-Id: I75d1625b2de680ae06728862d27b50272b951b7f
Original Chromecast devices can output a max of 1080p, and may have
issues digesting higher resolution content. Since higher resolution
content would be downscaled for display anyway, limit Chromecast to
1080p to avoid both decoder issues and wasted bandwidth.
Some Cast devices may support UHD content, but the max res for
Chromecast is currently hard-coded until we have a way to detect a
device's capabilities at runtime.
Issue #261
Change-Id: I3dd093b07f9a964116f81422f3c298dfbf7e2e52
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
Now the demo assets can only be stored once, if an asset is stored
the store button will disable. Combined the store and delete buttons
into one. Added a text box to set the name of the asset when
storing custom assets. Also add export to Storage.destroy so it
works in the compiled version.
b/29777213
Change-Id: I7972a7931166c67efcffe70f5017a920cca617ef
* Remove warnings for incorrect argument counts in configure.
* Duration incorrect for multi-Period.
* Multi-Period does not always work with multi-codec.
* Progress meter visible from start and after done.
* Offline buttons enable while storing if asset is switched.
b/29777213
Change-Id: I934bec0e6b5be2d69a908629b187459a6289f7a7
Instead of filling the URI templates when parsing the manifest,
wait until the request is made to fill it. This reduces the time
it takes to parse the manifest.
This was tested using a stream with a 24-hour timeShiftBufferDepth.
Using a Chromebook pixel running Chrome 51. The average manifest
parse time was about 1 second before, now it is about 200ms.
Issue #405
Change-Id: I89f36085441f6c6b7d6281b24b671dc668f23fe5
Before, we did not use suggestedPresentationDelay in the seek range.
This meant that seeking to the live edge would usually lead to a
buffering state because the seek range is the same as the availability
window. Now the seek range is handled differently from the
availability window.
b/28938315
Change-Id: Iacfffe30778f7c63734fe24eeb95634611da86be