This modifies the demo to load localizations even when the UI fails
to load, so that the footer links will still be visible.
This also makes the footer links work in that situation, and modifies
the shaka-ui-load-failed event to return a failure reason code, so
that we can display a contextual error message in event of a failure.
Closes#2669
Change-Id: I0cf38f7e39558f1977eee490131378c32105437f
Some icons on the demo were not centered correctly, such as the custom
content tab's "plus" button. Some conflicting styles were changing
the line-height.
Change-Id: I08c9bb01642346b1a3b1162f779300221ae23246
Apparently, IMA SDK adds their ad UI differently on SS vs
CS ad streams. The solution we devised for CS ad experience
that combined our UI with the IMA's native ad UI turned out
not to work for the SS experience - our UI was being obstructed
by the IMA's UI.
This change adds a new container for the SS IMA UI that allows
our own UI to stay visible.
Issue #2592.
Change-Id: Iedb24beeb8d6f777b1fd7f4155c591350432ec78
Some very long URLs can appear in the error text, and word wrapping is
very helpful. This change sets styles on the element to wrap text
anywhere.
Change-Id: I9b1ddc97f90d5f1b2f5e532efd7c53f747576db5
This icon went missing in the change "Apply upstream styles for icons
font" (Change-Id: I615c1dfd86e5b9802d03050c5db0154ac196c2ef). We may
not be using that CSS class name any more, but the MDL library still
is. So this override that was removed needed to come back, albeit for
a different reason than before.
Change-Id: Ibf7e865604f09d9d02fe15fe9f577ea63cdf6d1d
This corrects/normalizes the license headers in CSS and LESS files.
The LESS tool respects the same "/*!" syntax for forcing the inclusion
of a license header, but will not dedup these licenses. So the LESS
files generally will not use this syntax. Instead, the build system
prepends a license header after compilation.
The exception is for our SVG spinner, which is based on third-party
CSS from codepen. The copyright header for this is forced into the
output to give proper credit to the original author.
Issue #2638
Change-Id: I4c58e2b082f2d5e550a6f0a30feaaf9ebf82a53a
This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs. This does not
affect the compiled output, and is only done for consistency.
Issue #2638
Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
Though not part of the library, this corrects/normalizes the license
headers in the demo app to be consistent with those in the library.
Issue #2638
Change-Id: I4546c4c6970d72ff71a37489fd582623bd6e2ca3
When we changed the font for the icons without changing the class
name, we lost upstream styles from the font server. This was not
obvious in our demo, but was more obvious in other apps where the font
size was different.
By using the same class name as used by the font server, we get those
upstream styles applied correctly.
Issue #2633
Change-Id: I615c1dfd86e5b9802d03050c5db0154ac196c2ef
The IMA SDK URLs in the service worker were http, and should have been
https. This caused an issue when deploying v3.0.0 to appspot.
The IMA SDK URLs in the demo specified no protocol, but that is not
necessary, since https works in all contexts.
The IMA SDK URLs in the docs also specified no protocol, and one of
them was incorrect.
This corrects the mistaken URLs and makes them universally https.
Change-Id: I53dbf25ddb16ec882fcf3c070bcebed726277be1
This change adds the following methods on CastReceiver:
- setContentMetadata(metadata)
- clearContentMetadata()
- setContentTitle(title)
- setContentImage(imageUrl)
- setContentArtist(artist)
These should be called from the CastReceiver's app data callback.
The title, image, and artist methods cover all the Cast content
metadata fields that have an effect in the Google Home App as of June
2020, and setContentMetadata can be used to set one of several object
formats with many more fields defined in the Cast SDK docs.
See https://developers.google.com/cast/docs/reference/messages and the
definitions of GenericMediaMetadata, MovieMediaMetadata,
TvShowMediaMetadata, and MusicTrackMediaMetadata for details.
This also uses these methods from our cast receiver demo, so our demo
will now set all possible metadata when casting our content library.
Closes#2606
Change-Id: I6386276449dbddd2501cd6e3e52206f7fb30b8fd
We have decided to bump the major version number instead of the minor
number, based primarily on the fact that this release breaks
compatibility with our previous manifest structure.
Change-Id: I67e4c8267c6e103cfc7278e09daac186ae5cbbc6
We had two conditionals next to each other with the same condition.
This merges them and clarifies the comments.
Change-Id: I701b30a207035c6428933c79e1b1001097701bed
In player, SimpleTextDisplayer was set as the default TextDisplayer. In
our UI, it changes the configuration to use the UITextDisplayer, and
UITextDisplayer gets constructed with the player. Later in our demo, it
resets the config, so an extra SimpleTextDisplayer gets constructed.
This introduces an extra TextTrack created by SimpleTextDisplayer.
This change sets the UITextDisplayer as the default TextDisplayer in
player's default config.
Closes#2516
Change-Id: I3f653be9fad8b2edbc2fb9de84e8abb327dcfc51
The Closure Library's base.js, the Closure Compiler, and the Closure
deps-writer are all now loaded via NPM instead of commiting them
directly to the repo. This also updates both the library and compiler
to the latest version: 20200406.
We still have a fork of the Closure Library's URI parser. The latest
upstream version of that has too many dependencies on the rest of the
library to import directly from NPM.
Some internals of the build system have been refactored, and the
"complete" set of files in the build system now includes third_party.
Our forked URI parser does not pass lint checks yet, so the linter
does not run over third_party yet.
A couple of overly-severe sets of compiler checks have been disabled,
since even the latest Closure Library's base.js doesn't pass them.
The script-loader in load.js had to be updated for compatibility with
the new Closure Library. If you don't return "true" now, Closure's
base.js will stop loading subsequent source files.
Some local externs that we had written are now available from the
compiler, so our local copies have been deleted.
A few type-related changes have been made as well, removing casts that
were necessary with the old compiler, but not necessary with the new
one.
Finally, this corrects some type issues in the tests using the new
"typeof" annotation from the compiler. This allows us to type a
variable as a class defined elsewhere. For example, after loading the
compiled library, we can reference compiledShaka.Player, which has the
type "typeof shaka.Player". The compiler can then type-check all uses
of it in the tests.
Closes#2528 (bad polyfill code generated by the old compiler)
Change-Id: I62ec61e82d4edf342b2c576c2d4f89f11562ee65
Various issues with the nullability of string types led to various
fixes, including:
- adding an assertion or runtime check that something is not null
- moving an existing null check to before a calculation
- converting a test expectation into an assertion that the compiler
understands (which will still fail the test if the assertion
fails)
These issues were caught by a compiler upgrade.
Issue #2528
Change-Id: I11da091c9e7974c8bea84b3b584cbd29d1e320e2
In "Fix missing or bad type info" (Change-Id
I7f2d070e3da32fe9ff5f444315649f3cbdb5a4a5), I added a bad assertion
that failed at runtime. The placement was wrong and the type I was
asserting was too strict. This fixes both mistakes.
Issue #2528
Change-Id: I297f8c846bf13775a4a59fd43349c96cfcaf3729
The receiver app is attached to the window so it can be debugged.
This should use square brackets, since "receiver" is not defined on
"window".
Issue #2528
Change-Id: I8e725bb8292cdcb88ffccd3bc65d6d54181affa6
The error display in the demo app contains a link to the documentation
for a given error code. We were previously abusing that object to
hold the error severity, as well. This should be stored separately in
its own member variable.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: Ie7fede5fba72e2d28d201dc3e7437eafa87dc38a
The Storage API just changed to return an AbortableOperation instead
of a Promise. The demo did not adopt this new API at the same time.
The runtime backward compatibility provided by the Storage API was
working, so the demo was not broken. But we should be using the API
as defined.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: I2d427ffb0400739c5d2de17a06c5fd79de3d39b2
The demo listens for shaka.Player.ErrorEvent, but it doesn't have type
information for that type. This is because the type is defined only
in the docs, and not in the externs. There is no actual class defined
for the event types.
The extern generator should be improved to handle this, but in the
meantime, we will use square brackets.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: I55fc5fcc7f391f3155c1edc712064c5091fa363e
In many places, the implicit type info was insufficient. For example,
document.createElement returns Element, but the actual return is
always a subclass of Element. In many cases, we need the compiler to
know that a specific subclass is in use, so that it can correctly
check our use of subclass-specific properties. Another common pattern
is confusion between Node and Element (which is a subclass of Node).
Almost all of the changes in the demo and UI are Element-related.
In some places, we referred to HTMLMediaElement, used in the Player
API, instead of the more specific HTMLVideoElement in use in our demo.
Since the demo uses video-specific properties, we must use the more
specific type.
Another case is the use of document.createEvent, which returns Event
according to the compiler, but in reality always returns a subclass,
like CustomEvent.
In one case in NetworkingEngine, correcting the type of an
AbortableOperation led to the discovery that we had been incorrectly
accessing a private method of that type.
In goog.Uri, there were several instances of "*" for a type, which the
newer compiler won't accept. These have all been corrected.
Finally, in some places, we had the wrong nullability on a type.
These were all caught by a compiler upgrade.
Issue #2528
Change-Id: I7f2d070e3da32fe9ff5f444315649f3cbdb5a4a5
According to the agreement with the IMA team, we will
no longer hide their UI during ads. Instead we will
incorporate their elements into our layout.
(Some of the elements they expose are legally required
or business critical for partners for certain types of
ads).
This change replaces our skip button with the IMA one
and tweaks our layout to make it fit better.
We are keeping our ad counter and the 'Ad X of Y'
element.
Our skip button will stay in the library, and we will
use it for other (non IMA) ad integrations.
Change-Id: I648c6c65a34607685a409a264c2a03d74cc4d461
This has not had an impact yet because we do not yet make use of the
encryption scheme queries that the polyfill provides. But this
polyfill has been missing from the Cast receiver in all v2.5.x
releases since it was introduced.
The omission was first noticed when loading the Cast receiver in a
debugger in desktop Chrome. This wouldn't normally be an issue with
most polyfills, but this one is outside of the Closure deps system.
Change-Id: I53685f5efe5555979993bf692d8a7cae31305ea9
For large screens, this fixes the empty whitespace below the footer.
The main content will now expand if necessary to push the footer to
the bottom.
Fixes: b/131849286
Change-Id: I8608e7f733a06c567ce5a01ea5b87f85f901c023
When playing an asset, the player will first choose a codec, based
on the lowest average bandwidth.
However, the storage mechanism did not have any such filtering;
instead, all it did (if using the default track filtering plugin) was
pick the middle-bandwidth audio track. This lead to it sometimes making
different codec decisions than the player would have.
This CL breaks the codec filtering logic out into a helper function, and
calls it both for playback and storage.
It also adds headers comments to some functions in the demo page.
Closes#2390
Change-Id: I09f1a24753121afd0e7500577c0f64ccffe5a4d1
When backporting the search parameters in hash feature to v2.5.x,
the mechanism behind it was modified to handle that branch's lack
of localized strings.
This updates the master version of the feature to follow that change;
now, instead of storing the value of the feature, we store the key.
Change-Id: Ic18aa2ff3d138a68cb3acc154aeb8c7e992daef3
In preparation for v2.6, update the service worker cache. Old caches
will be dropped, which should clean up any extraneous resources cached
by the v2.5 version.
Change-Id: Ief45857ba6033d65e4b267463f0a12a670b71535
Instead of waiting for all active pages to be closed and the old
service worker shut down, activate the new service worker right away
as soon as it is installed.
Change-Id: Ia49b6f44d026a934f46cb5cf2a86dc9de9274b0c
If the demo app is running in compiled mode, the PWA service worker
will now complain about any local resources that are requested by the
app but not marked for caching. This helps catch missing resources in
the service worker's resource lists.
Change-Id: Ia7f65f8ca6679e5c4ba29a1474a42aa97f33278b
Before this change, location.origin appeared in a list of cacheable
URL prefixes in the service worker. This was a lazy way of making
sure that all node modules, translations, etc. would be cached without
being explicitly listed. But it also meant that we could wind up
caching the uncompiled sources, which can complicate debugging if they
are inadvertently pulled from cache on reload.
This change adds the missing local resources that can't be listed
explicitly (translations, logos) by using absolute URL prefixes.
Change-Id: I4963516ec392e7607f86bc891bcdcf46c141951d
The URLs of critical and optional resources will now be converted to
absolute URLs. This will allow the exact URL matching against those
lists to work, which will let me subsequently remove location.origin
from the list of cacheable URL prefixes. (In a follow-up commit.)
Change-Id: I886d11435c96944f9b50ebf937dd329357f5c257
Some of the request URLs in service worker fetch events contain has
parameters, which breaks our exact URL lookups for critical and
optional resources. This fixes the lookups by removing hash
parameters.
Change-Id: I56b22a2faa42e2f3c28bd82fae4e8feedc83d408
Without the "await" on timeout, try/catch would not catch a timeout
error, leading to request failures in some cases.
This bug is present in v2.5.x as well as the master branch.
Change-Id: I3a0c8cd46265d41bade8117edd3cb92ac597d4fd
Loading pwacompat off of jsdelivr was flagged as a security issue
through an automated scan. Since Google does not control jsdelivr,
that is theoretically true.
This just loads a local version of pwacompat via npm, and uses that
instead.
Change-Id: Iba9288a1d440dfdfa039a32b530f6da981c5b055
This adds an option for searching for VOD. It also changes the Live
search option to be a drop-down instead of a toggle, so as to prevent
users from trying to search for assets that are both Live and VOD.
Change-Id: Ib03a64128aea6d06baff23fc1d909090fdf7ef79
"Undefined" was a bit confusing as a search term... does it mean
that you aren't searching for anything, or that you are searching for
things with "Undefined" as a value?
Hyphens are a clearer non-search value.
Change-Id: Ie2a542620265ae1f1ca167f18ca311d15d76acf7