Commit Graph

1889 Commits

Author SHA1 Message Date
Joey Parrish e23bfb3a24 Update manifest parser tutorial
Issue #1183

Change-Id: Ic16e84f98cb45f2ecbba6da985f310e8f55b6b42
2017-12-20 03:02:52 +00:00
Joey Parrish 3f65d1c8a7 Update plugin tutorial
Issue #1183

Change-Id: If7024cbfabb7d85299162cb6488b5f44ed07febd
2017-12-20 03:02:52 +00:00
Joey Parrish 62e77876fa Update offline storage tutorial.
Issue #1183

Change-Id: I0ac267b2c620b9d28c3cf4a28c103e8ef772c368
2017-12-20 03:02:52 +00:00
Joey Parrish a17e904261 Add upgrade guide for v2.2 => v2.3
Issue #1183

Change-Id: Ib933603dd5ea35e1aa2c600970ce71a9a0a37b2e
2017-12-20 03:02:52 +00:00
Joey Parrish cbdbfbdec7 Update changelog for v2.3
Issue #1183

Change-Id: Ia25fba9e5f8149c12f55a8486ca3eb6bcd4131ea
2017-12-20 03:02:52 +00:00
Joey Parrish 42cc9015a5 Update changelog for v2.2.9
Change-Id: I0307d8f62c1156a96b1ec6b008a6d5529138e541
2017-12-20 03:02:52 +00:00
Joey Parrish 186e3e69c4 Consistently take Uint8Array in text plugins
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
2017-12-19 22:29:43 +00:00
Aaron Vaage c78e4a258b Close Database After Upgrade Test
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
2017-12-19 09:56:36 -08:00
Joey Parrish 66bfa31538 Do not use VTTRegion yet
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
2017-12-18 22:39:20 +00:00
Joey Parrish cd04cca269 Update config tutorial examples
Issue #1183

Change-Id: If3f9eb587c87babe7a8b43b5ced7d1b80205b1c1
2017-12-18 22:14:42 +00:00
Joey Parrish 1f58664d6b Update architecture diagrams
Issue #1183

Change-Id: If68b6aca71cb09756af2bbb0836c381397741508
2017-12-18 22:14:42 +00:00
Sandra Lokshina 2b920e228f Add role selection to the demo app
Closes #967

Change-Id: I3a83a85b327901a6ab071b355e6cd890a13d7550
2017-12-18 11:31:17 -08:00
Aaron Vaage 1cf0a38843 Support Upgrading from Version 1 to Version 2
Added a DB Upgrade path for converting content from version 1
to the version 2 format.

Issue #1047

Change-Id: Id8dc626d8289b08ca300c40b137173c0c6ec9d35
2017-12-18 19:04:04 +00:00
Joey Parrish 4372d482b2 Update FAQ
Issue #1183

Change-Id: I1830b1343b11567643ef1994113265c037662701
2017-12-16 10:41:44 -08:00
Aaron Vaage 967f339934 Mark Version 2 of DB Engine
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
2017-12-16 00:11:04 +00:00
Joey Parrish f4d89cb5a1 Quick fix for Player unit tests
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
2017-12-16 00:10:03 +00:00
Aaron Vaage cbaefcf475 Use Auto Increment For IndexedDB
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
2017-12-14 15:47:31 -08:00
Aaron Vaage 14e6b3a230 Create Upgrade Pattern
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
2017-12-14 14:53:48 -08:00
Aaron Vaage 80c5fff4b2 Create DBUtils
Create DBUtils to hold code that will be useful to updating code
outside of DBEngine.

Issue #1047

Change-Id: If759fd0d778f42e6114e82e9274a053af420ad35
2017-12-14 22:51:55 +00:00
Joey Parrish 4ce963415e Fix offline storage with temporary license issues
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
2017-12-14 21:36:08 +00:00
Aaron Vaage c927300045 Store keys instead of uris in DB objects
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
2017-12-14 21:34:49 +00:00
theodab 8ed316d3c2 Reduced frequency of some getters on cast updates
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
2017-12-14 21:02:48 +00:00
Joey Parrish e97a93d396 Drop cast serialization special case
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
2017-12-14 10:28:10 -08:00
Aaron Vaage 46685fbd15 Moving Offline Uri
Moving offline uri code to avoid an upcoming circular dependency in
the upgrade code.

Change-Id: I952386f17c6d4e7806d97e2f540887b915f68de7
2017-12-14 00:00:23 +00:00
Aaron Vaage b8e0f8028d Do not allow null array buffers in offline segments
Do not allow a segment data object hold a null array buffer because
it should never happen.

Change-Id: Id80a5a7558ccee6aa5533a280edbe951c94e1afc
2017-12-14 00:00:11 +00:00
theodab 31b2984f6b Stopped proxying getManifest()
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
2017-12-13 22:16:30 +00:00
Aaron Vaage e7c5a3a8aa Fixed DBEngine Test Failures
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
2017-12-13 21:44:55 +00:00
Joey Parrish b08ea87f7e Add support for legacy avc1 codec strings
Closes #1186

Change-Id: I87c24ee28f2c83b392a1887e77b9f2110953ef11
2017-12-13 11:37:59 -08:00
Joey Parrish 2e5b856f79 Do not require EXT-X-MEDIA-SEQUENCE in HLS live
Closes #1189

Change-Id: Iae6f4f4524bb9895f8b211491793cf7626661a5d
2017-12-13 18:49:03 +00:00
Joey Parrish 20750504fe Fix presentationTimeOffset in SegmentTemplate
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 #1164
Closes #1163 (PR to address 1164)

Change-Id: Ib16fc2b65117557a4ad9a05adc4a07f8bc90fd3c
2017-12-13 18:46:28 +00:00
Joey Parrish e669ad75ba Fix compiler renaming of destroy() on TextDisplayer
Includes an integration test that reproduces the issue.

Closes #1187

Change-Id: I15233fadcdadad8bd79dcad1fd2f1569d8de56f3
2017-12-12 15:38:20 -08:00
Aaron Vaage 3399292d49 Changed Storage Remove API
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
2017-12-12 22:12:56 +00:00
Michelle Zhuo 852f298992 Keep textVisibility and textDisplayer's textVisibility consistent
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
2017-12-12 21:57:23 +00:00
Aaron Vaage dff382b9a3 Remove reserve id from StorageEngine
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
2017-12-12 13:28:33 -08:00
Aaron Vaage b53f5a0816 Isolate download logic from error handling
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
2017-12-12 12:43:54 -08:00
Michelle Zhuo d221339326 Remove empty lines in response header
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
2017-12-12 18:03:01 +00:00
Aaron Vaage 8f45f7939d Changed Stored Content to not always need an offline uri
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
2017-12-11 23:21:12 +00:00
Joey Parrish 8351095ac4 Do not restrict tracks when 0 key statuses are known
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
2017-12-11 22:19:00 +00:00
J. Oliva 58caec4341 Remove duplicated mime types (#1181) 2017-12-11 11:57:57 -08:00
Joey Parrish bc7b56d971 CastReceiver integration cleanup
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
2017-12-08 14:43:55 -08:00
Joey Parrish 5c364df655 Fix CastReceiver integration tests on Chromecast
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
2017-12-08 22:43:06 +00:00
Aaron Vaage 6a03ceb30f Isolate Progress Code
Isolated all progress code into functions in Storage to help abstract
progress from the storage logic.

Change-Id: I7a72c25dbd126cb4a5e682763fb1e46afa0703ef
2017-12-08 21:17:20 +00:00
Joey Parrish 0a59da4146 Free segment memory after storage
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
2017-12-08 12:12:47 -08:00
theodab bc5d309607 Fixes another null exception in cast receiver
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
2017-12-07 22:05:15 +00:00
Aaron Vaage 834d960f88 Use Manifest Duration for Offline Manifest Duration
Use the duration from the original manifest as the duration for the
offline manifest.

Change-Id: I1b31888ecf25126e4a4794f73ea3aeaf101e5820
2017-12-07 21:38:43 +00:00
Aaron Vaage 540e533e69 Correct comment in DBEngine Tests
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
2017-12-07 18:44:00 +00:00
Michelle Zhuo 41ad98a99f Cancel text mediaState's update when not showing captions
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
2017-12-07 18:30:18 +00:00
theodab 5f612bd1d3 Added an integration test for cast receiver
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
2017-12-06 13:45:17 -08:00
Joey Parrish 3913134c72 Update changelog for v2.2.8
Change-Id: I4c53cdd2629c1b68a42cc319f41f7c34719e0de5
2017-12-06 18:19:33 +00:00
Joey Parrish 8c80b6cefa Wait for close(), but timeout after 1s
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
2017-12-05 16:47:54 -08:00