This enables custom buttons that aren't part of the
library to be used in compiled mode.
Closes#2011
Change-Id: I500f93a86bfd2893948e594a969b6f8208836251
Some platforms (e.g. IE11 and Tizen) don't support passing an object as
the third argument to addEventListener. When we do, it interprets it
as a "true" for the capture value and causes the listener to be called
at the wrong time. This now detects whether the browser supports this
and calls the boolean version if not.
Fixes#1979
Change-Id: I05b3f5e536a9bcb5c275cac7f243a9ccc88f8149
Changes to text styles:
- Default to 20px instead of 18px
- Default to a black background (issue #1955)
- Fix the line height (otherwise set in px by MDL in the demo app)
- Scale font with the window in fullscreen or cast receiver
Fixes#1955
Change-Id: I98da85030f4b5a40ba1be962b3d1b4fc2c34489e
Style properties like width, height, and paddingTop should be set on
the style object, not the element directly. Further, "float" is the
wrong name for the css float property in JavaScript. This should be
"cssFloat".
These bugs were caught by a newer compiler.
Issue #1852
Change-Id: I80e8b98a7b693b2b6bb0c52ff9f4a0611e3ea106
Both DOM and UI utils had a removeAllChildren method
that did the same thing. This change removes it from
the UI util and replaces all calls to it with calls
to the DOM util.
Issue #1157.
Change-Id: Iaf7998c460c03416d8651e2efd53c96bdcc9a258
The controls have the cast proxy and the proxied player, so the UI
itself offering direct access to the local player is confusing.
Instead, we will send all requests through the controls, which have
explicit getPlayer() and getLocalPlayer() methods for access to the
proxied and local players.
Closes#1941
Change-Id: I1d6154d76b1b3b5b550e55e39efcbb2c451f7569
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 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
Importing in less is not enough. It will not necessarily inline what
is imported by default. The "inline" option, however, will force the
CSS file to be inlined. Without this, some of the `@import`
statements are put directly into the output file, triggering
additional network requests at runtime. This also adds the "css"
option, which forces less to treat these inputs as CSS and not as
LESS.
Finally, we import MDL for the demo app as a node dependency instead
of loading it from another origin.
This improves the demo's Lighthouse scores of "First Contentful Paint"
by 27% and "First Meaningful Paint" by 14%.
Change-Id: I28e627d3df494e3c4893d31b6bf818f09e8153e9
An automated change converted a "function" function to an arrow
function. But arrow functions can't be used with "new", so it broke
the UI's TextDisplayer. This changes it back to a "function" function.
Change-Id: Ic34cb43cc9b728b0a8420ac6b0ce6d7d5d0bbcd0
Without this change, an app using API-based UI setup won't have any
controls displayed until the call configure(). This didn't affect
declarative setup in HTML or our demo app, but an app should not be
required to call configure() at all if they want to use default
settings.
Change-Id: Ibeef86ccc471e1d04d79fd5af96c7d495ef8203c
With this change, offline and UI config can use the same two-argument
short form that the Player config interface offers.
Change-Id: I5f40ef58da76f3aab1d7178fe7d6e82097352b9a
This reduces the number of resources we have to load by using LESS to
import them into the compiled CSS bundle.
This also gets rid of a flash of unstyled content in compiled mode by
always including the compiled CSS in HTML directly, regardless of
mode. If the app is running in uncompiled mode, LESS is still loaded
and can override the compiled styles.
Change-Id: I8cde25c15c281029a129225fc85a8baee767f424
This is an automated change to convert use of "function" functions
to arrow functions. This doesn't change all uses of bind() that
could be converted. This also doesn't remove all "function" functions.
Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
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
Fix missing await. These tests were not behaving correctly, in part
because they were running async processes synchronously.
Re-evaluate tracks. Some of the failures in these tests were because
the Track objects were not re-evaluated after the tracks changed. The
Player does not modify these object in-place, but generates new ones
when the track API is called.
Re-evaluate buttons. These buttons are remade when state changes, so
they need to be re-evaluated. Before, we were recreating the map, but
still using old references that were no longer in the DOM.
Turn captions on before turning them off in UI test. Otherwise, the
test assumptions are invalid.
Add missing caption event in UI. The UI tests use this event, but it
was only dispatched on track changes, not visibility state changes.
Make sure text is being streamed so API change does something.
Use correct track API in each test. Before, selectAudioLanguage was
used in text language tests.
Fixes b/131909906
Change-Id: Id58495da8f99e3c6f35c09d2d5762c99aaba30d1
Safari on iOS does not support HTML5 fullscreen API. There
seems to be a (separate) way for a video element to enter
fullscreen mode. I will see if we can adopt it in a different CL.
For now, just hide the button if fullscreen API is not supported.
Issue #1909
Issue b/131923216
Change-Id: Ia30660c7a68fd626051fdf5abce59dbe993b2de2
There are some cases in testing where held references cause issues,
such as video elements lingering between tests on Tizen. This does a
better job of clearing out resources in destroy() methods in the UI.
Change-Id: Ib1434ed11561216cd41ec247535ea7b32c1154d1
In these two environments, we must convert ES6 code to ES5. Rather
than work around specific cases, we should let babel convert all test
code into ES5.
This fixes new problems on IE and Tizen introduced with the new demo,
and reverses some work-arounds that were used before.
Change-Id: I6be5ed2cd271e88bc7ebc1e878acbec6bbc21a2e
Before, the text displayer on IE was positioned outside of the video
container, to the right. On IE, the left property was defaulting to
something surprising. The simple fix is to specify left: 0.
Change-Id: Iaf5456c4976afbe59853b32b978e63aac5df2571
Also adds a getConfiguration method to the ui, so that the demo does
not need to construct a config object from scratch.
Change-Id: Ic583fbcc0815494c7668242f6c798b8c15f09697
This is a complete replacement for the old demo page, made to be more
modern-looking and easier to maintain. It contains new features such as
remembering the URIs you provide for custom assets, and searching through
the default assets by feature.
This demo page is not quite ready for release yet, but it's getting close.
Change-Id: Iad01d1fc02c3cd238d73b9b9e02dbb4301cb6f2a
The nightly tests caught a problem on IE where classList was used with
an SVG element. This fixes the problem and adds an assertion that
would catch future regressions even on Chrome, where classList is
available on SVG.
Issue #1674
Change-Id: Ie4200db6989b3d5dd429e6b730069bd060ece0cd
If the resolution menu sees audio-only content, it should be hidden.
But it should come back as soon as the audio-video content is seen.
This came up during work on #997 and #382
Change-Id: I3297847c905c867bcdd14cf7e525a408890a273a
This follows an existing convention in Player error events of using
the standard "detail" member of Event objects.
Change-Id: I26d0fb73e18ad38ec7d231c8560c13da420b2b88