Commit Graph

263 Commits

Author SHA1 Message Date
Álvaro Velad Galván 943bdb2b35 Use Network Information API to react to network changes (#2663)
Resolves #1067
2020-07-09 09:46:24 -07: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
Joey Parrish 7e6a0f38ff fix: Correct license headers in misc. files
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
2020-06-09 16:13:56 -07:00
michellezhuo 6d373eb631 Add config for low latency mode
Issue #1525

Change-Id: I561ac50b4681036b7675efdceae70937c4b9244d
2020-06-09 17:29:54 +00:00
Theodore Abshire 8d657140f1 Made ManifestParser.PlayerInterface.filter async.
This is a change in preparation for the adoption of the
MediaCapabilities API.

Related to #1391

Change-Id: If0988aedafe15aa3be794fb977fd8e04e91ca10e
2020-06-04 17:42:27 -07:00
Theodore Abshire 39090dfc28 Also check for misspellings in externs.
Change-Id: Ia10e58cc350cd1192b7098134215a659564e20a6
2020-06-05 00:41:38 +00: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
Álvaro Velad Galván bafe18fadd Add maxSegmentDuration to stats (#2613)
Resolves #2610
2020-06-03 11:51:59 -07:00
Joey Parrish 32184cad82 Fix comment on units in cue externs
Change-Id: I63a80df4d603f30983eb5b6679e02f28e6e5c572
2020-05-21 16:19:35 +00:00
Álvaro Velad Galván 8648a3e0fc Add option to customize the polling of expiration time (#2579)
A large value effectively disables use of the expiration time

Closes #2252
2020-05-20 14:58:35 -07:00
Sergei Gridasov 2fdbd5b676 Add new option manifest.hls.useFullSegmentsForStartTime (#2575)
If true, forces HlsParser to use a full segment request for determining
start time, in case the server does not support partial requests.

Closes #2556
2020-05-19 08:24:04 -07:00
Álvaro Velad Galván a7d46ee3d1 Add locale setting to AdManager (#2563) 2020-05-15 12:57:32 -07:00
Joey Parrish 82dc707579 Default cue size to 0, meaning "auto".
When no specific size has been set on a Cue object, the default will
now be 0, which means "auto" size to the text displayer.  If a cue has
no specific width, the background will fit to the text.  If a cue has
an explicit width of 100%, the background will fill the entire
horizontal space of the text container.

This fixes the 100%-width background introduced in Change-Id
I4500b8f637f3f43f48d019d14ef527e75d960fec in #2524.

Fixes #2524

Change-Id: I98caeb89d3da640a8175560810c8ccf2de27a2bb
2020-05-12 17:46:52 +00:00
Álvaro Velad Galván 6e7b9c363f Add liveLatency to stats (only MSE) (#2508)
Resolves #1872
2020-04-30 12:25:29 -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
Álvaro Velad Galván 2807971e4e Add creationTime to offline assets (#2406) 2020-04-10 09:58:45 -07:00
Joey Parrish 6e3dfa40ba Deduplicate key IDs with Set
When period-flattening combines Streams, key ID arrays would get very
long with duplicates.

This changes keyIds in the manifest and offline structures from Array
to Set.

Issue #1339

Change-Id: I003d23e567efafa771ecd2ad597900181604ad18
2020-04-09 19:22:16 +00:00
Joey Parrish c4a5513ca5 Rename offline StreamDB.contentType to type
This brings the field name in line with the Stream objects from the
manifest types, allowing for more general processing of Stream and
StreamDB for period-flattening.

Issue #1339

Change-Id: Ic5d0e5d69a6560d475a19f5d3ecb0b1b40b8d271
2020-04-09 19:22:16 +00:00
Joey Parrish e8ac57f36c Move drmInfos array to Stream
Period-flattening will concatenate Stream objects, so this information
should be available per-Stream instead of at the Variant level.

Issue #1339

Change-Id: I96195fea48cab1e4a349b2ab0b16064a443e928a
2020-04-09 19:22:16 +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
michellezhuo 3b52166f56 Remove support for custom DASH ContentProtection schemas
Remove manifest.dash.customScheme callback function since it's no longer used.

Closes #2356

Change-Id: I6d08fcf97cff1bf2985e7c660d74efcd767eaed9
2020-04-09 09:11:20 -07:00
Jacob Trimble 7ae6fc7d93 Fix FairPlay encrypted event handling.
The 'webkitkeyneeded' and 'encrypted' events send similar data, but
they were incompatible with each other and our transform handling.
This makes our polyfill produce the same format as the browser for
cases where the browser may only fire the old event.  This also makes
our utilities work with the new format.

The 'webkitkeyneeded' event was a length-prefixed UTF-16 string while
the 'encrypted' event was just a UTF-8 string.

This also makes a breaking change in the transform callback to pass the
init data type.  This shouldn't break anyone that only uses the first
argument; the second argument was mainly added so we could have the
default transform work without knowing anything.

This change could also break people who use custom transform functions.
The init data format is changing, which could break people who read
it directly.  If they follow the tutorial and use our utilities, it
shouldn't break.  This also updates the tutorial to match the new format
and be more clear about the format.

Fixes #2214

Change-Id: I006382028e828e31e20e085114fd7fd85c0e1eaa
2020-04-07 16:59:27 +00:00
Álvaro Velad Galván 907c75f832 Add loadTimeSeconds to ads stats
Issue #2475
2020-04-01 10:55:18 -07: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
Joey Parrish d7b8e4a581 Fix tracks callback definition
This mistake was caught pre-release by a newer compiler version in
another context.

Related to #2383

Change-Id: I8e2e8c60cf50b1077b09d705116a02ce83d8dba9
2020-03-24 10:21:54 -07: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
michellezhuo c82ff51d1f Add a presentationDelay config for HLS live
Closes #2373

Change-Id: I627bbd226ed9cab9bc476e2c2a3257d2e2dbc0e9
2020-03-11 18:41:15 +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
Á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
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
Jacob Trimble c8043f3916 Allow configuring when to fetch prev segment.
We fetch the previous segment in Live streams to combat differences
between the manfiest times and the segment times.  Now this can be
configured so apps with correct manifests can avoid the extra segment
request.

Also, we'll update the buffering state when a segment appends so we
leave the buffering state sooner.

Issue #2291

Change-Id: Id12c8132dc11739e4c8d42cb1f08e6ae7da1a966
2020-02-15 01:52:05 +00:00
Joey Parrish dbc9ea9772 Add externs for V1 database format
This will make it easier to ensure conversions are done correctly,
which will be increasingly important as we change the database format
as part of #1339 (period flattening).

Change-Id: I1114b1a9a0d341589f7f1026ec23ad93af38a6b0
2020-02-14 19:59:19 +00:00
Joey Parrish d16865b304 Add tests for v2 and v3 offline content
Before this, we only had tests in place for loading and converting the
v1 format for offline storage.  We had database dumps already for v2
and v3, but no tests exercising them.  This adds some basic tests and
fixes a bug in the loading of expiration times for v2 and v3,
equivalent to what we already had for v1.

Note that here, v1, v2, and v3 do not refer to major versions of Shaka
Player.  Instead, they refer to IndexedDB storage formats used in v2.x
versions of Shaka Player.

Change-Id: If32d1f1131b935eb191101463c4152317e711c5c
2020-02-13 20:30:28 +00:00
Jacob Trimble f7be614c42 Add option to log license exchange.
It is common when debugging protected content to want to see the
license request/response data.  This adds a configuration to easily log
the license request/response data so we can see this without modifying
the code or adding breakpoints.

Change-Id: Ib5db3eaa1447ae8714da935ee459fc7f9ba1e937
2020-02-07 22:22:11 +00:00
Álvaro Velad Galván 02db99f567 Take into account the playbackRate in bandwidth calculations (#2329)
Resolves #812
2020-01-31 10:03:00 -08:00
Theodore Abshire 6a6a47c5ca Added stats for time taken in load stages.
Change-Id: I3b9c8397999468e606b241f160174a2063b23ae0
2020-01-29 18:57:45 +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 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
Joey Parrish 4ffcbc6188 Fix pixelAspectRatio types for backward compatibility
For backward compatibility, the new pixelAspectRatio field in Stream
should be string|undefined rather than being nullable.  This ensures
that manifest parser plugins that do not output that field will still
compile against the externs.

PR #2294

Change-Id: I1aae03994a213c8ce52dc64e8a34bf179045f4fb
2020-01-15 19:04:14 +00:00
Álvaro Velad Galván e0045e5731 Add corruptedFrames to stats (#2328) 2020-01-10 15:46:20 -08:00
Álvaro Velad Galván 6e8ab0132f Add framerate restriction to the config (#2332)
Closes #2068
2020-01-08 11:33:58 -08:00
Leon Chen c6f0a86d73 add manifest.dash.ignoreEmptyAdaptationSet config option (#2330)
Closes #2023
2020-01-08 11:33:22 -08:00
Álvaro Velad Galván cdbf8c5fbc Add licenseTime to stats (#2297)
This gives the cumulative time spent fetching licenses.
2020-01-06 11:11:28 -08:00
Álvaro Velad Galván bdca05ff4b Add pixelAspectRatio property from DASH (#2294) 2020-01-06 10:56:28 -08:00
Joey Parrish c13830e535 Augment SegmentReference with offset and window
SegmentReference used to have presentationTimeOffset, which,
subtracted from the period start time, was then _added_ to the
timestamps in the segment by MediaSource.

Now, SegmentReference has a timestampOffset field, which is exactly
what MediaSource's timestampOffset field is set to on the SourceBuffer
before this segment is appended.  For DASH, this is periodStart minus
presentationTimeOffset.

This also adds append window start & end times to the
SegmentReference.  Now segments can be appended to SourceBuffers
without reference to the period.

Note that start & end times of the SegmentReference in each segment
index are still relative to the period.  This will change in a
follow-up.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: I9d54eb2b529ec643c9475b8e9d218c3e2e826a26
2019-12-19 11:35:14 -08:00
Álvaro Velad Galván 02fa8c6876 Add audioSamplingRate property (#2290) 2019-12-10 18:00:16 -08:00
Álvaro Velad Galván 8cbe54575a Allow disabling the text parsing, decoding, etc in DASH/HLS with a config (#2278) 2019-12-04 13:50:56 -08:00