Commit Graph

1330 Commits

Author SHA1 Message Date
Tijn Porcelijn 5025f2c789 Lower case codec string for IMSC1 Text profile (#2378) (#2381) 2020-02-06 10:54:20 -08:00
michellezhuo a15579711d Add unit tests for UITextDisplayer
Add tests to ensure the css styles are applied correctly to the text
cues.

Change-Id: I3178892e31664fbc5f2bc0b0958423cc68e03940
2020-02-06 17:39:02 +00:00
Joey Parrish 9f448710bc Fix DASH SegmentTemplate multi-period regression
The recent DASH refactor broke the details of multi-period segment
references for SegmentTemplate+duration.

This change introduces a corrected universal model for generating
segment references for fixed-duration SegmentTemplate content.  It has
been tested with a variety of streams from third-parties, most notably
the DASH-IF's live simulator.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)
Closes #2111
Bug: 28087927

Change-Id: Ife4e9ae2bb726e24e97dfe153882dabba4c03f2d
2020-02-05 13:37:29 -08: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
Joey Parrish bce3cfeac2 Fix race condition on HLS parser shutdown
Closes #2138

Change-Id: I30f70874149acacdad57fd387de948ced325cfc9
2020-01-24 23:23:46 +00:00
Joey Parrish 139aa4c4db Fix misdetection of HLS audio-only+group as video.
Closes #1875

Change-Id: I09c5f6cda31762992d9d76cadea8037f1245f5c3
2020-01-24 22:24:31 +00:00
michellezhuo 84b8ab4dfe selectAudioLanguage() selects only audio's role
Before, we checked either the audio role or the video role matches the selected role,
but we should check only the audio role when selecting audio language.

Closes #2346

Change-Id: I040f41129dc902cce79c66ba36cb10917fcc8453
2020-01-24 10:07:38 -08:00
Joey Parrish 639137b4e6 Drop dead code and extra export in TextEngine
The appendCues method in TextEngine was completely unused.  Another
method was exported that should not have been.

Change-Id: Icee35d8ccbc5a903cb13409211a8c5770f1c6a87
2020-01-23 12:32:21 -08: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 1ee32849e4 Fix skipping of raw format streams in HLS
Raw, containerless streams can't be played yet (#2337), but our logic
for skipping or rejecting them was broken.  This broken logic affected
the whole v2.5.x series of releases up to and including v2.5.8.

This fixes the logic and improves it in several ways:
 - Skip streams that can't be played, instead of rejecting the whole
   master playlist
 - Handle raw AC3 and EC3, in addition to MP3 and AAC
 - Handle and skip WebM+HLS in the same way
 - Add the playlist and segment URLs to
   HLS_COULD_NOT_PARSE_SEGMENT_START_TIME errors

This allows us to re-enable the Apple HLS+TS asset as video-only.

Change-Id: Ia00857d87b085aa7e2b810b0b949993cebabe4ba
2020-01-17 12:28:08 -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
Joey Parrish 17473d5370 Fix DASH SegmentTemplate IPR regression
In an in-progress DASH stream (in which the content is static, but not
fully available yet), we will need to produce additional segment
references as time progresses.  This was broken recently during
refactors for period flattening, when SegmentTemplate with a fixed
duration was changed to use a SegmentIndex instead of generating
references on-demand.

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

Change-Id: I0239335fa7c569063f06f4416982fc5ca7d5873d
2020-01-11 21:29:59 +00:00
Álvaro Velad Galván e0045e5731 Add corruptedFrames to stats (#2328) 2020-01-10 15:46:20 -08:00
Joey Parrish c996dfbb15 Fix demo message test on IE
IE does not have the modern fetch API, and we do not have a polyfill
for it.  So we should avoid it in tests for now.  We already had a
similar test utility, so we can just use that.

This also adds a conformance rule so that the compiler will prevent
direct use of fetch in the future, and fixes a direct use of fetch in
the demo app.

Change-Id: If3a051cd06b0fb04ec6fb4bdd1b72eea4d24db4f
2020-01-09 12:00:45 -08:00
Joey Parrish 18208f8560 Add a test to catch missing demo messages
PR #2330 introduced a new message without a definition for it.  This
test would have caught the mistake in advance.

Change-Id: I1a7b0fa2483b791b6b16405e55af84a49d100c83
2020-01-08 14:39:46 -08:00
Joey Parrish efca237739 Prefer the compiled Shaka Player in integration tests
We should always use the compiled build in full-stack integration
tests to ensure that we catch compilation-related errors in the tested
code paths.

There was one instance where we should have done this, and it has been
corrected.  There were two instances where we MUST use the uncompiled
build to regression test assertion issues, and those now have more
obvious comments.

Change-Id: I7cb2f67cbdfbd5a76af69036237adaa576e9806e
2020-01-08 19:50:16 +00:00
Leon Chen c6f0a86d73 add manifest.dash.ignoreEmptyAdaptationSet config option (#2330)
Closes #2023
2020-01-08 11:33:22 -08:00
Joey Parrish 7dd21dbdb2 Fix asset-specific configuration for external playback tests
These tests have been broken since the refactor of our demo asset
objects.  The new Asset class changed some of the types of its
members, but offered methods to configure Player and NetworkingEngine.
The external playback tests were never updated to match, and so fail
for any encrypted asset or any asset using network filters.

This affects both v2.5.x and the master branch leading up to v2.6.

Change-Id: Ia3751d7fc83387bc1565e69ac8d2ed32564804cb
2020-01-07 21:32:12 +00:00
Joey Parrish 48836912a9 Reimplement "Avoid Platform.supportsMediaType when loading."
This reverts commit 6667ea5edf and
reimplements it using a fallback to an arbitrary media element when
there isn't one yet.

This also adds a regression test that would have caught the issue
sooner.

Closes #2326

Change-Id: I44573ae551db51f788d7c97b9680dfd45adee0a0
2020-01-07 12:30:09 -08:00
Joey Parrish 6da39f52e4 Use utility for loading shaka library in external asset tests
We already had this utility, but we did'nt use it here for some reason.

Change-Id: Ib225c7b3f8f0470663ba8d3dd3ba9543af74abd2
2020-01-06 15:39:47 -08:00
Jacob Trimble 011749e95f Standardize argument comments.
This changes the eslint rule to enforce a strict pattern for the
argument comments.  The comment must appear before the argument and
must be /* foo= */.  This still ignores line comments.

Change-Id: I3afb01c65e1088eda13facb3aeeaa7595a2f5aee
2020-01-06 19:40:52 +00: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
Shaka Player BuildBot 1108d843db Merge remote-tracking branch 'github/master' 2020-01-06 10:58:23 -08:00
Joey Parrish a48f8792a9 Move test-only method to test utils
This method should probably never have been in the library, since it
creates a fixed-sized, muted element.

Change-Id: I53b474305465bef34d43ce40ec5e7dedceb20a25
2020-01-06 18:57:28 +00:00
Álvaro Velad Galván bdca05ff4b Add pixelAspectRatio property from DASH (#2294) 2020-01-06 10:56:28 -08:00
Álvaro Velad Galván 5411838f7c Add startTime support in src= mode (#2271)
Closes #2267
2020-01-03 13:45:53 -08:00
Joey Parrish 41a8664dba Make segment references independent of periods
This is a step along the way to flattening periods, and also
simplifies a few small things in StreamingEngine and tests.

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

Change-Id: Ie17cd5e15ed6ec9290a918c3a69c05c74581e0fc
2020-01-02 19:03:18 +00: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
Joey Parrish 4923622e88 Make SegmentReference comparison more general
There were fields in SegmentReference which were not being examined
when instances are compared by jasmine.  Now, the comparison is more
general and will continue to work when we change the structure.

This relates to the issues below because the next changes for those
issues will change the fields in SegmentReference.

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

Change-Id: Ib7cd3d3cadeb0e58efd70964c082219b1c097fad
2019-12-19 19:01:07 +00:00
Theodore Abshire d95ab947e9 Added check for E-AC3 JOC in DASH.
Closes #2296

Change-Id: I776acf68f43e1e48f762a1bd68376c028e777c98
2019-12-16 17:01:23 -08:00
Álvaro Velad Galván 02fa8c6876 Add audioSamplingRate property (#2290) 2019-12-10 18:00:16 -08:00
Joey Parrish 83d19ac5f4 Remove CastUtils test from quarantine
I ran this 70,000 times on each all 13 platforms that are currently
online in the lab, and it did not fail.

Since it's working now, and there are no comments stating why it was
quarantined, it seems fair to remove it from quarantine now.

Change-Id: Icd09e34b72e9d725ce1ea51383a9a25e8b82c1e5
2019-12-09 13:45:15 -08:00
Álvaro Velad Galván fcff08b58d Filter image adaptation sets (#2276)
* Filter image adaptation sets

* Add comment about the change

* Add test

* Change Test  name
2019-12-06 12:18:33 -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
Álvaro Velad Galván f6da953112 Allow ignoreSuggestedPresentationDelay in DASH (#2260)
* Add ignoreSuggestedPresentationDelay configuration

* Add test

* Change test name

* Add missing locale
2019-12-03 11:22:40 -08:00
Álvaro Velad Galván 05c03fcf64 Allow disable the video parsing/decoding/.. in DASH/HLS with a config (#2259)
* Add disableVideo configuration

* Add missing locale
2019-12-03 11:11:06 -08: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
Theodore Abshire 4c6325de08 Added localization system to demo.
No localizations exist currently, but this adds the framework for them.

Change-Id: I81a8cab128884753c765a192181d5d88f0ed13f1
2019-11-18 19:41:58 +00:00
Joey Parrish c395a75b3c Fix exception on adaptation decisions
Because aborting requires knowledge of the new stream, this process
must be done asynchronously.  This makes the abort logic async, and
checks carefully for any stream or operation changes during the
process.

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

Change-Id: Ic187676eeca907603efeb0ffa11855b9af2fc5ca
2019-11-07 11:32:58 -08:00
Sandra Lokshina a70676826a Add a method to select variants by label.
This also addresses an old TODO about switching
variants and text separately.

Closes #924.

Change-Id: I46644ca04dfc8b36696696078c4f14ee15774356
2019-11-07 18:31:41 +00:00
Joey Parrish 289d473dfd Drop the nearly-unused createUris method of SegmentReference
Change-Id: I0ec00e614b2870b8a18d2bb0cd0fc95232c6c28d
2019-11-06 10:51:04 -08:00
Joey Parrish 0c08793392 Clean up async issues in "lazily create SegmentIndex"
Instead of making many internal methods async to accomodate
createSegmentIndex being called lazily, just call createSegmentIndex
during the update cycle instead.  This greatly simplifies things and
allows me to revert some of the changes I made in the earlier commit.

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

Change-Id: I72be8e88f0cf8b04b63d3cda129fa38cef727c0f
2019-11-06 18:50:53 +00:00
Jacob Trimble ea84dfe494 Avoid creating buffers in PSSH.
Now shaka.util.Pssh will only create a view on the buffer instead of
re-creating the PSSH boxes for each element.  This also removes the
boundaries field since the data fields are the useful ones.

This also fixes a possible bug in BufferUtils, updates comments, and
adds some more tests for negative offsets.

Change-Id: Ibe1b7d61d5f5c7e52dfd7aa954db98f0592da4a5
2019-11-05 23:32:37 +00:00
Jacob Trimble 91b8797812 Fix Mp4Parser start calculation.
The "reader" reads the payload of the box, so we need to add the header
size to the start index to get a correct value for the "start" field.
The "start" field isn't used anywhere, so this wasn't caught.

Change-Id: Ia870d01620524ac6e87dea2b7f1bc8571425a976
2019-11-05 23:32:29 +00:00
Joey Parrish d749c5d156 Performance: lazily create SegmentIndex
In StreamingEngine, rather than wait to enable ABR after indexes have
been created for all streams, create each stream's SegmentIndex
on-demand as needed during playback.  This means ABR can be enabled
much more quickly, and also eliminates some complexity from
StreamingEngine's startup sequence.

This required several test changes, since many of our tests were
accidentally structured to depend on certain operations either being
synchronous or happening early during startup.

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

Change-Id: I4bc1d0cdf9022aad14a008accf0aac37c870a83f
2019-11-05 09:40:58 -08:00
Jacob Trimble 597decae3d Fix issues in new Player buffering tests.
Fixes: 143690520
Change-Id: I492d3a0b9d95b0a2117a32ded14d794f8866311f
2019-11-01 16:09:06 +00:00
Jacob Trimble 67941d7ae9 Update comments in persistent-license tests.
Most of the persistent-license bugs on Chrome have been fixed, so this
updates the comments to point to the only remaining issue.  The tests
have also been updated to pass (except for the flaky failure caused by
the remaining bug).  The tests are still quarantined since they are
fairly flaky, even with a large delay.

This also adds some more logging to DrmEngine, makes it use the
"session.closed" property when closing, and removes the close
workaround for Chrome since it has been fixed.

Change-Id: I2dbd0b7005e288ae2a4d9694516daae6f5e0b49a
2019-10-31 17:07:23 +00:00
Jacob Trimble 17432912a8 Add integration tests for Player buffering.
Change-Id: I3efc5f1c23090fca566bc2a63f707a6b4ae655b7
2019-10-30 22:30:51 +00:00
Theodore Abshire 8004e47c46 Ignore delayLicenseRequestUntilPlayed for storage.
When storing assets offline with the storage system, the DRM
engine is used if the asset is protected. However, we never attach
the DRM engine, which means it never gets an associated video.
When the delayLicenseRequestUntilPlayed config value is set, the
DRM engine checks the paused status of the video; thus, if there is no
video element, the DRM engine errors and the download fails.
It would be fairly simple to make the DRM engine attach the video, but
honestly, the delayLicenseRequestUntilPlayed parameter doesn't make
sense for offline storage anyway. So this just changes the DRM engine
to ignore delayLicenseRequestUntilPlayed if it has no video.

Fixes #2218

Change-Id: If4e8d24fdcd1eca81cc39b845e5a833a3f1ce5e6
2019-10-28 16:02:02 -07:00