The current implementation of pixelAspectRatio in DASH is wrong. `@par` in DASH is "picture aspect ratio" so the correct is populate this field with `@sar`.
There is not a separate message for skip forward or skip backward, and
we already support seek. So there's no obvious reason to claim we
can't support skip forward and skip backward.
Related to #2606
Change-Id: If9a931afa2d6a0d323b561ed9f6500f79fb0d1bd
The docs for the Cast messages say that duration is optional, so it
seems better to omit it for live content, rather than send back an
absurdly-large number.
Note that this does not seem to affect seeking in live streams.
Seeking in live streams seems to be disallowed by the Google Home app
either way.
Related to #2606
Change-Id: Id7d3911b410489b56643afaaee12102b5d6929a1
When we get a GET_STATUS request, we are supposed to send back media
info. That field is only optional for other requests.
This fixes the scrubber in the Google Home app for VOD content.
Issue #2606
Change-Id: Iceec95f18cf15325b7ee2350a0f30f31edc90560
When we get a playlist update, we replace the list of SegmentReferences
in the SegmentIndex. However, the position pointer in the
SegmentIterator of the SegmentIndex is not updated, and still points to
the index of the old SegmentReference list. Thus, the current
SegmentReference may be null.
We should merge the new SegmentReference list with the old list, and
mark the offset of the list.
Closes#2605
Change-Id: Ia6740e1173ac48467e7b141257cc9c6148e30a0c
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
In getSegmentReferenceNeeded_(), we get a SegmentReference base on
(presentationTime - maxDrift) time. If no SegmentReference is avaiable,
we wait until next update.
For live edge, if the SegmentReference with the drifted time is always
out of the segment availability start/end time window, we don't append
any segments.
If we can't find a valid segment with the drifted time, we should seek
with the presentation time.
Fixes#2589
Change-Id: I3fedc002ffc5c99f9dd1d1bf9525aca141b9a2be
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
Changes to the load() promise resolution on iOS for #2483 accidentally
broke language preferences in src= mode, and the regression test for
this revealed subtleties in how and when tracks may be selected with
Apple's native HLS.
By waiting for a "change" event on video.textTracks, we can make sure
Apple is ready to accept our own text track selection.
This should now work correctly on all platforms.
Closes#2593
Change-Id: Iec59b89001fbec3779a0f7087ce11efe1be003ef
This adds our first screenshot-based layout tests and the
infrastructure to use WebDriver for screenshots through Karma.
This new kind of test will be skipped in any non-WebDriver context.
There are many pieces to this system.
First, we update the Karma WebDriver launcher to a newly-released
version that lets us access the client spec object from the launcher.
Second, we build a Karma middleware plugin to respond to HTTP requests
from the tests. We handle /screenshot/isSupported and return a bool
so tests can be skipped on non-WebDriver launchers. We also handle
/screenshot/diff to take the screenshot and compare it to a known-good
version.
The screenshot is a full-page screenshot, since element screenshots
don't work consistently across all the browsers in our test lab. The
screenshot is then cropped to a rectangle specified in the request.
This rectangle is measured to match a specific element, so in
practice, we are screenshotting just one element.
Browsers use sub-pixel rendering, effectively rendering at a scale
larger than the "pixels" seen by JS. The screenshot comes in at this
scale, so the requested cropping rectangle is scaled to match, then
the cropped screenshot is scaled down to the JS-measured size.
Because of sub-pixel rendering, element offsets can be non-integer
numbers. Normally, Karma puts the tests in a iframe, above which is a
variable-height banner showing which devices are connected to Karma
and what state they are in. So this variation and the lack of integer
offsets means we can run into stability issues due to rounding errors.
To make offsets consistent and improve stability of the screenshots,
this banner is now disabled in our Karma config.
The cropping, scaling, and diffing of images is handled Karma-side by
a node module called Jimp.
Before we start the layout tests for UITextDisplayer, we use a node
module in the browser called fontfaceonload to wait for our web fonts
to be fully loaded. This module is a polyfill that polls on IE and
uses a standard API in modern browsers to wait for our font to load.
This is all wrapped into a new test util called waitForFont.
Screenshots are stored in test/test/assets/screenshots/ and are
organized into folders by platform and browser and named according to
an identifier specified by each test case. The new screenshot is
written to disk with the suffix "-new", and a diff image is written
with the suffix "-diff". When a test fails, we can review the changes
in a browser with test/test/assets/screenshots/review.html. The
known-good screenshots can be updated with the new tool
build/updateScreenshots.py.
Change-Id: Ib477fd3c459de466c6dc91e9a60d3e2579164b12
Instead of calling video.load() and waiting for loadeddata for src=,
wait for loadedmetadata. This should be a safe event to use in most
cases, and calling video.load() causes native HLS to start preloading
an uncontrollable amount of content.
The exception is if the app sets preload='none' on the video element.
If this happens, we will detect it, log a warning, and avoid the
loadedmetadata event which may never fire. This is not a scenario we
will officially support, but at least we can prevent a hang in
player.load().
Closes#2483
Change-Id: Id64c8f23cb8fa82bb5c301abafb51f2d9d8730f7
For some reason, the new compiler in the master branch let this by,
but the old compiler in the v2.5.x branch complained when I
cherry-picked the utility.
Change-Id: I1e688f72594b74ed7d2a7c2801eb179b8ec13e8c
While developing screenshot-based layout tests, it was discovered that
IE 11 did not position VTT/TTML regions in the same way as other
browsers. This turned out to be caused by a bug in IE's flexbox
implementation in which flex items that are center-positioned can
overflow the flex parent.
This uses the work-around recommended here:
https://github.com/philipwalton/flexbugs/tree/6e720da8#flexbug-2Closes#2584
Change-Id: I22b9790b8f5798ba757a111d2c502dd5a3415441
The margin: auto style centers the element both horizontally and
vertically. We don't want vertical centering, and we already get
horizontal centering when appropriate through other styles. So
removing margin: auto is the best fix.
Closes#2524
Change-Id: Icff74e49b3917b50141d1205232ebb0856fbcf16
In HlsParser, fetchPartialSegment_() is meant to fetch the starting part
of the segment to get the segment's start time, so we don't have to
download the full segment if possible.
PART_SEGMENT_SIZE is the default size of the starting part of the
segment we fetch.
Low Latency HLS introduces 'Partial Segment' as a smaller part of
a regular segment, such as CMAF chunks, and a regular segment might be
divided into many partial segments.
Renaming the original function and field to improve code readability and
avoid any future confusion.
Issue #1525
Change-Id: I593497f6e99e9ffe6128d6976eb7886bbd79679c
This fixes the missing shaka.log in debug builds by exporting it
explicitly with the Closure Library API if goog.DEBUG is set.
Closes#2565
Change-Id: I4edd3220997f890058b693cec3bdf295ab5c171c
The timestamp parser in our HLS parser should not fail on null TS
packets. These are indicates by a packet ID of 8191 (0x1fff), and
according to the spec, should be skipped by any receiver.
We will not skip such packets and continue through the segment to find
a PES packet with a timestamp.
In addition to the comments in #2546, I found this document helpful:
https://www.mikrocontroller.net/attachment/27265/mpeg2ts.pdfCloses#2546
Change-Id: Id9dc16160bbde03969199150ca50122f12de77f4
The position: 'absolute' style should only be set when other
positioning attributes (left, right, top, bottom) are being set.
Otherwise, the natural layout flow is disturbed, without anything to
replace it.
Closes#2524
Change-Id: I4062c68253218a0f4ace6560a8847381d80c48d5
@exportInterface is used by the extern generator, but ignored by the
compiler. @export should be used for shaka.polyfill.
Closes#2549 .
Change-Id: I400db152ec8ca222a45a598ab58ddfbe44552443
Setting text track visibility to true may, in some cases, require us
to choose a text track. But we should not do this if one has already
been chosen.
Closes#2553
Change-Id: I53bf1b624b59baae774ffaeb0f0e9eb5467984fc
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
The destroy method on SegmentIndex is needed for backward
compatiblity, so it should definitely be exported in v2.6, as it was
for v2.5.
Change-Id: Id29faea5ae1719f1ea9201808aa9ce674574afc7
1. When the video hasn't started playing and is buffering, display
playback rate as 1x.
2. When the video is buffering and the playback rate gets updated,
display the newly selected playback rate.
Closes#2526.
Change-Id: I2e8764cfabdcc675a94e26bd9cd18cbc056a35f9
This reverts commit 604a33d7b9.
Instead of adding another another getter method, we can change the
current behavior of the existing getPlaybackRate() function.
Reopens#2526.
Change-Id: Ic8e60220191ef89fbb2fb242aa7b8263e0409c4b
1. When the video hasn't started playing and is buffering, display
playback rate as 1x.
2. When the video is buffering and the playback rate gets updated,
display the newly selected playback rate.
Closes#2526.
Change-Id: Idf074e402ef8fdd2905dee84dcd5f084f217342e
Also add a note to the MSE polyfill about restrictions being applied
in Player as well. We used to restrict Safari versions only in the
polyfill, and I had forgotten about the other version check.
Closes#2548
Change-Id: I4d2f319939c3a079e7f0ec7134876d91fc425bf4
When we construct final streams in period flattening, we start them
off original streams and then combine streams from each period that
best matches the characteristics of the original stream.
The original stream also participates in the matching process, but
it was possible for it not to get selected as the best match if
there were other streams with similar characteristics.
This change adds logic to always prefer the original stream if
it's encountered.
Also, this change adds a bandwidth comparison for audio
streams to ensure the closest streams get matched bandwidth-wise.
Issue #2537.
Change-Id: I5d99a452a12ea1c4bb70fa8aba4bec479ff9d27b
In player, SimpleTextDisplayer was set as the default TextDisplayer. In
our UI, it changes the configuration to use the UITextDisplayer, and
UITextDisplayer gets constructed with the player. Later in our demo, it
resets the config, so an extra SimpleTextDisplayer gets constructed.
This introduces an extra TextTrack created by SimpleTextDisplayer.
This change sets the UITextDisplayer as the default TextDisplayer in
player's default config.
Closes#2516
Change-Id: I3f653be9fad8b2edbc2fb9de84e8abb327dcfc51
We changed SegmentIndex from IDestroyable to IReleasable since v2.5.x,
so this adds compatibility for the v2.6 release to avoid breaking
existing apps.
Change-Id: I3a12eec98c9af58fe08f0aec7e499266b70e9b48
It does not make sense to truly export an abstract interface. This
should always have used the exportInterface annotation.
Change-Id: If170b41b89728dd549669cee0c606de492b79ad9
When SimpleTextDisplayer is constructed, a TextTrack is created,
and that cannot be removed. This introduces an extra TextTrack when the
content is played in src= mode.
This is the straight-forward solution to filter the extra TextTrack out
by the label in src= mode.
Issue #2516
Change-Id: I8c417f837e4ad2f90ec779b533c8484de9e22b11
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