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
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
The appendCues method in TextEngine was completely unused. Another
method was exported that should not have been.
Change-Id: Icee35d8ccbc5a903cb13409211a8c5770f1c6a87
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
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
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
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
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
PR #2330 introduced a new message without a definition for it. This
test would have caught the mistake in advance.
Change-Id: I1a7b0fa2483b791b6b16405e55af84a49d100c83
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
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
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
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
This method should probably never have been in the library, since it
creates a fixed-sized, muted element.
Change-Id: I53b474305465bef34d43ce40ec5e7dedceb20a25
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
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
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
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
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
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
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
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
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
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
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
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