When a multi-period DASH manifest contains periods which are in the
future (described in the manifest, but with all segments past the
current end time of the segment availability window), the segments
generated for SegmentTemplate were invalid. Not all DASH multi-period
content describes unavailable future periods, so many providers using
DASH would not see this issue. This bug affected v3.0.0 - v3.0.7.
To fix this, we change the "next position" calculation for updates to
clamp to the minimum valid position. This avoids creating segment
references with negative position numbers for these future periods.
When the segment availability window moves to include this period, we
will then start generating segments for it (starting at position 0 or
whatever the startNumber attribute is for this period).
However, the contract for updateEvery() in SegmentIndex was such that
the timer would stop if the list of references was every empty. This
was meant to handle the case in which all segments were evicted, but
it could be triggered instantly on these "future" periods, for which
no segments exist yet in the availability window. To resolve this,
the contract was changed so that the updateEvery() callback must
explicitly signal a stop by returning null instead of an array of
segment references.
Bug: 179025415
Change-Id: I56a2826fd3aea3f69da7b8bf4fa7629562d63506
Previously, the client-side ad container was put inside the controls
container, which was cleared when the UI was configured. This meant
that re-configuring the UI made client-side ads go away, basically.
This moves client-side ads to go into their own container, which
is never re-made or uprooted, even when the DOM is recreated, in
order to not break the IMA SDK.
This has the side-effect of fixing a bug where client-side ads were
not always cleared upon loading a new asset, and could show up
unexpectedly in future playbacks.
Fixes#2869Fixes#2943
Change-Id: I3cf67b0b278764c10c6ff2f678316dc9cc85929e
When user read about these anotation +@complete -@polyfill, they wonder where it came from.
It is not immediately obvious where to see it without reading the next section.
This requirement comes from stylelint, and should apply to both v2.5
and v3.0 branches.
Closes#2913
Change-Id: I26b4d1c1928c5cf832cefc9f181df0986e1ff364
If an HLS stream has no provided codec information in its manifest,
we previously defaulted to providing a best-guess video and audio
codec. This, however, caused problems for video-only and audio-only
streams; Chrome does not like it if an audio codec is provided for
a stream with no audio at all, for example, and fails to append the
chunks.
This modifies the HLS parser to not provide a default video codec if
the 'disableVideo' config is set, and similarly to not provide a
default audio codec if 'disableAudio' is set.
Issue #2868
Change-Id: I7826fdb69f2e5290914ed2c0d1e109f9db94f80d
To enable low latency streaming, the configuration of
inaccurateManifestTolerance should be set to 0, and rebufferingGoal
should be set to less than 1 partial segment duration.
Instead of requiring developers to set three configurations, we
default inaccurateManifestTolerance to 0 and rebufferingGoal to 0.01
with low latency mode, unless speicfied.
Issue #1525
Change-Id: I538fa6d84ced26225fe9ebdf5213b370debfa22d
Previously, on manifest updates, embedded captions would vanish in
single-period live DASH streams. The problem was based on the
specific point in the load order that we added dummy text streams
to indicate the presence of embedded captions.
This modifies the PlayerInterface for manifest parsers to add a
new method passed in, makeTextStreamsForClosedCaptions, which
must be called by manifest parsers for new video streams.
This also completes an unfinished feature, where new video streams
which add new closed captions would not get corresponding
text streams.
Closes#2811
Change-Id: Iee7499ec950b363cf6839765cc2bd2d01743467d
This scheme came up recently while working with a partner on
integration with their streaming infrastructure. This new doc will
clarify what an Application-Level Redirect is, how it works, and how
it can be supported with Shaka Player.
Change-Id: Ia532fa543c0efb98333c1a5a8ad5f2afbd7936fd
1. In low latency mode, the playback start time from live edge is about
3 times partial segment duration, 3s for example. The rebufferingGoal of
2s would result in infinite buffering.
2. In low latency mode, do not allow drift for seeking. Only seek with
the presentation time.
Change-Id: Iee92727bf17dab8b52fae070522a5a2ec1621ffc
This modifies the demo to load localizations even when the UI fails
to load, so that the footer links will still be visible.
This also makes the footer links work in that situation, and modifies
the shaka-ui-load-failed event to return a failure reason code, so
that we can display a contextual error message in event of a failure.
Closes#2669
Change-Id: I0cf38f7e39558f1977eee490131378c32105437f
Apparently, IMA SDK adds their ad UI differently on SS vs
CS ad streams. The solution we devised for CS ad experience
that combined our UI with the IMA's native ad UI turned out
not to work for the SS experience - our UI was being obstructed
by the IMA's UI.
This change adds a new container for the SS IMA UI that allows
our own UI to stay visible.
Issue #2592.
Change-Id: Iedb24beeb8d6f777b1fd7f4155c591350432ec78
The IMA SDK URLs in the service worker were http, and should have been
https. This caused an issue when deploying v3.0.0 to appspot.
The IMA SDK URLs in the demo specified no protocol, but that is not
necessary, since https works in all contexts.
The IMA SDK URLs in the docs also specified no protocol, and one of
them was incorrect.
This corrects the mistaken URLs and makes them universally https.
Change-Id: I53dbf25ddb16ec882fcf3c070bcebed726277be1
The replace() method of SegmentIndex was only ever used in HlsParser,
and was never exported from v2.5.x. We have decided at the last
minute to drop it before v3, so this change removes it from the
upgrade docs.
Change-Id: I0d89745dbeac14e1bf90e8e87f3401a797ea9792
Since we are getting strict about semantic versioning, we can't remove
features in v3.1. Any backward compatibility we offer will be
maintained until v4.0.
The exception is explicit IE 11 support, which will still be removed
in v3.1.
To help us follow the rules for removal, the Deprecate utility no
longer accepts a minor version argument.
Change-Id: I4dd94a6084e4ed72eeec410eb9aa0ad974d8dac8
We have decided to bump the major version number instead of the minor
number, based primarily on the fact that this release breaks
compatibility with our previous manifest structure.
Change-Id: I67e4c8267c6e103cfc7278e09daac186ae5cbbc6
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
This updates to mux.js 5.6.3, which includes a fix for v1 trun box
parsing to fix caption extraction for content with b-frames.
Closes#2395
Change-Id: I206ce26bb43e8187599e8ca7be2e718f4ea345c3
Since we added support for abortable and concurrent store()
operations, this tutorial has gotten slightly out of date. This
updates those particular details.
Change-Id: I932073b04b100cb201ee6be4dad8d8dba3deff18
The Closure Library's base.js, the Closure Compiler, and the Closure
deps-writer are all now loaded via NPM instead of commiting them
directly to the repo. This also updates both the library and compiler
to the latest version: 20200406.
We still have a fork of the Closure Library's URI parser. The latest
upstream version of that has too many dependencies on the rest of the
library to import directly from NPM.
Some internals of the build system have been refactored, and the
"complete" set of files in the build system now includes third_party.
Our forked URI parser does not pass lint checks yet, so the linter
does not run over third_party yet.
A couple of overly-severe sets of compiler checks have been disabled,
since even the latest Closure Library's base.js doesn't pass them.
The script-loader in load.js had to be updated for compatibility with
the new Closure Library. If you don't return "true" now, Closure's
base.js will stop loading subsequent source files.
Some local externs that we had written are now available from the
compiler, so our local copies have been deleted.
A few type-related changes have been made as well, removing casts that
were necessary with the old compiler, but not necessary with the new
one.
Finally, this corrects some type issues in the tests using the new
"typeof" annotation from the compiler. This allows us to type a
variable as a class defined elsewhere. For example, after loading the
compiled library, we can reference compiledShaka.Player, which has the
type "typeof shaka.Player". The compiler can then type-check all uses
of it in the tests.
Closes#2528 (bad polyfill code generated by the old compiler)
Change-Id: I62ec61e82d4edf342b2c576c2d4f89f11562ee65
According to the agreement with the IMA team, we will
no longer hide their UI during ads. Instead we will
incorporate their elements into our layout.
(Some of the elements they expose are legally required
or business critical for partners for certain types of
ads).
This change replaces our skip button with the IMA one
and tweaks our layout to make it fit better.
We are keeping our ad counter and the 'Ad X of Y'
element.
Our skip button will stay in the library, and we will
use it for other (non IMA) ad integrations.
Change-Id: I648c6c65a34607685a409a264c2a03d74cc4d461
This gets us a fix for a closed caption parsing issue described in
videojs/mux.js#330 and fixed in videojs/mux.js#333:
> Atypical streams containing 2+ SEI NAL payloads of type 0x04
> (CEA-708 caption content) in the sei_rbsp (specifically a DTG1
> payload preceding a GA94 payload) fail to display captions in this
> scenario, as the current logic results in parseSei() prematurely
> returning with the DTG1 payload.
>
> By checking for the user ID within parseSei, mux.js can continue
> iterating through the sei_rbsp for the GA94 payload.
Change-Id: I9d90419643279a1273187e0354b5e991cd609ba2
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
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
As part of Period-flattening, I'm trying to remove our dependence on
the "position" field of SegmentReference. With that eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.
- Make SegmentIndex iterable
- Add specialized seek() and current() methods to SegmentIterator
- Remove position from SegmentReference
- Make positions in SegmentIndex API stable without field in
reference
- Remove brittle hard-coded positions in tests (except SegmentIndex
tests, where they would be hard to avoid in testing methods
separately)
- Use SegmentIterator in StreamingEngine to track the next segment
between switches
Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)
Change-Id: I666cc21249c34ee6cbc138a59109d9f1159fa127
Unescaped HTML tags in the tutorial text were placed directly in the
HTML output by jsdoc, causing the text to appear truncated.
Closes#2410
Change-Id: Ic7e3563cc000e666237851b1c7429a164532db6a
Please note that this CL doesn't add the new control
to the default layout, so it won't show up in our
demo page.
Issue #2362
Change-Id: Ibecf6a7174de7d8eca9049f0b46ae179a03b9c01
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
Apparently, the UI customization tutorial is a bit hard
for people to understand. This adds some more context
to the code examples.
Issue #2241.
Change-Id: I6218e4afb8293dfc1cc98e3677868f36f27cec09