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
This makes the config-rejection logs always-on in compiled mode, to
help application developers notice problems during upgrade.
Found while fixing #2383
Change-Id: I131a1bf8197da394a743e9a121348178d38e5948
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
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
In some previous change, the drm configuration method was changed to
reset the player's configuration first, to remove any previous asset
drm configuration.
However, this also removed any user-originating configuration.
This changes the demo to store a record of the configuration from the
perspective of the user, and re-applies that instead to "reset" the
configuration.
Closes#1976
Change-Id: Ia1a659bd037cfd347e5bf763d7145e1523fca56a
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
With this change, offline and UI config can use the same two-argument
short form that the Player config interface offers.
Change-Id: I5f40ef58da76f3aab1d7178fe7d6e82097352b9a
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
Before, resetConfiguration would break the getSharedConfiguration,
which would break the connection between Storage and Player.
Change-Id: I497bcb390031c815ed006848619d0a055ce8cdde
When merging config objects, we accidentally used the same object
reference for multiple key systems. This caused settings meant for
one to affect another.
The clone util had to be updated to handle Uint8Arrays, which may be
present in DRM configs.
Closes#1524
Change-Id: I66c8dc114573605471b1eeb38e890bbd4d29e2d4
cloneObject used to be part of config_utils.js.
This meant that a number of classes that didn't actually use
config objects required ConfigUtils.
This moves cloneObject into the new ObjectUtils, to clarify that.
Change-Id: I92d630eba8798b3e2671dcce95b61f44282b05e7
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
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: I10f5c38a8b06b5797c6eec7492829084114514c9
A follow-up fix changes all 'var' definitions to 'let'. This fixes
issues caused by it. One major change is adding brackets to case
statements. Each case statement is considered in the same scope, so
defining variables in them actually are the same variable. By adding
brackes to the cases, each case gets its own scope.
Change-Id: I99b1298223786f4df415594a2e64eb31d72b2053
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
- cleans up config merging now that abr.manager has been removed
from the config
- uses thing.constructor == Object instead of
typeof(thing) == 'object', for better detection of anonymous
objects
- adds a default (empty) server certificate for type-checking
- treats empty certs the same as null (no cert provided)
Fixes#784
Change-Id: Ie833a1b3bf484d5f12f3ebf6d513ed51740bdc44
Treating serverCertificate as an Object and recursing causes an
exception the second time you set the serverCertificate config.
As a quick fix that can be cherry-picked for v2.1.x, do not recurse
on serverCertificate. This has the side-effect of not type-checking
the serverCertificate field on input.
A more detailed fix will be made later, for inclusion in v2.2.
Issue #784
Change-Id: I84c05ee3dd370a4b83e9ce2337d2326ec36532c2
This add the groundwork for event regions that occur while playing.
When the playhead enters (or plays through) a specified region it will
fire enter/exit events for it. They are not fired when seeking over.
Issue #462
Change-Id: I9e280796bd012ad74d0319aa2056c6f6aa28890d
Before, Player.configure would check the number of arguments for
the functions being set and reject those with an incorrect count.
However, this does not work with jasmine spies. So instead allow
it but log a warning.
Change-Id: I0f03ae9a22bf6a6e427c2a26a6f055dcaa40b3ec
This moves a bunch of code out of Player into different files. This
is needed to allow the new Storage class to have the same behavior
as Player. This also reduces the size of player.js.
This moves the following code:
* Determining the manifest parser to use.
* Period filtering.
* Application track restrictions.
* Configuration object merging.
* Choosing initial stream sets.
* Track creation.
Change-Id: I84d68d39b487447d6f8d61a145cd034a88165739