Commit Graph

40 Commits

Author SHA1 Message Date
ismena 2386d4ea99 feat(Ads): Proxy all CS IMA events through the ad manager.
Change-Id: Id66c5ab5287ed99d7847ac6279e1b49284aef2b6
2020-06-23 20:19:03 +00:00
Sandra Lokshina 00942069d7 Fire a shaka.Player.Metadata event on detecting ID3 metadata.
Issue #2592.

Change-Id: Ia2a98668a5971071adfa0ee4d987337ea9c10c59
2020-06-22 18:18:36 +00:00
ismena a2554364ee feat(Ads): Expose more client side IMA info to apps.
In particular:
- New ad events were added
- It's now possible to get original IMA ad and ad manager
objects through Shaka

Change-Id: I2ffdc08befc11011673ebba5fb2fdb5e485977f5
2020-06-17 15:39:11 +00:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
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
2020-06-09 16:05:09 -07:00
Sandra Lokshina 1fc19510ec Hook up ID3 tag parsing information from mux.js
Issue #2592.

Change-Id: I0b17977b88cf37189d7611254ce14171ba52c54f
2020-06-04 17:12:06 +00:00
Sandra Lokshina 43b9567b5b Propagate UI locale changes to ad manager.
Change-Id: I4de1a8a5d16c9b2d8efb71eb94df70ae73fc0c3f
2020-05-26 15:29:10 +00:00
Álvaro Velad Galván a7d46ee3d1 Add locale setting to AdManager (#2563) 2020-05-15 12:57:32 -07:00
Joey Parrish 01970ef11d Fix type info for TextTrack and Cue types
This adds or augments type info for TextTrack, Cue, and related types.

This was caught by a compiler upgrade.

Issue #2528

Change-Id: I233e46eeaed8d6503702e181c3380d674ddbb499
2020-04-28 14:50:32 -07:00
Álvaro Velad Galván 9104c1d68e Fix metadata tracks for live server side ad streams (#2500) 2020-04-23 14:09:54 -07:00
Sandra Lokshina e8d027d7a5 Ads: move setting ad container to IMA StreamManager constructor.
The setClickElement() method we've been using for this is
getting deprecated, and IMA recommends setting this through
the constuctor instead.

Change-Id: I7dd5c5e2644e2b270996be7fe2b1390e41009505
2020-04-22 17:32:25 +00:00
Sandra Lokshina 09895652b3 Set shaka's player name and version in DAI IMA for tracking.
Issue #2469.

Change-Id: I1a71349b2f61c2a03a496cd4e7d1109474ffe4d5
2020-04-14 20:17:58 +00:00
Álvaro Velad Galván 907c75f832 Add loadTimeSeconds to ads stats
Issue #2475
2020-04-01 10:55:18 -07:00
Sandra Lokshina a82592b43f Document ad events.
Issue #2469.

Change-Id: I3a301bdd22377f5d79eeae97eb8caa186518bb81
2020-03-30 16:34:40 +00:00
Sandra Lokshina f4a2b858d7 Refactor player out of SS ad manager.
Issue #2367

This also accidently fixes showing seek bar on ad end for
SS content.

Change-Id: I52241df9861f27d50976f0ce7309c7c14092463a
2020-03-26 17:13:26 +00:00
Theodore Abshire a993fd6b0c Resize ad after 'loadeddata' event.
Before, we depended on the 'loadedmetadata' event to know when to resize
an ad. However, on Safari, that event would sometimes fire before the
video element had changed to its final size. This would result in the ad
being the wrong size.
This changes the ad manager to instead wait for the 'loadeddata' event,
which happens later in the loading process.

Closes #2462

Change-Id: Ie0470eb894034e1427a0767c771a01f801d0f9b4
2020-03-17 15:33:16 -07:00
Sandra Lokshina 604396cf93 Clear ad breaks from timeline on ad request failure.
Issue #2437

Change-Id: I763dc8f68348d56713d2b6703591ef9a3b93edb6
2020-03-04 19:34:10 +00:00
Sandra Lokshina 3a18f1c087 Add ad markers to the seek bar.
Issue #2367.

Change-Id: I6757ac2195b06a205d298082ea7b3d8e3fcc6d8e
2020-03-02 19:44:14 +00:00
Sandra Lokshina 00c2c1961b Fix snapback feature on DAI streams.
If a user seeks past an ad break in the SS DAI stream,
they are returned to the start of an ad break and then
to the point of their original seek, after the ad played
through.

Issue #2367.

Change-Id: I2205f76911439cabb7d55a57b7aa0b163d65efc8
2020-02-25 17:51:34 +00: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
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
Álvaro Velad Galván 697a6ff785 Add initial DAI support (#2382)
This PR ads initial logic to enable support for IMA DAI streams.
Ad-containing streams can now be requested from the IMA stream manager and played.

Integration with the ad UI will follow in a separate CL.
2020-02-18 14:11:51 -08:00
Álvaro Velad Galván bf3c0f721e Fix IMA CS detection (#2386) 2020-02-11 10:50:51 -08:00
Sandra Lokshina c9fe0a28b3 Set player type and version for IMA CS ads.
Change-Id: I3ccfec8e3daba6f44e84f2287f539d8810d157b0
2020-02-07 11:24:23 -08:00
Sandra Lokshina 9c40107cca Clean up a comment about disambiguating IMA SDKs.
Change-Id: If55bb0f6734cc9a788ccf0cec5be231725de9f30
2020-02-06 19:09:09 +00:00
Álvaro Velad Galván 32e81c0e79 IMA: disambig between CS and DAI (#2375)
IMA has two separate SDKs for CS and SS ad insertion.
This PR makes sure people don't try to init CS ads when they only have SS SDK
included.
2020-02-06 10:40:35 -08:00
Álvaro Velad Galván 323b0f18ad Expose some events of IMA SDK to the app (#2372) 2020-02-03 10:14:06 -08: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
Sandra Lokshina 36aaa4d253 Stop client-side ads on asset unload.
Before this change, even if an asset was unloaded,
currently playing ads would continue until the end
of the playthrough. If a new asset was loaded,
the presentation wouldn't start until the end
of the ads.
Now stopping the ads is part of the unload proccess.

Issue #2222

Change-Id: I996cde95a826877971812339cad6c328e15fc97e
2020-01-21 11:55:54 -08:00
Sandra Lokshina 1b3b78ea16 Add ad position info to the UI. (Ad x of y).
Issue #2222.

Change-Id: I9bf946552bc6f669164c387480fadc100087708a
2019-11-22 22:04:05 +00:00
Joey Parrish 64896d70b0 Use shorter license header
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
2019-11-22 18:18:36 +00:00
Sandra Lokshina 64e42fa9b6 Integrate skip button into ad experience.
Change-Id: I49e78c56c178bab47b3773f01f06c171bb422cb8
2019-11-21 18:59:24 +00:00
Sandra Lokshina 47c857d100 Make it possible to exclude ads from the build.
Closes #2231

Change-Id: I3ef4ce09fa3a08bfcaffa2d53aae4bbec70b33c1
2019-11-14 18:13:55 +00:00
Sandra Lokshina d47362ac5e Integrate play button icon change with ads and fix fade out.
1) Play buttons' icons now toggle between play and pause
depending on ad state during ad playback.

2) Controls fade in and out on mouse out/in during
ad playback similar to how they do it during the
presentation.

Issue #2222.

Change-Id: I97ce3b5aa70bdfdd758a54894a3d94b38bccf953
2019-11-01 14:02:19 -07:00
Sandra Lokshina 8fff91531f Toggle ad's fullscreen mode when document.fullscreen changes.
Issue #2222.

Change-Id: I2ab145391cf8dacad261e0a21f69f68508ef3884
2019-11-01 11:27:50 -07:00
Sandra Lokshina 688d8881d9 Change controls behavior when an ad is playing.
This CL makes the controls switch between controlling
the ad and the presentation. If there's an ad currently
playing, pause button will pause the ad instead of the
presentation, mute button will mute the ad, etc.

Change-Id: I42f57df9a5ce491ed842f39e0f1e6031d1e3a93c
2019-11-01 16:25:52 +00:00
Sandra Lokshina 02847e3b1f Show ad controls and update ad counter when ad starts.
(Also hide ad controls when ad ends).

Change-Id: Ifd5b8ec47fe08ef277d86f96632677c7c07cfbd4
2019-10-28 22:10:55 +00:00
Sandra Lokshina 110c0bb485 Create a shaka class to encapsulate ads.
Change-Id: Ic9388679754d24cef7246107e1e3b951977ce27f
2019-10-25 15:23:33 -07:00
Sandra Lokshina 7da5dc91b7 Add ad related errors.
Change-Id: I45ada9c983798a136f4e04caaac91e9d149f6a84
2019-10-18 13:27:14 -07:00
Sandra Lokshina 7afac89bc2 Restructure AdManager to be owned by Player, not UI.
This will allow Ad functionality to be available for apps
with custom UI.

Change-Id: I3911cb6d764b7aef94166b5f6de3a0a7fa8bb8d9
2019-10-18 18:42:13 +00:00