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
This breaks Player.load into a number of async sub-methods, which are
called using await.
This should improve readability, and make load somewhat less
intimidating.
This also removes cancelable chain, which after the refactor is no
longer used anywhere in the codebase.
Closes#1336
Change-Id: I85ad22b9c8c6b7f72b27471ddd762763e6591a71
- Translate uncaught Promise rejections into test failures
(Chrome only until the event is more widely implemented)
- Clean up uncaught Promise rejection caused by exceptions thrown
after destroy() in:
- CastProxy
- CastReceiver
- NetworkingEngine
- StreamingEngine
- Clean up uncaught Promise rejection caused by test cases in:
- CancelableChain unit tests
- DrmEngine unit tests
- StreamingEngine unit and integration tests
- Player unit and integration tests
- Speed up rejection in NetworkingEngine when we should not retry
- Add --delay-tests to test.py, to aid in debugging uncaught
Promise rejections and other types of async test pollution
Closes#1323
Change-Id: I5a8f5702a22430929babeb071bf6650c52c5ad17
This is an automated fix to be inline with Google style guides, this
was created with eslint's --fix option.
Change-Id: I860eecbc8152603e730aa17a1393f16d26b3b6fc
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: I10f5c38a8b06b5797c6eec7492829084114514c9
Not setting the alias immediately confused the compiler, which lead to
it not type-checking the arguments. This fixes the issues that were
found, namely problems with nullable values and that Document isn't an
Element (although our code works with it anyway).
Change-Id: I9ef95673dc52dae9a811baee74b353132eb0fae3
This does not solve failures on IE11, but does make them clearer and
helps pinpoint the root cause.
Issue #1260
Change-Id: I00a10b38d1eb1f3293c3285a34bde96c631d1c74
This is a regression test for an implementation bug we caught before
it was released. It took a little longer to get the regression test
working, so this was deferred to a later commit.
Issue #829
Change-Id: I272ebe0e6fa2f0ac462c3a3d236250242f7d7192
This adds a general interface for abortable operations, and a specific
implementation of that interface for use internally. This should
simplify the transition to abortable network requests and others.
Issue #829
Change-Id: Icf54e23028f7454640f5ec76ca97d8a8ed5915ed
This digests and organizes many of the automatic settings in eslint,
and changes several of them to be more strict. This also fixes the
following errors:
- array-callback-return
- no-catch-shadow
- no-multi-spaces
- no-new
- no-throw-literal
- no-useless-call
- no-useless-concat
- no-useless-return
Several checks have been organized into a group of checks we should
use, but need more time to implement and fix. Some other checks have
been delegated to the Closure compiler, which can more precisely
whitelist exceptions.
Issue #1157
Change-Id: I8fe4966959e08050f8159e6a1fee161e7d71177e
Beforehand, if there were some text streams with a given language
which had a role, and some which did not, the no-role text streams
would never be chosen.
Now, they are chosen if there is no preferred role.
Closes#1212
Change-Id: I28b426304b1a828f500012425b8d89c94ccc3178
Before, filterStreamsByLanguageAndRole would take a period, this changes
it to take an array of stream to better match the function name.
Change-Id: I4621f98ff17d8d1c3c95162217eef9b8cf7aaebc
Before, filterVariantsByLanguageAndRole would take a period, this changes
it to take an array of variants to better reflect the function name.
Change-Id: Ic090baf4a281798ec855e369b0b4acdf519fee14
Added onComplete and onCancel events to CancellableChain so that someone
creating it can invoke their own code when it is cancelled or completed.
This is needed for the work on IDestroyable.
Change-Id: I5c274356e952ecbd43dd5e8809a6d4cb4e5e85c5
When we started fetching partial HLS segments to find the start time,
we were no longer able to start playback for content with a moof box
larger than the partial segment. This is because we parsed the boxes
hierarchically, which required the entire payload.
Now, we can selectively instruct the parser to tolerate a partial box
if the part we have includes the child box we are looking for.
This fixes playback of several pieces of HLS content in our demo app.
Change-Id: I956c8b8905dc9f1707f2b24b8248b984b1c036c6
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
Tizen 2016 throws when trying to use JSON to clone cyclic objects. To
avoid this and to remove a hack to clone objects, this replaces it with
an explicit clone implementation.
Closes#935
Change-Id: Ia057e3f6853b813dd89fe33c291b558b71534726
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
The old definition using a union with a Function causes problems. The
compiler tends to treat this as an unknown type, so we loose type
safety. The new types ensure full type safety, at the cost of needing
to "convert" the spy when it is used as a function.
Change-Id: I98ebd9dffd9cb865d0cf5d03db0fb5d6ea001ed3
In DASH, when parsing a date, it should default to UTC. When we pass
the date string to Date.parse(), it will use the local timezone. So
if we don't see a timezone, we need to manually add the UTC timezone
so Date.parse() will parse the correct timezone.
Closes#901
Change-Id: Ica0433042e9bfd42b0cbf62653bdbd2b97b56297
Exposing the roles of tracks, which come from the manifest, in the
select audio language method. This is a follow up on commit
b27861050c11451db57d87270ec1385c1906627a.
Closes#767.
Change-Id: Iebb873f1db8834c7275a8a9fc01c3b855c0288aa
If you attempt to load an asset and then the first load fails, then
the second load will hang forever. This was caused by the second load
trying to cancel the first, but the CancelableChain not handling this
case.
Closes#782
Change-Id: I79e201db44cbf47485e7221cc148bbfdde6276f7
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
When defining a box, the box would be defined as a four
byte integer. Now there is a "fromString" function that
can be used to convert a four character assci string to
a four byte integer.
Change-Id: I78c704e012620c94ae681efb450977305bdb84aa
We only use 2016 in the copyright headers for our files. If we use
different years for different files, then the compiled library will
include copies of all of them, bloating the library.
Change-Id: Ia894601cbd660f9e7cbe84264b421ff60e847dcd
Both DASH and HLS parsers will be using resolveUris() and possibly
other methods in the future.
Create a ManifestParserUtil for the shared methods.
Issue #279.
Change-Id: Iaa5e32ec543a390341a54752563a9f27251f0832
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
During recent refactoring, we introduced a bug in which we would
filter out any text stream with a non-empty codecs parameter.
Replaces PR #639
Change-Id: I9a45ef7e1bc250fd989e3972c0670f3e48336511
In many places we tried to guess the encoding of a piece of text.
This guess fails for Chinese UTF-8 text, and probably text in many
other languages.
However, DASH manifests, TTML files, WebVTT files, and VTTC box
payloads are all specified to be in UTF-8. Rather than guess and
possibly fail, treat all text in these contexts as UTF-8.
Change-Id: I00c652a9f1dd20855e94abfac84275e41dd9e266
When a piece of content has several StreamSets with the same
language and role, pick an audio set with lower average bandwidth,
pick a video set with the highest top resolution. Pick the first one
when the above is not applicable.
Closes#476
Change-Id: Id2cb9095994e8aa6b205024504a5d665f8656437
Based on several rounds of experiments, the timing on these tests was
determined to be too strict. Extending delays and timeouts on these
tests reduces flakiness across browsers and platforms.
Change-Id: Ie36c86f3afcb615991454d098e690199ca063f96
* Decrease Promise delay to reduce timeouts on Safari.
* Stop timedout tests from running their fake
event loops after the tests have actually ended.
Change-Id: I5104396e916cfbca8b2e796f9bc8f2dcb8149042
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
Now the Storage class can store protected content and play it back.
When deleting it, the offline EME sessions will be removed. Also
now offline support appears in Player.support().
Closes#343
Change-Id: Ic5b5a0e0854d80f7821e04e751275abf40ee6eb6
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
player.load() now uses our new CancelableChain abstraction for its
chain of events. player.unload() and player.destroy() will both
cancel that chain. player.unload() will wait on the cancelation to
complete before resetting the streaming system, to avoid a race.
Change-Id: I37fcbacde33f253982c3dd5ed246855d4e363c79