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
On Safari it seems that deleting a database that was opened in a
previous test causes the delete call to hang. This makes sure
we close the database after each upgrade test.
Change-Id: Ie98a13515bd071cef044ee862f86d8a1a1050548
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
The player unit test setup creates a fake StreamingEngine, which
responds to a request for the current period by returning a value
captured in an anonymous function.
Because of this, any test which loads a manifest other than the
"var manifest" at the top will result in inconsistencies between
the current period known to the fake StreamingEngine and the manifest
loaded by the Player instance.
This makes sure all tests in this file are using the same "var
manifest", even if they overwrite it.
This is not the best fix. The Player unit tests should be
restructured so that the fake StreamingEngine is always consistent
with the Player instance it belongs to.
Change-Id: Iad3b61006de3dcf902334f5348cd51fe7b5f8db4
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
It looks like some browsers don't do equality checks on ArrayBuffers
the same way as others. So to fix this, we checking that segments
are the same, convert each ArrayBuffer into an Uint8Array.
Change-Id: Iceb6e39e326ced4e86c52968e364bf927116c250
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
Clean up several small things in the new integration test:
- Do not use the _compiled suffix in test streams, since this test
does not run against the compiled version of the library
- Append the video element to the document
- Set up wrappers in the order in which they will execute
- Send the init message only after all other setup is complete
Change-Id: I62488474e83c44923ace9c533449794d62bc0f6f
Because we mocked out canDisplayType to return false, and because that
is actually used on Chromecast in the MediaSource polyfill, this
caused the receiver integration test to fail with
CONTENT_UNSUPPORTED_BY_BROWSER. Because nothing was listening for
errors, this error was shown only as a timeout.
This fixes the mock and listens for errors.
Change-Id: I05a62c439666cfe1a282aa523a75e362e1674a4b
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
The code in the DBEngine tests were updated but the comment explaining the test
did not get updated. This change corrects the comment to match what the test
is doing.
Change-Id: I56b290c375f15eb2fba70634d1c7d4ab841af1fe
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