This adds or augments type info for TextTrack, Cue, and related types.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: I233e46eeaed8d6503702e181c3380d674ddbb499
This adds an annotation to suppress a bogus compiler error in
StreamingEngine. In this method, we set updateTimer to null, then
await some async operation, then check to see if it's still null. The
latest Closure Compiler thinks this is a useless check, but we know
better. The updateTimer could have been created while the async
operation was in progress.
Issue #2528
Change-Id: I9a28b7dac1d7cb8bcfd836847507454030af52c6
The compiler is very picky about the use of the "disabled" property on
HTMLElement, since it is only defined on certain subclasses of that.
This adds a method to create a button with the correct type to satisfy
the compiler.
Issue #2528
Change-Id: I31cacd62a35acc87b245ab362dbab55d791cf34d
When CastProxy refers to a proxy object, the type is necessarily
merely "Object". This isn't specific enough for the compiler to check
access to this.videoProxy_.paused, so we convert this to use square
brackets.
Issue #2528
Change-Id: Ic51fa9fdd20b8ac494fea1e844a945fba319f3c8
These polyfills don't have the exact same type as the thing they are
polyfilling. Instead of being constructors for VTTCue (which doesn't
exist if we are using the polyfill), they are functions that return
TextTrackCue (the base class of VTTCue and the closest thing we have
on some platforms).
Because the types don't match, the latest Closure Compiler complains.
To get around this, we use square brackets.
Issue #2528
Change-Id: Ie1e3f13dc51f2145f7d3c9d510b64d9a8d7b1f64
DrmEngine is adding an extra property to MediaKeySystemConfiguration
objects, knowing that EME will ignore it. The latest Closure Compiler
won't allow this.
In the future, we should refactor DrmEngine and consider tracking this
in some other way. For now, this changes the dot to square brackets.
Issue #2528
Change-Id: I544c93dfa2534e9d62ac5ea47e20a6dc3cb79e3a
We had made some mistakes in these prefixed names. The corrections
were made after consulting both MDN and Apple's docs.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: I80994569b04a14b26b3e2fbb2673992ca7e68f50
When we changed the constructors for the V2 cells with the
introduction of V5 format, these call sites didn't get updated. This
doesn't seem to be a user-facing bug, and did not affect any releases.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: I77228d17631ef44a6b85a81b88054790461617bc
This is only defined on Stream, not Variant. This bug has was
introduced in PR #2332 and the v2.5.8 release and affects v2.5.8 -
v2.5.10. The corresponding feature (frameRate restrictions) has
actually never worked.
This was caught by a compiler upgrade which is still in progress.
Change-Id: I0409d9be8d3f6eb0794775ca29f28b98208bab4f
This method (shaka.util.Uint8ArrayUtils.equal) was removed between
v2.5.0 and v2.6, but could be in use by applications. This change
adds the utility method back, with a deprecation warning.
Change-Id: Ifd780759ae389e766c1889a83545cfda8969e76b
These exports are not needed by the application. Some of them may
have been added to work around the extern generator's lack of support
for partially-exported classes.
Change-Id: Iaf142397f31bd927bf942499a79da595f77361d5
For webOS TV 2020 platform, like for Tizen, key IDs should not be
transformed to big-endian UUIDs, it causes `4012
RESTRICTIONS_CANNOT_BE_MET` error.
Closes#2512
You can either abort downloads one at a time, using the
AbortableOperation interface, or you can implicitly abort them all at
once by destroying the storage instance.
Closes#2417Closes#1362
Issue #1301
Change-Id: I0ba102e5bf60a063f0e2f6ecd3f135445226996f
This partially reverts commit ad3d4604, because that fix seems to have
caused #2523.
This also adds a regression test for #2523.
Reopens#2516Closes#2523
Change-Id: If3ed5942fff029f522e24048edcb4a04e7cc30e9
The setClickElement() method we've been using for this is
getting deprecated, and IMA recommends setting this through
the constuctor instead.
Change-Id: I7dd5c5e2644e2b270996be7fe2b1390e41009505
When the non-UI TextDisplayer is constructed, it creates an extra
TextTrack that can never be removed. This leads to a bogus text track
showing up in the UI when content is played in src= mode.
This changes the TextDisplayer to disable the extra TextTrack (since
there is no API to remove it) and changes the Player to ignore
disabled TextTracks when generating a track list for src= playbacks.
Closes#2516
Change-Id: I2e651f737445049da5fa46a798a2bc0751de2822
When the Cast receiver throws an Error or rejects a Promise with a
non-Shaka Error, we need to represent it to the sender in a reasonable
way. Otherwise, it can be very difficult to debug.
Related to the investigation of #2487
Change-Id: Ia58dd1e1e56ee93bea9afc9d368084d53c381db3
We were leaking one PlayRateController instance per playback, with
each one running an infinite repeating timer that fired every 250 ms.
In a single run of our tests, this bug fix gets triggered 116 times.
That means we had, by the end of a test run, 116 timers with callbacks
every 250 ms. Each would have to complete in 2.1 ms to avoid bogging
down the browser's JavaScript thread.
This bug could have had a significant performance impact in the field,
depending on usage patterns, and was part of v2.5.0 - v2.5.10.
I found this by running the Karma/Jasmine tests in a foreground
browser tab at http://localhost:9876/debug.html . After the tests
completed, I hit the "pause" button in the JS debugger, and found that
this periodic timer was still running.
After the fix, pausing after the test run is complete does nothing.
There is no JavaScript executing beyond the end of the tests.
Change-Id: I87b402e733b1ccaa5e696d52d31cfe00ef12cfe0
When a mobile device goes idle, the Cast connection can be terminated
without explicitly closing it. When this happens, the Cast session is
unusable and throws exceptions.
This changes CastSender to correctly detect and recover from such a
problem by disconnecting explicitly and dispatching an Error to the
application.
This also fixes the disconnection process so that playback can be
correctly resumed on the local device.
Closes#2446
Change-Id: I59f51a1e911199eee22693e7db4ab39855de0298
For whatever reason, on iOS Safari, the 'loadeddata' and
'loadedmetadata' events don't fire until the video actually starts
to play. That is to say, until the play button is pressed or the load
method is called (or the video is set to autoplay).
This changes the src= playback to call video.load.
Closes#2483
Change-Id: I49eb119a01d88073532496b5af062bbbcfcfa9fa
In the process, this removes the in-progress flag, which should fix
issues where the storage instance can't be re-used after an error.
Closes#1432Closes#2432
Change-Id: I51018e170fb9ab262b5c70125a03d979c8ccfb08
This exception was thrown when we attempted to set up a
SegmentIterator on CEA tracks. Because they do not have their own
segments, this is not possible. The fix is to exclude CEA tracks from
this step.
Discovered while debugging #2395, but seems to be unrelated.
This bug does not affect any release versions.
Change-Id: I534b19139d88cc7ad2d6167611c04f400308a71b
In Change-Id If885e828b4761528e40abdbc601a11cf13849a1e, I fixed a
memory leak, but broke offline storage.
The fix for the memory leak was to release SegmentIndexes and
SegmentReferences when the DASH parser stops, but offline storage was
stopping the parser before making use of the parsed manifest.
This changes offline storage to keep the parser alive until after the
storage operation is complete.
This bug did not affect any release versions.
Change-Id: I88b86d250b4407cc0740d35eaf4a7ef3d5a67798
This creates a new utility used by DashParser and old offline DB
formats to combine Streams across Periods. This allows multi-Period
DASH content to be played without period-specific structures in the
manifest format, StreamingEngine, or Player. This also makes the
Tracks stable across Periods.
Closes#1339 (flatten periods)
Closes#1698 (rapid period transitions issue)
Closes#856 (audio change causes bitrate change)
Change-Id: Icb04c8e47e36eacf7ac024a5063130d85a115e54
This will be used in period-flattening, where we will need to create
segment indexes before combining Streams. Although the operation
would be synchronous for DB types, the general interface will need to
be async.
Issue #1339
Change-Id: Ibedb267118462cbaf3ca599ab6a67c8f355965f6
When period-flattening combines Streams, key ID arrays would get very
long with duplicates.
This changes keyIds in the manifest and offline structures from Array
to Set.
Issue #1339
Change-Id: I003d23e567efafa771ecd2ad597900181604ad18
This brings the field name in line with the Stream objects from the
manifest types, allowing for more general processing of Stream and
StreamDB for period-flattening.
Issue #1339
Change-Id: Ic5d0e5d69a6560d475a19f5d3ecb0b1b40b8d271
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
This removes periods from the internal manifest structure and cleans
up code and tests accordingly. This leaves us unable to play
multi-period DASH & offline streams until the main period-flattening
algorithm is completed in shaka.util.Periods.
Three test cases have been disabled for the moment.
Multi-period playback will be restored in a smaller, more focused
follow-up commit, with disabled tests re-enabled.
Issue #1339 (flatten periods)
Issue #1698 (rapid period transitions issue)
Issue #856 (audio change causes bitrate change)
Closes#892 (refactor StreamingEngine)
Change-Id: I0cbf3b56bfdb51add15229df323b902f0b2e643a
mediaElement.buffered can never be null. If nothing is buffered,
buffered.length will be 0.
The bug has been in this file since it was created in January 2019.
This affects all v2.5.x releases up to v2.5.10.
Hopefully this will address some seeking issues on Chromecast, though
that has not yet been confirmed.
Closes#1809
Change-Id: Iccc49d299cdac9fccdafdfc2d35e5b2376cff644
The Player ratechange event is a filtered version of the video
ratechange event. This is necessary because we manipulate
playbackRate as part of our buffering state management.
The UI uses this Player ratechange event to drive the playback rate UI
menu, but the event was not firing for src= playbacks (native HLS or
plain MP4s).
This fixes the ratechange event for src= playbacks, and also fixes a
small mistake in the MediaSource setup that could have resulted in the
ratechange event being triggered before playRateController_ was
created.
Closes#2488
Change-Id: If85e489d681cfbb1ae6141b490d82264e1d932bd
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
Playing content in our demo with my WiFi acting CRAZY, I found an
exception in StreamingEngine. The bad connection seems to have
exacerbated and exposed a race condition that can be triggered when
the active stream is switched during an async appendBuffer() call.
The fix is to be careful not to assume that the mediaState object is
the same as it was after the async call. If mediaState.stream has
changed, we should not manipulate mediaState.segmentIterator, which
may refer to a different Stream or may be null.
This bug does not affect any release versions.
Change-Id: I3d00009e78978cae95b47bb9f862fca4294b7b20
Live stream tests call stop() on their manifest parsers, but nobody
was calling release() on the SegmentIndex objects. This meant they
could continue to generate SegmentReference objects indefinitely.
In production, the Player releases all SegmentIndex objects. But if
some Variants had been removed due to filtering, they would never be
stopped.
By having DashParser release all SegmentIndexes it generated, we can
ensure that there are no timers running after the parser is stopped.
This bug was introduced in the master branch and has not appeared in
any release.
Change-Id: If885e828b4761528e40abdbc601a11cf13849a1e