Commit Graph

248 Commits

Author SHA1 Message Date
Joey Parrish 8867db6773 Fix implicit string-to-number conversions
This was caught by a compiler upgrade.

Issue #2528

Change-Id: Ica262703aa30dce2e59c139c88f3c1e74d5d9e2f
2020-04-27 17:33:06 -07:00
Sandra Lokshina 8cb5001984 Replace our skip button with the IMA's default one.
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
2020-04-22 21:03:11 +00:00
michellezhuo 030147c7f4 Avoid displaying duplicate vtt cues
Closes #2497

Change-Id: Ibc4de196f500d8685244217f9a056d8b12c05f8a
2020-04-20 22:58:45 +00:00
Joey Parrish d5e20b5ea8 Fix Shaka UI controls in Cast receiver
The Cast receiver does not ever change the controls between our UI and
the native controls, but the demo app does.  So in the demo app, we
never noticed that they do not seem to show up by default any more.
This fixes the UI library to show its own control by default, which in
turn fixes the Cast receiver app and any other app which did not use
setEnabledShakaControls().

Change-Id: I7889f1a7ec612bc7a260f5433316104d64ad4a26
2020-04-16 16:04:16 -07:00
michellezhuo 002c52c2c1 Add configuration to enable/disable fullscreen-on-rotate
Closes #2494

Change-Id: If66521593d80dd7ddb983c320ebd9c35343f6594
2020-04-11 22:31:00 +00:00
michellezhuo 6d171f7d5a Add configuration to enable keyboard playback controls
When set the configuration to true, using keyboard to control playback
will be enabled, such as seek forward/backward, jump to the
beginning/end, play/pause by press the space key, etc.

Closes #2489

Change-Id: I0e46bd5853d47855aae6e6dedcc7de8798bf4298
2020-04-10 23:56:06 +00:00
Joey Parrish 99de217c23 Remove periods from manifest structure
This removes periods from the internal manifest structure and cleans
up code and tests accordingly.  This leaves us unable to play
multi-period DASH & offline streams until the main period-flattening
algorithm is completed in shaka.util.Periods.

Three test cases have been disabled for the moment.

Multi-period playback will be restored in a smaller, more focused
follow-up commit, with disabled tests re-enabled.

Issue #1339 (flatten periods)
Issue #1698 (rapid period transitions issue)
Issue #856 (audio change causes bitrate change)
Closes #892 (refactor StreamingEngine)

Change-Id: I0cbf3b56bfdb51add15229df323b902f0b2e643a
2020-04-09 19:22:16 +00:00
Joey Parrish f8f64799ef Fix/remove extra keydown listener in UI
After leaving tab navigation, we would wind up with an extra callback
fired on keydown.  This drops the duplicate.

Change-Id: I4e7bc0c433e5648759788a9c1a70267844c2e3f1
2020-04-09 09:38:51 -07:00
Joey Parrish 11cbb267c5 Fix broken docs for UI control events
The event namespaces were wrong, so the generated docs had broken
links.

Closes #2385

Change-Id: I9348dedc1a41edee127548e7f80c7e426ffd237e
2020-04-07 23:37:51 +00:00
Joey Parrish cbbc1c5fc2 Dismiss UI overflow menus on window click
In addition to dismissing the overflow menu when the video is clicked,
dismiss when any part of the window is clicked.  This is no different
from our event listener on the window for key events, so it should not
negatively impact applications.

Fixes: 131843503

Change-Id: Icc5f16f25d74ee5de88f5a928074c4f995a8dea6
2020-04-07 21:28:49 +00:00
Theodore Abshire 461144ba80 Fix placeholders in existing localization files.
Issue #2485

Change-Id: Ibcb82f9dd8ba43bc87d2955909fc160171ea0a7d
2020-04-07 13:45:30 -07:00
Sandra Lokshina fcc27b144a Hide overflow menu while ads are playing.
Change-Id: Ia77f0996c919e78b0a08b90e878c5615dcccf5bf
2020-04-07 18:32:13 +00:00
Joey Parrish 50724e2a91 Fix UI failure on destroy
When destroying the UI, it destroys the CastProxy & Player.  Then the
Player destroys the AdManager.  The AdManager then triggers events
that the UI elements listen to.  Those events cause the UI elements to
invoke the destroyed CastProxy.

Therefore it is important to destroy the UI elements before the
CastProxy and Player.

This was discovered while working on an unrelated issue, by observing
errors logs from automated UI tests.  The logs contained exceptions
with stack traces.

Change-Id: I6c1d070255bb138967d5e733c0c7ec8dd16350b6
2020-04-03 16:24:07 +00:00
Joey Parrish 4f2b3d63b9 Update translations
Change-Id: I386fd9d23b4dcf352a4b910f4b47885755486867
2020-04-01 17:02:17 +00:00
Joey Parrish d55ef50159 Minor formatting cleanup
This fixes syntax highlighting of this file in Vim.

Change-Id: I415b6d4855d5b05d9473e474ef2f057bcfb2c8c4
2020-03-27 15:49:37 +00:00
Joey Parrish 7a42c09477 Fix cursor style on skip-ad button
Without this, you can't tell that the button is clickable when you
mouse over it.

Change-Id: I571803d0ac3bd9416282de96eb20bce478770546
2020-03-26 21:02:49 +00:00
Joey Parrish b245b1ef57 Fix locale update on skip-ad button
Without this, it may not show the correct language.

This bug was discovered while updating our locale-based easter egg.
If you like reading commit messages, and you like easter eggs, maybe
go hunt on our appspot demo.  ;-)

Change-Id: Ie01143a7d419fb51438e763e00fe299424549c9a
2020-03-26 13:13:50 -07:00
Joey Parrish 88ebd5bcd7 Add translations for tier 2 languages
These are not compiled into the library by default, but can be with
the --locales option to either build/build.py or build/all.py.  They
can also be lazy-loaded on-demand, as in our demo app.

There are still some missing translations for Finnish ("fi"), Hebrew
("iw"), and Indonesian ("id").

This also corrects the list of tier 1 default languages in the build
scripts.

Change-Id: I992d7bebbb4e04d55b7992ecaee1d85bb6c1c5da
2020-03-23 16:56:37 +00:00
Joey Parrish b7b0456136 Update tier 1 & metalanguage translations
This updates the translations for all tier 1 languages and
metalanguages (ar-XB, en-XA).

Change-Id: Iea6b5b23f74fedacbf03284d514ede11a187496d
2020-03-23 16:56:37 +00:00
Theodore Abshire d1dce29e89 Added 'doubleClickForFullscreen' config to UI.
This configuration, which is true by default, lets a user optionally
disable the "go fullscreen on double-click" functionality.
This allows a developer to fully disable fullscreen mode, if they so
wish, or to retain the fullscreen button but disable other methods of
entering fullscreen.

Issue #2459

Change-Id: I196602fc9843e0fd799c78703de60f864e906841
2020-03-16 17:03:53 +00:00
Álvaro Velad Galván 935040a3b5 Add ebutts:linePadding to ttml parser (#2443)
https://tech.ebu.ch/docs/tech/tech3380v1_0_1.pdf Section 2.1

Resolves #2407
2020-03-13 11:22:19 -07:00
Jacob Trimble 3fa7472086 Add non-nullable modifier to return types.
This is a copy of the internal CL: cr/299901617.

Change-Id: I49abbde9563f08819ec99dbc9deb99b66dd8053b
2020-03-11 15:46:06 -07:00
Sandra Lokshina 30131c3d7c Add more ad UI tests, augment loc string for ad position.
Issue #2367.

Change-Id: I562ef9e6c6a84a4a113792b647a5c663bcd822bf
2020-03-11 16:47:31 +00:00
Joey Parrish 928585c151 Fix UI exception joining existing cast session
this.video_.classList is undefined once video_ becomes a proxy object.
UI-related things (CSS, tab indexes, sizing) should always be done on
this.localVideo_ instead.

Closes #2451

Change-Id: Id6b007f3bf089bdf8fd532e2832f7b909c9fdf97
2020-03-10 13:28:12 -07:00
Sandra Lokshina 6adc977022 Add tests for ad UI (adUIContainer, skip ad button).
This change creates mocks and fakes for ad testing and adds
tests for the ad container and skip button. Skip button
tests found a bug - this CL also fixes it.

Issue #2367.

Change-Id: I36cb293f9611fbc8592bdc32e156f17a7a78e010
2020-03-09 16:33:10 +00:00
Tanya Gelahova d6de4e710d Add support of fontSize in percentages and cell resolution unit for TTML captions (#2442)
Closes #2403
2020-03-06 08:53:24 -08:00
Sandra Lokshina 6d66695075 Clear ad break markers on asset unload.
Change-Id: I83dd90015a591183f36ee34fe25c7591e4fadd56
2020-03-02 15:18:59 -08:00
Sandra Lokshina 3a18f1c087 Add ad markers to the seek bar.
Issue #2367.

Change-Id: I6757ac2195b06a205d298082ea7b3d8e3fcc6d8e
2020-03-02 19:44:14 +00:00
Álvaro Velad Galván c632324880 Add support to tts:border, tts:letterSpacing and tts:opacity in TTML (#2408) 2020-02-26 11:08:21 -08:00
Joey Parrish fabf820ac7 Add config to show an unbuffered at seek bar start
If set, this new config field will show any unbuffered region at the
start of the seek bar.  This matches the v2.5 default behavior.  If
unset (the v2.6 default), this will paint any unbuffered region at the
start of the seek bar as simply "played" content (matching Chrome's
native seek bar).

Closes #2424

Change-Id: I528169982ce493b0dbf5a8a1bb46e9e096f422d6
2020-02-25 15:20:30 -08:00
Jacob Trimble c49f24b31b Remove remaining deprecated features for v2.6.
Change-Id: I2199e3c960fe6319eb9ab342291dfd9a62d9090e
2020-02-24 15:57:05 -08:00
Theodore Abshire 3a9ac7826e Stop AdCounter timer on element release.
We did not stop the AdCounter element's timer when it was released
before. This meant that changing the controls while an ad was playing
would cause errors.
This adds an override for release to AdCounter, that does that.

Change-Id: I07e4f9c09c466d8130f31a35ceae70df622f3da2
2020-02-24 14:22:53 -08:00
Sandra Lokshina c445b6bcef Add small fixes for DAI and integrate with ad UI.
Issue #2367

Change-Id: Idcd0415359166965e974bbf0b0ee393c0828ae75
2020-02-24 18:33:21 +00:00
Sandra Lokshina feed333d46 Hide the seek bar when ads are playing.
Change-Id: Ic46d7620f3b8686872926227839416a59055d27f
2020-02-24 17:46:34 +00:00
Jacob Trimble 3f63021a2f Avoid using "new" with factories.
Instead of having the "factories" use "new" to construct them, now they
will be plain functions.

Closes #1521

Change-Id: Ia6151ad679a78a5c6db128d43094c82add0af348
2020-02-19 09:57:51 -08:00
Jacob Trimble 072ce2b356 Sort locale files.
This also fixes a bug where the UI source.json file was invalid since
it had a trailing comma.

The JSON files were sorted with this Python:

  with open(path, 'r') as f:
    obj = json.load(f)
  with open(path, 'w') as f:
    f.write(json.dumps(obj, indent=2, sort_keys=True,
                       ensure_ascii=False).replace(' \n', '\n'))

Change-Id: I846dfbbc88254030147193fad057bed024997bcd
2020-02-13 19:52:13 +00:00
michellezhuo cfe1f89171 Add playback speed selection to UI
Closes #2362
Closes #1676

Change-Id: I10184dccab301be7382940e35e36d66dc7a5e2ad
2020-02-12 20:24:03 +00:00
Jacob Trimble 326f5cd02a Use short license in more files.
Some of the files still used the old long license.  This increased the
size of the compiled bundle since it had both versions.

Change-Id: Iec137f71547f91369a563145f870eb26ddc96a96
2020-02-11 19:09:44 +00:00
Joey Parrish 714da55bbc Clean up FIXMEs in LESS code
- Drop unused classes
 - Drop shaka-displayed in favor of shaka-hidden
 - Move shaka-hidden to general.less and fix specificity issue

Change-Id: I9c91da637023607cccd6e7602d9b9ef30994dd82
2020-02-10 23:14:27 +00:00
Joey Parrish b0217f5e6f Work around Material Icons font bug
This works around google/material-design-icons#958 by switching from
the default "solid" style to the "rounded" icon style.

Change-Id: Iea29ed3732d252bd2d089c802c478a97cbda163d
2020-02-10 23:14:16 +00:00
michellezhuo 04cb0b20d5 Fix captions display alignment
Closes #2334
Closes #2157

Change-Id: I274fac15e5327c54d84b8a1e30c0452dc90d8f13
2020-02-05 00:01:30 +00:00
Sandra Lokshina eda5b72134 Add loop control element to the UI.
Please note that this CL doesn't add the new control
to the default layout, so it won't show up in our
demo page.

Issue #2362

Change-Id: Ibecf6a7174de7d8eca9049f0b46ae179a03b9c01
2020-02-04 21:27:20 +00:00
Sandra Lokshina a38f61b1b6 Integrate ad experience into the demo page.
Different ads have been added to three assets.
Demo search CSS has been adjusted a bit for better
experience.
Feature name has been changed from "AD" to "ADS" to
reflect the fact that a single asset can have more
than one ad.

Issue #2222:

Change-Id: I12a63b813fb4bac79362f1689b485a824f5a9682
2020-01-29 18:21:16 +00:00
Sandra Lokshina e9eb292c65 Move native/shaka controls toggle logic to CSS.
Closes #2345

Change-Id: I54bb91899f2f9aa000c43aedbb04ccec22666751
2020-01-27 21:18:13 +00:00
michellezhuo ad9e5b9ecd Display check icon when selecting an audio language
The check icon with selected audio language was not showing because
there might be multiple tracks with the same language and role, and we
only add a button with the first track of this [language, role]
combination to the list, which may not be the selected track.

Closes #2353

Change-Id: Ic95c8f42bf185a6edbde6cb4dd83e7640d0bfa3c
2020-01-25 23:39:13 +00:00
Joey Parrish 4a7aee1daf Customize default UI config for desktop/mobile
To match Chrome native controls, the default controls for desktop will
now contain the small play/pause button, but default controls for
mobile will now contain the large play/pause button.  Mobile controls
will also not contain the volume button.

This removes several CSS-based versions of these things in preference
for configuration.

Apps can still override the defaults, no matter the platform.  Apps
can also make their own mobile-based config choices in JS by checking
video.ui.isMobile() or change styles in CSS using ".shaka-mobile".

Change-Id: I4fb8391f7f3727c7086cd3bca2b1d5c93bd9e856
2020-01-18 23:24:33 +00:00
Joey Parrish d39639e43b Improve comments around fadeDelay setting
Change-Id: I2cf4bb43df0757ec7b88dff0c7831eda0de632ff
2020-01-14 15:04:13 -08:00
Joey Parrish 400d5a9faf Add "fadeDelay" option to delay fading UI controls
This option will be used in our cast receiver to delay fading the
controls for a few seconds when playback begins.

Change-Id: Ia44c2eb6cd4fc9c40f07b0336556a87762f2ee14
2020-01-14 10:42:36 -08:00
Joey Parrish 22e8c29a0d Use CSS & container attributes to hide controls
This is now based solely on container attributes and CSS, as it used
to be, removing the need for a list of controls to hide in JavaScript.
This also does away with the "shaka-fade-out-on-mouse-out" CSS class.

Change-Id: Ic2f77c5b2f0691023279d9c99cfe3519f4b26cdd
2020-01-14 10:42:36 -08:00
Joey Parrish 4c1a122b18 Fix showing of local controls while casting
This was broken during recent ads work, when we refactored how
controls are shown/hidden in CSS.  When we transitioned from
showing/hiding the container to showing/hiding individual controls,
the override behavior for casting was lost.  This restores it.

Change-Id: I81df8e4d3ff14ded0fe431f5f1b66fa821610e02
2020-01-14 03:04:45 +00:00