Instead of taking Uint8Array for media segments and ArrayBuffer for
init segments, take Uint8Array for everything.
Clean-up after #1022, discovered while preparing the upgrade guide for
v2.3.
Change-Id: I1f284f6f51f345e663c06d96d788bd9cfb941c52
Our use of VTTRegion seems to be wrong. The feature in Chrome is
behind the "experimental web platform features" flag. If this is
turned on, we display subtitles in the wrong place.
Until we can verify and fix our usage of VTTRegion, we will not
use it. There are other issues to deal with in our region support,
in particular that TTML uses px and VTT uses percentages. Futher,
our VTT parser does not yet extract region information.
This fixes the main issue for v2.3, so that future releases of Chrome
do not break sites built with v2.3. There is more work to do in v2.4.
Issue #1188
Change-Id: I0de3392bdfca381c3727580e66c1a57ec457c5c2
Added a DB Upgrade path for converting content from version 1
to the version 2 format.
Issue #1047
Change-Id: Id8dc626d8289b08ca300c40b137173c0c6ec9d35
externs/shaka/offline.js now represents the data types for Shaka Player
Offline V2. All offline shaka player code uses the new version and all
V1 and transitional code has been removed.
Issue #1047
Change-Id: Ia43f8d8d11426e823629e5fcd27c4e1e0ce400d3
Changed our stores in IndexedDB to use auto increment for the keys
so that we no longer need to track current ids anymore.
Issue #1047
Change-Id: I765ba19810fce03ec8e4d968cbf8cf383355be6d
Create the pattern for how to handle database upgrades. As of this
change the only upgrade supported is from version 0 (no database).
Issue #1047
Change-Id: I9f889a9e39a190e926cf06f0720a5371bc3c59af
This change:
- Fixes the use of temporary licenses with manifests without init data
- Re-enables an integration test which was accidentally disabled
- Makes that test use a manifest without init data, to cover #1159
- Makes the test less flaky
- Reduces the minBufferTime of offline manifests, which both speeds
up load of offline content and makes the test faster / less flaky
Closes#1159
Change-Id: I3342e5112564a607f16f5d10c457a032443c57cb
Instead of storing uris for SegmentDataDB in SegmentDB, store the
actual key so that we don't need to convert back-and-forth so
often.
Issue #1047
Change-Id: I2f6d1bc1e58abd7a210097dea757d1e2fc9d4cac
Not all values need to be updated twice a second. This change modifies
the list of player getters so that each value also includes an update
frequency, and only updates that property once in that many updates.
This acts as a configurable way to ensure that some properties update
in different amounts, without having to have multiple update timers or
compose multiple update messages in the same timeframe.
Change-Id: I90e75e3e73f6c633d91b1799307ec2b15587327b
Removes a special case in serialization that is no longer relevant due
to a configuration interface that was removed for v2.3.
Change-Id: I87ed194f42c1c25d86ca45b7ac952d6a45119a26
getManifest() hugely increased the message size when casting, to the
point where we were having message size problems.
This CL stops that property from being proxied.
This also adds an integration test that makes sure update messages do not get
too large.
Closes#1128
Change-Id: I3c4bfabb4d35ee870a603c38f784cb226366a28b
We were not previously applying presentationTimeOffset in
SegmentTemplate w/ the duration attribute. This fixes the DASH parser
to correctly apply the offset in this case.
This also fixes an issue in which segment times could stretch past the
end of the period or even past the end of the presentation, causing
StreamingEngine to fail period transitions afterward.
Closes#1164Closes#1163 (PR to address 1164)
Change-Id: Ib16fc2b65117557a4ad9a05adc4a07f8bc90fd3c
Changed the storage remove API to use the offline uri instead of
the stored content as that is all that is needed to remove the
content.
Updated the demo app to remove using the Uri and not stored content.
Change-Id: I72a1049838759452eb16c78c8f1f7f4170e4e841
After a video is loaded, every time we show/hide the captions,
this.textVisibility_ is not changed. But when we load again, the new
textDisplayer uses this field to decide whether to show the caption or
not, which may make the captions and the caption button inconsistent.
Closes#1185.
Change-Id: If2ed169b9553d066f85f3d21247391efdd9aa3d4
Removed the reserve id from storage engine. Now adding an item to a
storage engine will return a promise that resolves with the id it
was stored under.
Change-Id: Id4d2c4c51a359593f1308aeb5fe580ab460ebeb8
In |Storage.store| there was download logic hidden by error handling.
This change moves the logic into its own function so that the error
handling does not hide the logic as much.
Change-Id: I3fc911573937f4543837015cf2500a1447d923ef
Since IE/Edge returns the header with a leading new line('\n'), we need
to remove it from the response.
Closes#1172.
Change-Id: I133f9cfbada6486edc438f3dcbc37c7c78dbf36c
Before, stored content always needed an offline uri. As the id
will soon not be available before saving to storage, stored
content needed a way to represent content that was being
downloaded.
This change allows the offline uri to be null to represent content
that is being downloaded. It also allowed stored content to be
created from a Manifest (for content to be downloaded) and to be
created from a ManfiestDB (for content already downloaded).
Change-Id: I3039069995f0b061112ed0c636a53ceef5673389
For some platforms and CDMs, such as PlayReady on Chromecast, there
are no key statuses. We still get a key status event, but there is
not even a synthetic key ID. In these cases, do not restrict tracks,
as that would result in a 4012 error (RESTRICTIONS_CANNOT_BE_MET).
Closes#1070
Change-Id: Ib3a853418629433cc9be491a0cf7981dd41a3f59
Isolated all progress code into functions in Storage to help abstract
progress from the storage logic.
Change-Id: I7a72c25dbd126cb4a5e682763fb1e46afa0703ef
Although DownloadManager clears the segment list as soon as it has
started the download Promise chain, the entire list is bound into the
each download function. This is subtle and difficult to address
directly.
Instead, we set the segment data to null explicitly after the segment
is stored. In this way, we are sure to only have one segment buffer
in memory at a time during a storage operation.
Note that there is no regression test to go along with this, because
ArrayBuffer memory consumption cannot be directly instrumented from
JavaScript, weak references cannot be used to track which buffers are
garbage collected, and the buffer references are bound into anonymous
functions and therefore cannot be found by exploring object
hierarchies.
Closes#1167
Change-Id: Ifeccbfb2d15a1a0243524c92e36512f9308fd5c6
When calling getStats, if there is no active stream but there is
a playhead and manifest, the player experiences a null exception.
This does not fully fix#1128, however, as there seems to be more than
a null exception at work there at the moment.
Issue #1128
Change-Id: Ic9d318a037157c2a8e28a54a857ec3a1e5797aae
When the user chooses not to show captions, we unload the text stream,
by canceling the update of text mediaState, and deleting the text
mediaState.
Since setupStreams_() is an async function, I'm adding a boolean
variable to mark the request of unloading text stream, so as to prevent
the race condition caused by quickly hiding and showing captions.
Closes#1058.
Change-Id: I554522b542bde5db037d74aa3a499d1ac0001151
This adds a single integration test for cast receiver, as well as a
framework for adding more in the future.
This particular test pauses at each stage in Player.load where the
player could theoretically be polled to compose an update message, and
waits for an update message to be polled. This should help catch any
further null exceptions in the cast receiver that prevent update
messages from being sent out.
Issue #1162
Change-Id: If24486dd821275ab674960e559bd6d10776955a7
An improved workaround for https://crbug.com/690583 and #1093, on top
of PR #1168.
If we don't wait at all, we end up trying to use the same session ID
too quickly, which causes a playback failure.
Change-Id: I8c9d1a0f09432054b862e033b80b0c2f47739c74
Before we added variants, there was no variant ids field on
StreamDB. To support legacy downloads, we created variants
for streams with no variantIds.
This change moves that conversion into DBEngine so that outside
DBEngine, streams will always have variantIds.
Change-Id: I85d050dac0b5f82fe00947380587dd7af4401dee
We do not support CSS embedded in WebVTT at this time. Instead of
failing to parse the cues, skip the style block.
Closes#1104
Change-Id: I3d500ba11afe43e81bbdef9924e4dd9e05db2b85
Configure should only switch tracks if the current variant can't be
played under the new configuration.
Closes#1138
Change-Id: I1acb8bdbb0c8b41252e978bd17ef52bec1095844
Seeking to or starting playback at the duration does not work well
across browsers. Any seek or startup time at or past the duration of
VOD or IPR content will be bumped back by a configurable amount
(default 1s).
Closes#1014
Bug: 69874888
Change-Id: I6d21ecd8e211f0f823a093b8eb8b95d329b4385f
Changed the Storage Engine interface to know about the types that it
is expected to store. This allow the implementation to do more internally
as the scope of the object has been limited.
Change-Id: I388e2bde5e7e3f99e8b28bd16e08a8f6d5fc6453
This causes the cast receiver to ignore further proxy events after
the receiver has been destroyed. This is to prevent errors after
destroy.
This is a nearly inconsequential bug; destroy is only called when
the cast receiver app is about to be unloaded, after all.
However, this change is necessary for integration tests to work.
Change-Id: I7bd9cb0f815e8f0989838c7f205e0475eb1b729b
This adds extra conformance checks:
- A ban on @expose, which we already got rid of in 775d7552
- A ban on unresolved types, which did not generate any failures
- A ban on global variables
- A more comprehensive ban on console logging
None of these caught any real bugs in the existing code base.
In one test suite (MediaSourceEngine unit tests), the compiler was
unable to determine the type of one of the mocks, leading it to
suspect that it could possibly violate the new ban on console.error.
The goog.define('GIT_VERSION', ...) line in player.js was seen
(correctly) as a global variable. This has been fixed and simplified
as a result.
The only custom conformance checks we are not using are "BanNullDeref"
(too many false negatives) and "BanThrowOfNonErrorTypes" (for which
we have our own, more restrictive version).
Since we have now tried all custom conformance rules provided by the
compiler today, this closes the associated issue.
Closes#1130.
Change-Id: Iad9040d0f5ee397c7d46b1d64bc5bebf2def57bc
On Edge & IE, the timing of "loadedmetadata" and "timeupdate" events
is different, and exposed a race condition in the fix for #1105.
This solves the race by canceling any pending "early seek" handling
once "loadedmetadata" fires.
A fix for the fix of issue #1105
Change-Id: I5587a72e12c6b28beb0b3ea36f2665a0f1e39f08
We shall not buffer live stream, when the video is paused and the
playhead falls out of the seek range.
Closes#1121.
Change-Id: I66bbe1e62017f6ae8d121f072f324763f73da0f4
Added onComplete and onCancel events to CancellableChain so that someone
creating it can invoke their own code when it is cancelled or completed.
This is needed for the work on IDestroyable.
Change-Id: I5c274356e952ecbd43dd5e8809a6d4cb4e5e85c5
There are two ways Playhead should be able to recover from a drifting
stream:
1. Wait until the initial position is available
2. Seek to another position
Neither of these was working. For one, we couldn't detect seeks
before content was loaded. For another, we were constantly updating
the initial streaming position, so a drifted stream would never catch
up to our expectations.
This fixes both issues so that a drifting stream can at least recover.
Relates to issue #999 (drift tolerance)
Closes#1105
Change-Id: I8d2eedcff25b92b42ecd2e1f361d45ecbddd26ba
Before, segments required knowledge of the manifest and stream to
be created but that information was never used. This change removes
that information from the segments and breaks the circular dependency
between manifests, periods, and segments.
Change-Id: I94064220dd8e3693ff69f5c9100ec1b91aa3c34d
getVariantTracks and getTextTracks both check values on
player.playhead_, but don't check if the playhead exists beforehand.
This leads to problems when casting an encrypted asset; the cast status
update will check getVariantTracks and getTextTracks before the
playhead exists, and the error will make the status updates stop
coming.
Issue #1128
Change-Id: If38e586b1ea3006c01d3556216f5333d9eaf6e17
This also changes the tests so they mirror the |video.seeking|
property to reveal the problem that change created. That change
broke seeking into gaps and gaps before the start.
Issue #1149
Issue #1150Reopens#1061
Change-Id: I18fb65b1529acdacd0becd77078780625e0a955b