SegmentIndex has had a destroy() method for a long time, but it has
never been called. Now that SegmentIndex has a timer which adds new
references for DASH SegmentTemplate live streams, it is more important
than ever to properly stop this active part of SegmentIndex.
This change replaces async destroy() with synchronous release() and
calls it from Player when the manifest is being disposed of. This
will ensure that SegmentIndexes don't grow out of control after
content is unloaded.
This would not have affected v2.5, since we didn't have this
timer-driven growth of DASH SegmentTemplate live streams in that
release branch.
Related to #1339 (fixes issues introduced for period flattening)
Change-Id: I419a06a62eaa507d92132e20d4cc2d6e45c83ff2
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
This reverts commit 235e4e11ad.
The effort to remove SegmentReference's position field will be handled
in a different way.
Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)
Change-Id: I62b115137abc89f498b30467e574b0401dcad05d
These are not compiled into the library by default, but can be with
the --locales option to either build/build.py or build/all.py. They
can also be lazy-loaded on-demand, as in our demo app.
There are still some missing translations for Finnish ("fi"), Hebrew
("iw"), and Indonesian ("id").
This also corrects the list of tier 1 default languages in the build
scripts.
Change-Id: I992d7bebbb4e04d55b7992ecaee1d85bb6c1c5da
This removes the tests added by #2412 since they didn't test what
was wanted. This also fixes our existing tests to ensure they work
with autoCorrectDrift. Lastly this adds a new test to ensure the
UTCTiming is ignored when autoCorrectDrift is true.
Change-Id: If511fca5d3f360cdf373229961b2a01fdbda31bb
While fixing cherry-picks for v2.5.x, I found that the test for
parsing very large MPDs would fail on that branch because it referred
to segments that do not exist locally. This changes the MPD to refer
to local segments which can be loaded, which is important on v2.5.x
where the load() call can fail if the first segment fails.
This tweak makes the test work universally on both branches.
Change-Id: I97284aa964034bf5768abdb97f06b2a1e371d865
Before, we depended on the 'loadedmetadata' event to know when to resize
an ad. However, on Safari, that event would sometimes fire before the
video element had changed to its final size. This would result in the ad
being the wrong size.
This changes the ad manager to instead wait for the 'loadeddata' event,
which happens later in the loading process.
Closes#2462
Change-Id: Ie0470eb894034e1427a0767c771a01f801d0f9b4
This configuration, which is true by default, lets a user optionally
disable the "go fullscreen on double-click" functionality.
This allows a developer to fully disable fullscreen mode, if they so
wish, or to retain the fullscreen button but disable other methods of
entering fullscreen.
Issue #2459
Change-Id: I196602fc9843e0fd799c78703de60f864e906841
`'webkitneedkey'` events are fired with the same `event.initData` for the video and audio tracks, and a new session is needed for each.
Closes#813 (duplicate sessions required on Tizen)
Closes#2447 (polyfills broken on Tizen)
Closes#2448 (PlayReady broken on Tizen)
In the code for supportsChunkSize, we test to see if a given chunk
size is supported by array to string conversion by trying to perform an
operation on a Uint8Array of that size without throwing an error.
However, the result of that operation was only ever referenced inside an
assert. Because asserts are compiled out in release builds, the
result of that operation was not being used... and thus, the entire
call was being compiled out.
This changes the return value of the function to use the result of the
operation, thus preventing it from being compiled out.
This also adds a unit test that will detect this problem in the future.
Closes#2433
Change-Id: If3048531afc460beb16de0dda7f7fcbd5499fdaf
As part of Period-flattening, I'm trying to reduce our dependence on
the "position" field of SegmentReference. If it can be eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.
SegmentIndex can now track the last reference you asked for and
iterate through the list of references. This means we don't need the
"position" field of SegmentReference, which means we don't need to
know positions in advance or globally. StreamingEngine will no longer
use position to request segments.
The old methods find(time):position and get(position):SegmentReference
have been replaced with seek(time), current(), and next(), all of
which return a SegmentReference and maintain an internal pointer to
the "current" reference. Care has been taken to maintain that pointer
during the evict() and fit() operations. Recent changes to merge()
made sure that the pointer does not need to change during that
operation.
All test updates are related to the SegmentIndex API change, not
changing expectations or behavior.
Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)
Change-Id: I1682dcc2dd625c6e390711538e46d31e6eb6cea8
As part of Period-flattening, I'm trying to reduce our dependence on
the "position" field of SegmentReference. If it can be eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.
There has long been a comment at the top of SegmentIndex's merge
method stating that we only ever extend the references, but never
interleave them. The code, however, is structured in such a way that
it could interleave them. This could cause the offset of a given
SegmentReference in the Array to change, which would be counter to the
comment about only ever extending the list.
This change simplifies merge() so that it can only ever extend the
array of SegmentReferences. This will guarantee that their offset
within the Array will not change during the merge operation. This, in
turn, enables further SegmentIndex changes to move "next" segment
tracking out of StreamingEngine (where it is based on the "position"
field of SegmentReference) and into SegmentIndex (where it could be
based on offset into the Array of references).
It removes one test related to PR #838. This test was about our
ability to update the position of the final segment in a list. This
doesn't seem to make a lot of sense, and we're going to stop relying
on segment position anyway.
Issue #1339 (period-flattening)
Change-Id: I2067e2266cf2d02c0e6350d6b57d74f9ed1b27d3
In preparation for v2.6, update the service worker cache. Old caches
will be dropped, which should clean up any extraneous resources cached
by the v2.5 version.
Change-Id: Ief45857ba6033d65e4b267463f0a12a670b71535
Instead of waiting for all active pages to be closed and the old
service worker shut down, activate the new service worker right away
as soon as it is installed.
Change-Id: Ia49b6f44d026a934f46cb5cf2a86dc9de9274b0c
If the demo app is running in compiled mode, the PWA service worker
will now complain about any local resources that are requested by the
app but not marked for caching. This helps catch missing resources in
the service worker's resource lists.
Change-Id: Ia7f65f8ca6679e5c4ba29a1474a42aa97f33278b
Before this change, location.origin appeared in a list of cacheable
URL prefixes in the service worker. This was a lazy way of making
sure that all node modules, translations, etc. would be cached without
being explicitly listed. But it also meant that we could wind up
caching the uncompiled sources, which can complicate debugging if they
are inadvertently pulled from cache on reload.
This change adds the missing local resources that can't be listed
explicitly (translations, logos) by using absolute URL prefixes.
Change-Id: I4963516ec392e7607f86bc891bcdcf46c141951d
The URLs of critical and optional resources will now be converted to
absolute URLs. This will allow the exact URL matching against those
lists to work, which will let me subsequently remove location.origin
from the list of cacheable URL prefixes. (In a follow-up commit.)
Change-Id: I886d11435c96944f9b50ebf937dd329357f5c257
Some of the request URLs in service worker fetch events contain has
parameters, which breaks our exact URL lookups for critical and
optional resources. This fixes the lookups by removing hash
parameters.
Change-Id: I56b22a2faa42e2f3c28bd82fae4e8feedc83d408
Without the "await" on timeout, try/catch would not catch a timeout
error, leading to request failures in some cases.
This bug is present in v2.5.x as well as the master branch.
Change-Id: I3a0c8cd46265d41bade8117edd3cb92ac597d4fd
this.video_.classList is undefined once video_ becomes a proxy object.
UI-related things (CSS, tab indexes, sizing) should always be done on
this.localVideo_ instead.
Closes#2451
Change-Id: Id6b007f3bf089bdf8fd532e2832f7b909c9fdf97
This change creates mocks and fakes for ad testing and adds
tests for the ad container and skip button. Skip button
tests found a bug - this CL also fixes it.
Issue #2367.
Change-Id: I36cb293f9611fbc8592bdc32e156f17a7a78e010
As part of Period-flattening, I'm trying to reduce our dependence on
the "position" field of SegmentReference. If it can be eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.
The HLS parser uses positions to find previously-resolved segment
times when refreshing a live playlist. What we're really doing is
using HLS media sequence numbers, since we use those to assign the
segment positions in the first place.
This change makes the use of media sequence numbers more explicit, and
adds a per-Stream map from media sequence number to segment start
time.
The only other users of segment positions are StreamingEngine and
various tests.
Issue #1339 (period-flattening)
Change-Id: If970ed2c8722ed5779a51349ca2e64208d78130d
That alias was confusing the closure compiler, and causing it to
produce invalid output when making release versions.
Closes#2438
Change-Id: Ic232ce4f29222543b13c2cc725ffefaedea29e3a
One playlist may contain multiple EXT-X-MAP tags, and each EXT-X-MAP tag
represents the initalization information for the segments after it,
until the next EXT-X-MAP tag or the end of the playlist.
Issue #1335Closes#2397
Change-Id: Ibb0b4f5da6a48f0303d205cb6bd3abad278527fd
These tests failed an assertion because they did not respect the rules
for AbrManager. In compiled mode, this went unnoticed because asserts
are removed in the compiled bundle. But when running tests in
uncompiled mode, these would always fail the assertion and therefore
fail the test.
Change-Id: I44700d118f3f45ebcc955d9306deaca4815b902e
Debian stable and Ubuntu LTS now both have usable nodejs packages.
When possible, we will use those. In older distros, we will still
install packages from nodesource. The nodesource version has been
updated to v10.
b/150687293
Change-Id: I25f14fbc1751aea1ac1d51cb38f8736d34a601e6
Loading pwacompat off of jsdelivr was flagged as a security issue
through an automated scan. Since Google does not control jsdelivr,
that is theoretically true.
This just loads a local version of pwacompat via npm, and uses that
instead.
Change-Id: Iba9288a1d440dfdfa039a32b530f6da981c5b055
This adds an option for searching for VOD. It also changes the Live
search option to be a drop-down instead of a toggle, so as to prevent
users from trying to search for assets that are both Live and VOD.
Change-Id: Ib03a64128aea6d06baff23fc1d909090fdf7ef79
"Undefined" was a bit confusing as a search term... does it mean
that you aren't searching for anything, or that you are searching for
things with "Undefined" as a value?
Hyphens are a clearer non-search value.
Change-Id: Ie2a542620265ae1f1ca167f18ca311d15d76acf7
Naming the tab "SEARCH" was potentially confusing to users.
"ALL CONTENT" is probably a more intuitive description of what
the tab does.
Change-Id: I45b6b28fe2d59339c7c6fbf744f587937175d1f1
No asset was using "Unknown" as a source, and it was taking up
space in the search drop-downs and being confusing. It was only used
when loading unknown assets from the URL... but then, the source of
an asset loaded from the URL is more or less irrelevant, so that
doesn't really matter.
Change-Id: I1e20c717351aaf66f8a2b3fa25422ed884c7fd80