This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.
It seems that the `!` in the header forces the compiler to keep it in
the output. I believe older compiler releases did this purely based
on `@license`.
Issue #2638
Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
Various issues with the nullability of number types led to various
fixes, including:
- defaulting a nullable number to 0 to avoid propagating a null value
through calculations
- adding an assertion or runtime check that something is not null
- moving an existing null check to before the calculation
- returning early on null during an iteration
- changing a nullable number to non-nullable
- defaulting to NaN instead of null
These issues were caught by a compiler upgrade.
Issue #2528
Change-Id: I86d516c74a42ee3624c33d7513d2d4c76d3ea589
Instead of having the "factories" use "new" to construct them, now they
will be plain functions.
Closes#1521
Change-Id: Ia6151ad679a78a5c6db128d43094c82add0af348
This fixes the argument count on the compiled versions of our default
callbacks. This makes sure we don't issue incorrect warnings about
the application's configured callbacks.
This was discovered in the compiled build of our own demo by observing
the warning logs about the wrong number of arguments in some of our
callbacks.
Change-Id: I401d54bdc706aee9a70fbf5db83fc5e7de5cb183
We fetch the previous segment in Live streams to combat differences
between the manfiest times and the segment times. Now this can be
configured so apps with correct manifests can avoid the extra segment
request.
Also, we'll update the buffering state when a segment appends so we
leave the buffering state sooner.
Issue #2291
Change-Id: Id12c8132dc11739e4c8d42cb1f08e6ae7da1a966
The config merging code was rejecting async functions, because the
.constructor field of a function is the "Function" constructor, but
the .constructor field of an async function is the "AsyncFunction"
constructor (not exposed as a global). This led to the async function
being rejected because it was misdetected as a different type of
"object" than the default value.
The fix is to exclude functions from this constructor-based
type-checking.
Note that the compiler will turn async default values into synchronous
functions in the compiled build, so an async default will appear as a
synchronous function in the compiled build and an async function in
the uncompiled demo.
A synchronous function from the app will always be okay, even if the
library expects async, because "await" will still work. But if the
library expects a synchronous function, the app should not supply an
async function, because that will return a Promise instead of the
expected type.
This adds a test to show that it is okay to pass a synchronous
function to an async config field, which is important for backward
compatibility as we make trackSelectionCallback async (#2383).
However, because the compiler causes us to lose the native async-ness
of our default values, we can't reject async for sync fields or write
a test for that scenario.
Found while fixing #2383
Change-Id: I62891441ce75bfc887ea13c24212a2ee78f90af4
It is common when debugging protected content to want to see the
license request/response data. This adds a configuration to easily log
the license request/response data so we can see this without modifying
the code or adding breakpoints.
Change-Id: Ib5db3eaa1447ae8714da935ee459fc7f9ba1e937
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.
This also updates the company name from "Google, Inc" to "Google LLC".
Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
This adds a separate configuration value for this because (a) the HLS
parser can't access the streaming configuration and (b) this behavior
is different in that the streams are removed instead of just not playing
them.
Closes#2065
Change-Id: Ic9b1e0d40b161cd4ba0eb6d7c922882112034626
Now there is a generic callback to transform the init data before
passing it to the browser. This can be used by apps to use a custom
content ID in FairPlay content. This also adds some utilities to help
in writing these functions and moves the default behavior to DrmEngine.
Closes#1951
Change-Id: I78ce660c126b53a69d5f55b16775ffcdbbe4d748
This replaces find/get callbacks in Stream with a SegmentIndex. With
the exception of DASH's SegmentTemplate+duration, all manifests were
already backed by SegmentIndex. Now, all manifests are backed by
SegmentIndex. This will simplify Period-flattening, in which all
tracks will be represented by a list of segments, some of which come
from different Periods.
The SegmentIndex in Stream will not be created until
createSegmentIndex is called. Prior to this change, the find/get
callbacks could be invoked without createSegmentIndex() in some cases
(excluding DASH's SegmentBase), which some lazy tests took advantage
of. Now that find/get are methods on SegmentIndex, createSegmentIndex
must be called in all cases. The tests have been updated accordingly.
Making SegmentIndex generation async in all cases exposed some issues
with the parser context being modified in-place between one
Representation and the next. So the parser now makes a shallow copy
of the context before it is bound into an async callback.
To facilitate updating the SegmentIndex for SegmentTemplate+duration
content, SegmentIndex now has a method to update its list on a timer.
Once per segment duration, the index will be updated to add and remove
SegmentReferences.
The initial expansion of SegmentTemplate+duration will be limited to a
relatively small number of segments, to avoid excessive CPU or memory
consumption. This defaults to 1000 segments, but is configurable.
Issue #1339
Change-Id: I99c007b1096c3b396d04a729750cd7b743cb899d
It turns out that we do not export the PlayerConfiguration utils.
This caused the recent fix to the demo configuration section to break
the nightly, when in compiled mode.
Change-Id: I361145c900f38ae132b2fa4408e0c3a7e02364ce
For browsers without NetworkInformation API, a configurable default
bandwidth estimate is used until we have enough data to build a real
estimate of our own.
This raises the default to 1Mbps. Applications can still set their
own default.
Change-Id: I86d7e7b028e9bf8c8e928d4db28cd1683ebc8646
This is a fully automated change. The linter will fail because the
extra indentation caused line-length errors. These won't be fixed
automatically. They are fixed in a follow-up to make this one fully
automated.
Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
The Network Information API gives us an initial bandwidth estimate on
Chrome and Opera (and others, some day). But the API changed slightly
in a way that broke our detection of it. This restores the
functionality so that our initial bandwidth estimate is closer to what
we will converge on during playback.
Change-Id: Iaff9224c98127e6fcad1f188d73d243a45f36cd7
With the new style rule, we cannot have two statements on the same line.
So we can no longer have an "if" on a single line and we cannot have
an arrow function with a body on the same line as when it is used.
This is mostly a manual change.
Change-Id: I2285202dd5ecbad764308bc725e6d317ff2ee7f0
This enables the eslint rule that requires all functions to consistently
either return a value or not return a value.
Change-Id: I98b579f3689c3b6c74968116824231bb792bd9dd
Make the stall detector configurable via Player.configure. This
should make it easier for developers to work around stall issues
and make it easier for us to find ideal configuration for
different platforms.
This exposes:
- Enabled : A flag for whether or not the player should
initialize and use a stall detector.
- Threshold : The number of seconds that must pass without
progress before firing the stall-event.
- Skip : The number of seconds to skip forward after a
stall-event.
To make enable possible, the stall detector was made optional and
is now passed into the gap jumper. This allows Playhead to evaluate
the config and create the detector as desired.
Issue #1839
Change-Id: Ife1bf34b4cfc7b469f4b0beb312a06d5b5cd81a9
The drift fixing allows us to play content that has drift by starting
to play at the last segment in the manifest. But some live content
specifies content in the future, so we can't just start playing at the
last segment in the manifest.
Fixes#1729
Change-Id: I3095a2d28b34ed93346933f561d77335361f1fae
Now that we have a formal terminology for how we talk about
language and locales, this change updates our code to utilize
our new vocabulary.
For more information on our terminology, see our "Talking About
Languages" document.
While the expression of the behaviour has changed, the final
observable behaviour should not have changed. The goal of the
"rephrasing" was to build our logic based on the concepts discussed
in our "Talking About Languages" document.
Change-Id: I16c405e3d5a4d1e2275c99d5ec0bbdbaaf8373b9
Add the config field manifest.dash.ignoreMinBufferTime, which will default to false. If true, the DASH parser will ignore minBufferTime in the manifest, such that streaming.rebufferingGoal is the only factor in play.
Closes#1547
Some of these issues were found by the Closure Compiler linter,
which we are not currently using here. I will try to re-enable it
in a follow-up change.
Change-Id: Ie6e75f2b5a1e0f888c3dfbc78ed9cf254d2738bb
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