Commit Graph

1012 Commits

Author SHA1 Message Date
Sandra Lokshina c70367dc97 Separate text parsing and display logic.
Closes #796.
Closes #923.

Change-Id: Ifc2017b40a0fb570103f0fed7bc130aa24819e9f
2017-07-17 21:39:59 +00:00
Sandra Lokshina af252c94e7 Add bandwidth info to switch history and make it accept variants.
Change-Id: I3927697cd820dcdd681de39eca3517b81150d7df
2017-07-12 15:18:18 -07:00
Joey Parrish 84a8d1ca18 Polyfill the HTML5 'input' event
The HTML5 'input' event does not work correctly on all input elements
in IE 11.  There are equivalent events that the UI can use on IE.

Instead of remembering this and checking for IE every time the 'input'
event is needed, let the polyfill translate the event type.

Change-Id: I23258a5c6a0bd37e946214380ad07949f3ee7f88
2017-07-12 12:29:14 -07:00
Joey Parrish c69a009960 Do not assume persistent storage support
Two EME polyfills currently assume persistent storage support: one
for old Tizen TVs and other older embedded Chromium devices, and one
for IE11.

This backfires when an application is trying to detect support for
encrypted offline content.

By removing this assumption, we do not convey support for EME features
that are not known to be available on these devices.

Change-Id: If427eeda1cde60341a2b57f76744c2adfdb34beb
2017-07-12 18:46:08 +00:00
Jacob Trimble f511c86039 Fix resetting resumeAt in StreamingEngine.
Based on PR #839

We use |resumeAt| to handle switching between Periods that do and do not
have text streams.  It is used to override what time we need to start
buffering from.  Once we have used it (i.e. started streaming), we
should reset it (to ensure it doesn't break seeking).

There was a bug where if the stream wasn't available yet, it we
would reset |resumeAt| but not start streaming.  Meaning on the next
update, we would check at the playhead time instead of the next Period
time.  Now we reset |resumeAt| only after we know we have started
streaming.

Closes #839

Change-Id: Ibd3ce680cec129719869c8d4a7dda409b573a17f
2017-07-12 10:19:56 -07:00
Sandra Lokshina b3586c193a Add stream bandwidth info to variant tracks.
Closes #834.

Change-Id: I3af66a227ad09f1686a7ca3f545c2bf9683d3c24
2017-07-07 10:20:54 -07:00
Theodore Abshire 54d2914791 Filters out single-stream variants.
In situations where there are variants with video and audio, and variants
with only one of the two, this filters out the less-complete variants.
This removes the possibility of the player switching to an audio-only
variant and breaking MediaSource. It also solves the regression where
audio-only variants have the lowest bandwidth and thus are chosen
preferentially on weak connections.

Closes #824
Closes #861

Change-Id: Ic37543d98962ddd83a85224e26e5225d142b844e
2017-07-06 15:46:28 -07:00
Theodore Abshire 820a6a19c9 Fixes parsing Microsoft-packaged HLS.
Microsoft HLS packaging tools generate audio-only variants in an odd way;
specifically, the variants have an AUDIO tag despite being audio-only, and
thus double-link to the stream.
Previously, the way we detected stream type lead to us assigning one version
of the audio stream to audio and one to video, thus erroneously making those
variants appear to be video+audio variants.
This makes it so that, if the AUDIO tag has the same content URI as the base
stream, it only uses the version in the AUDIO tag.

Change-Id: Ie940970587e95a9020ed67589042008d0568e153
2017-07-06 09:50:18 -07:00
Jacob Trimble 310e48f8cc Fix rounding issues with multi-Period content.
Closes #882
Closes #909
Closes #911

Change-Id: Id31567137860b6bd683169b5b68ca83d6f14473d
2017-07-05 16:57:42 -07:00
Jacob Trimble 26bacb1489 Disallow unknown properties (3/5).
This is part of adding a new conformance rule to add additional type
safety.  This will disallow using properties of unknown types or using
unknown properties.

The first parts will be fixing errors caused by the new rule.  These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.

Change-Id: Ic37437a1ad2305bc50a814cdcc562e74703222ac
2017-07-05 17:47:03 +00:00
Jacob Trimble 845c9af2f6 Fix text track reinitialization.
We should not reinit text until we are sure we are switching.
Otherwise, the new text parser won't have seen the init segment and
won't be properly initialized.

Closes #910

Change-Id: Ieb5549afcad7aa58aa1a6e8d383f3cd783280d5c
2017-06-28 13:07:07 -07:00
Jacob Trimble adb8da4764 Disallow unknown properties (1/5).
This is part of adding a new conformance rule to add additional type
safety.  This will disallow using properties of unknown types or using
unknown properties.

The first parts will be fixing errors caused by the new rule.  These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.

Change-Id: Iefde089b2f62ddfdf43944cda5badab438577561
2017-06-27 19:43:00 +00:00
Joey Parrish 07d067bfab Work around lack of Tizen key statuses in tests
If we haven't gotten a key status within 5 seconds of updating a
session, consider the session "loaded".  This fixes a hung Promise
in DrmEngine for offline use-cases.

Issue #891
Issue #894

Change-Id: Ic4c7478198a0db4b3a3df8842d5f8cd1f6f3e8bd
2017-06-22 20:14:21 +00:00
Joey Parrish 1eb5a41d6f Fix failed assertion tearing down offline tests
Discovered while working on #894

Change-Id: Icf74cd4bf804df0b055033f9c1113971e1644202
2017-06-22 20:14:21 +00:00
Joey Parrish bbdc0bacc4 Work around Tizen reporting on persistent licenses
This works around Tizen 3.0's misreporting of its support for
persistent licenses, which prevents us from running persistent
license tests on that platform.

There is still one more failing test on this platform.

Issue #894

Change-Id: I81ebb80a831c753e3af4851efcbd7e97211e6890
2017-06-22 20:14:21 +00:00
Michelle Zhuo f09999aa80 Add channel count information for HLS audio tracks
Adding the count of channels, as a new field for tracks and streams.
Used for HLS audio tracks.

Resolves #826.

Change-Id: I1448b4a8cfaf6dd798670bb2f0f3981d6c7e40c3
2017-06-22 11:34:36 -07:00
Joey Parrish 8b54c7b758 Define, document and rename new option for offline
The new isPersistentLicense option was not documented in #878.
This adds docs and renames it to usePersistentLicense.

Closes #873

Change-Id: I59ed32c98660ad7c155392a1708eab98f63131c3
2017-06-21 14:56:05 -07:00
Graham Scragg 59fe4e5d40 Support for offline data with a temporary license (#878)
Based on app configuration, we could store protected content offline
without a persistent license.  The offline content would then require
a network connection, but only briefly for licensing.  This makes
sense in a lot of commuter or airplane WiFi scenarios.

Closes #873
2017-06-21 14:44:02 -07:00
Jacob Trimble 4aa2430a1b Fix key status problems with EME polyfills.
Our EME polyfills give a key status with a Key ID of '00' (a single 0
byte).  This breaks the Player logic for restricted tracks since it
assumes that those are not playable.  When we get this Key ID, we should
treat the key status as a global status, not for that specific Key ID.

Closes #884
Closes #890

Change-Id: I392550227274fb321d2c223eb8d483a0a4733186
2017-06-21 19:42:05 +00:00
Joey Parrish 651b32a4ea Add detail to video errors in Chrome
This makes use of a new field added to Chrome 59.

Change-Id: I1b68e803967cfd7cfb64cea26458d0f3ef8a27c1
2017-06-20 16:49:59 -07:00
Jacob Trimble 7a5991a01d Fix date parsing when timezone is missing.
In DASH, when parsing a date, it should default to UTC.  When we pass
the date string to Date.parse(), it will use the local timezone.  So
if we don't see a timezone, we need to manually add the UTC timezone
so Date.parse() will parse the correct timezone.

Closes #901

Change-Id: Ica0433042e9bfd42b0cbf62653bdbd2b97b56297
2017-06-20 12:43:23 -07:00
Jacob Trimble 3186ce25c4 Fix more test timeouts on Tizen.
Like other browsers, the Tizen TV sometimes stalls when inside an
otherwise playable region.  Our technique of flushing by seeking to
the current time doesn't work.  So instead we seek a small amount
in the future.

Closes #893

Change-Id: I91e56e3b9a22fac21fb1d8f66a30a6237b3b28e5
2017-06-19 10:55:06 -07:00
Jacob Trimble ca64053118 Fix test timeouts on Tizen TV.
Tizen TV seems to stall when it plays into a gap.  This stall isn't
fixed by a seek.  So when gap jumping, we should jump before we hit
the gap on Tizen.

Fixes: 62628840
Change-Id: Iff7b7a2a4c2c2a5b9015728f1dceece6421463b9
2017-06-16 20:45:19 +00:00
Jacob Trimble 2abb3ae50e Fix track switching when near Period boundary.
Trying to switch to a stream from a previous Period while we are
buffering a later Period can cause problems.  This is caused by
different media states "needing" different Periods.

So if we try to switch to a stream from a different Period, we should
handle the Period transition then to ensure all the streams are needing
the correct Periods.

Closes #797

Change-Id: I3d93d93bf141901fe8f8f62fd0ca9fa96a07c268
2017-06-15 23:14:59 +00:00
Michelle Zhuo 00b440f376 Support audio track selection by role and language
Exposing the roles of tracks, which come from the manifest, in the
select audio language method. This is a follow up on commit
b27861050c11451db57d87270ec1385c1906627a.

Closes #767.

Change-Id: Iebb873f1db8834c7275a8a9fc01c3b855c0288aa
2017-06-15 22:41:21 +00:00
Joey Parrish 98f3f3e218 Support MIME and codecs on different DASH elements
This fixes the detection of content type for text AdaptationSets which
contain mimeType only, but contain a Representation with codecs only.

Closes #875

Change-Id: Ibae7ae8357653c1960daefa4c3e122187de51bb3
2017-06-15 11:03:46 -07:00
Jacob Trimble 8835f7b898 Fix bug when trying to load when there are pending failures.
If you attempt to load an asset and then the first load fails, then
the second load will hang forever.  This was caused by the second load
trying to cancel the first, but the CancelableChain not handling this
case.

Closes #782

Change-Id: I79e201db44cbf47485e7221cc148bbfdde6276f7
2017-06-07 13:29:28 -07:00
Jacob Trimble 70ac4987d8 Track manually added text tracks in active tracks.
There was a bug where manually added text tracks weren't added to the
active track list in Player.  This caused assertion failures and
problems with selecting those tracks.  Now those tracks will be tracked
correctly.  Note that Player will correctly select text tracks based on
language and will allow switching.

Closes #821

Change-Id: Ie9465a2d3bc757f43281ef40658daa488f58bc12
2017-06-06 14:36:00 -07:00
Sandra Lokshina c6c6d05810 Move text-related files into their own directory.
This change creates a lib/text directory and moves all files
with text-related logic to it. It also lays the ground for
separating text parsing and display logic. (That change will
introduce even more files with text-related logic which will
crowd lib/media directory).

Issue #796.

Change-Id: I65ac134020a0126ff02a8f2067beb73870232e65
2017-06-06 18:21:09 +00:00
Joey Parrish 6721ab275c Fix PlayReady unpacking on Chromecast
Closes #852

Change-Id: Ic3d87e5ad2339ff0a03ce550a1930b99b22ba8ca
2017-06-06 09:51:39 -07:00
Joey Parrish 53220b5acb Polyfill video.play to silence confusing errors
Closes #836

Change-Id: Ie5b42bc707ce7443641e86c04ec116fd732bbbae
2017-06-05 12:34:31 -07:00
Joey Parrish 8fdd2921dc Fix offline storage offline in compiled mode
We were giving Storage a Player proxy from CastProxy instead of a
local Player instance.  This fixes the mistake and adds a new error
code to make it clear when this mistake is made by other apps.

Change-Id: I4f2d49adc45ef5ca3a942a72192a09f001f5100c
2017-06-05 18:03:32 +00:00
Joey Parrish 434f1bf9b0 Choose lowest bandwidth codecs
Before asking AbrManager to choose streams, we should choose codecs.
Choose the most efficient codecs, and do it after we have filtered
out the codecs that the platform cannot use.

Closes #841

Change-Id: Ifbdd22b33254d4584f77db6456ab238f7c04c755
2017-06-05 18:00:23 +00:00
bhh1988 41eac10c08 Stop infinitely retrying on network errors for VOD (#842)
Do not infinitely retry on top of the retry-policy already defined by
RetryParameters, especially for VOD. For live video the previous retry
logic is still useful to be robust against clock-sync or asset
availability issues. This commit adds a boolean configuration parameter,
infiniteRetriesForLiveStreams, to allow the user to turn this behavior
off even for live video.

Fixes #830 and #762
2017-06-05 10:42:09 -07:00
Matias Russitto ace0e8cf49 add video and audio stream IDs for getStats().switchHistory (#846)
Closes #785, #823
2017-06-05 10:29:55 -07:00
Joey Parrish e8af210dab Clean up config merging, type check certs
- cleans up config merging now that abr.manager has been removed
   from the config
 - uses thing.constructor == Object instead of
   typeof(thing) == 'object', for better detection of anonymous
   objects
 - adds a default (empty) server certificate for type-checking
 - treats empty certs the same as null (no cert provided)

Fixes #784

Change-Id: Ie833a1b3bf484d5f12f3ebf6d513ed51740bdc44
2017-06-05 03:21:48 +00:00
Joey Parrish bb32073725 Fix PlayReady on IE and Edge
We broke PlayReady on IE and Edge in #815 when we fixed PlayReady for
Tizen.  This should work for both, but will still need to be tested on
Tizen after merging.

Closes #837

Change-Id: Iff41845ae6a4b369e8f21a80623ebb2cb5475fd6
2017-06-05 03:21:33 +00:00
Joey Parrish 5798845d4b Minor cleanup in AbrManager
No need to pass a member variable around.

Change-Id: I84cab5d4327faadbfd1fc427f5d5bc2c15a31d1a
2017-06-02 16:12:10 -07:00
iKinnrot f145dffc9e Fix math round when number > 2^52 on IE11 (#832)
Don't use math round on ie11 if number > 2^52.
2017-06-02 14:51:25 -07:00
Sandra Lokshina 859130fd45 Refactor player to accept abr manager factory.
This change makes ABR targets configurable and refactors player
to accept Abr Manager factory rather than have manager be
part of ABR config.

Closes #744

Change-Id: I732daaf555d21cc9e79450eeb1f74ac3544b90cc
2017-06-01 09:35:54 -07:00
Sandra Lokshina 765e016e0b Add an API to limit playable/seekable range for VOD.
Closes #246.

Change-Id: If555ab5b78c60defe0932eb4c160ab4e296c9d9b
2017-05-31 21:28:52 +00:00
iKinnrot bed012dc3c Add label attribute to text track (#831) 2017-05-31 13:54:57 -07:00
Michelle Zhuo afb0ded49c Expose Roles of Audio Tracks
This change is to expose an audio track's role in order to differentiate
among a main / caption / commentary track that shares the same
language.

Issue #767.

Change-Id: I05d38cba2170d0005611cf160b7ae45996fe77dd
2017-05-26 13:51:43 -07:00
Theodore Abshire 1e119e40cf Adds option to fail gracefully on xlink failure.
At the moment, when there is an xlink problem, the manifest parser
returns a rejected promise. This adds a configuration variable to
instead simply not replace the xml tag.

Closes #788

Change-Id: Iace953233c83a57820130033150e7cd9a9385d6f
2017-05-25 21:10:09 +00:00
Joey Parrish bd79d607ab Minor cleanup after #811
Change-Id: Iaed56bdbc2937006746ee433e2f13af08e3e585d
2017-05-25 11:15:28 -07:00
iKinnrot 151930284a Add support for DASH label and HLS NAME attributes (#811)
* add support for non-standard DASH label attribute
* add support for HLS NAME attribute

Closes #825
2017-05-25 10:43:07 -07:00
Joey Parrish 16f9ca6a97 Make some educated guesses about HLS missing info
- Default CODECS attribute to 'avc1.42E01E,mp4a.40.2'
 - Infer stream type and multiplexed status from number of codecs,
   associated groups, and video-specific attributes.
 - Recombine codec strings when we detect multiplexed content

Closes #805

Change-Id: Ib1298033360b52091b7d871fed0eca047a00ad22
2017-05-22 18:47:19 +00:00
Joey Parrish 488453086a Add hls.Tag.getAttributeValue
Most of the times we want an attribute, it is only to get the value.
This adds a convenience method that gets the value directly, with an
optional default value if the attribute is not found.

Change-Id: I79002c4d6d4d4da468860238eab16fff6b8df747
2017-05-22 18:47:19 +00:00
Joey Parrish 9e2eeeb869 Increase key status batching timeout
We batch up key status changes in DrmEngine.  This increases the
timeout from 100ms to 500ms to address some flakiness in tests that
are being run in a project that depends on Shaka Player.

b/38426414

Change-Id: Ie6d8b14a981b2cff1c152f7571cd98ef4c382b96
2017-05-18 16:16:17 -07:00
Joey Parrish 0214ed9de7 Add support for Chromecast variant of PlayReady
Chromecast has a variant of PlayReady that uses a different key system
ID.

In addition to mapping between key system IDs and making other small
exceptions for Chromecast, I also fixed a bug in the calculation of
expired key statuses.  The ChromeCast PlayReady implementation does
not expose key status information at all, and this caused us to
erroneously declare all keys expired.

Change-Id: I52c96eec0040af6bf902a614760b8cd06e608dcd
2017-05-18 13:19:18 -07:00