Commit Graph

196 Commits

Author SHA1 Message Date
Jacob Trimble 5637962073 Offline now doesn't use data URI for init data.
Also now uses the same ContentDatabaseReader for offline segment
requests.

Change-Id: I9cebc90b46ca9067467a8a343d48b264abc7cf26
2015-10-19 23:10:22 +00:00
Jacob Trimble d84428b42f Removed 1.6.0 deprecated functionality.
Closes #203

Change-Id: I52f72030078c2bf69f1da33fae035664ca50daca
2015-10-15 17:14:11 +00:00
Joey Parrish 3a552b808f Remove Uint8ArrayUtils.key
These keys cannot always be used as keys, for example on IE11 where
very large init datas are found in PlayReady content.  Since there
should not be a large number of unique init datas, a linear
suppression pass and a quadratic removeDuplicates should not be a
problem in practice.

Related to pull #176

Change-Id: I9dd9b5e45422544c86dd95686766625a0b336963
2015-10-14 18:09:07 +00:00
Jacob Trimble 1e16366eb3 Update configuration documentation.
Change-Id: I65df78f278e5a02c81aabb03fe3c0b81ff3ed605
2015-10-13 14:49:14 -07:00
Jacob Trimble ed33ef958f Uses correct buffering goal when re-buffering.
Closes #190

Change-Id: Iee663056ce221e8388b9e6bd7b78f587c8ed0191
2015-10-13 11:32:05 -07:00
Jacob Trimble f346ece22c Improve live end-of-stream behavior.
* Supports live streams of a fixed length.
* Live streams that stop now correctly end the video.
* Only uses local MPD when @availabilityStartTime is in the future.
* Added configuration option liveStreamEndTimeout.

A live stream is considered "ended" when the play-head moves past
the last segment for liveStreamEndTimeout amount of time.  This allows
the MPD to be updated with new segments.

Closes #139
Closes #140
Closes #145
Issue #172

Change-Id: I0675203931f35ca3e0dee60a87c54ba74cbdbaea
2015-10-13 18:00:01 +00:00
Jacob Trimble ee872017ed Added 'app' error type.
Change-Id: I1c56d875ec92291af408a10e01e7d2c8fae24749
2015-10-07 22:28:24 +00:00
Timothy Drews 6bbdad3156 Improve internal docs for VideoSource and Stream.
* Document timestamp correction better.
* Add additional API details to Stream.
* Tidy-up and make comments/docs more consistent.

Change-Id: I41d873967a930634fa48c83fe65b6e9cf512d782
2015-10-07 21:26:13 +00:00
Joey Parrish bb0e21aaa4 Fix typo
Change-Id: I26c05e0fa9aa093156fb1608f67128d9b1855ff6
2015-10-06 16:57:24 -07:00
Jacob Trimble 5dd6a513ac Does not clamp seek start with buffered live content.
Closes #141

Change-Id: I9b6b574306435c7c0087d72c9da7e88711a840ed
2015-09-30 11:18:41 -07:00
Jacob Trimble e4603b1c4a Re-Process MPD when availabilityStartTime reached.
When the availabilityStartTime is in the future, the
StreamVideoSource will re-process the local MPD once the
availabilityStartTime passes.

Closes #172

Change-Id: I1432ae06fbff6c4978ed93bc51263f7cac37e136
2015-09-29 22:39:19 +00:00
Jacob Trimble f750207444 Improve error reporting with OfflineVideoSource.
* License errors in store() are reported as a failed promise.
* store() cleans up after errors.
* Added argument to deleteGroup to ignore session errors.

Change-Id: I8030d89a7f99cabb6ecb7840a854a0452a2f2ef2
2015-09-25 14:03:37 -07:00
Jacob Trimble 9b50f2ad94 Deleting offline content now deletes persistent session.
Closes #171

Change-Id: Ia0ff2c9892f53c2ceeddb2b589e2e2c886aea54a
2015-09-24 22:05:01 +00:00
Timothy Drews b962c81e82 Improve key status error reporting.
* Give key status errors type 'drm' for both DASH and HTTP.
* Include the EME key status code for HTTP for testing
  purposes.
* Make error reporting between DASH and HTTP more consistent.

Change-Id: I8c42dbf08257cc88c6e089d817f55f0caa575473
2015-09-24 20:46:57 +00:00
Timothy Drews 0ee549727a Bump version numbers for v1.5.0
Change-Id: Ifcf55b95091763f18f652dadc03f2d37f986c072
2015-09-17 14:41:12 -07:00
Timothy Drews 5e84b9bd39 Fail gracefully when all tracks are restricted.
* Fire an error event when all audio/video tracks are restricted
  during playback.
* Fire an error event and fail gracefully when all audio/video tracks
  are restricted before playback (requires calling player.unload() when
  the VideoSource's attach promise gets rejected).
* Rework AbrManager so that getInitialVideoTrack() can be called before
  starting bandwidth monitoring.

Closes #170
Issue #179

Change-Id: I4ac6cdf2a4c862e0d0560dff2f2d7bb6801bbc38
2015-09-15 21:12:39 +00:00
Timothy Drews 104e746ff4 Fix 'usable' key detection.
getKeyStatusErrorMessage() may return null (not undefined).

Change-Id: Ie2cbb942661e825d5421bb29672fc4f2bffdf6cd
2015-09-14 16:22:28 -07:00
Timothy Drews 6049d67804 Re-allow pausing while rewinding.
This fixes a regression and adds more integration tests.

Closes #130

Change-Id: Idd386931ae6d9f37052f24438ebcba10774e3451
2015-09-11 13:09:29 -07:00
Timothy Drews 35d4c5ec20 Only apply restrictions to video tracks.
Closes #179

Change-Id: I5ef1167903b98840ce2d9d031d99845269e9e1d4
2015-09-10 13:08:23 -07:00
Timothy Drews d0b8c68b04 Skip unknown keys in compiled mode too.
If the key was not specified in the manifest then it should always
be skipped.

Issue #174

Change-Id: Iad31203967c5e0380b85e49075d4d2523e042a9b
2015-09-08 15:04:41 -07:00
Timothy Drews 1c47e1e09b Add license pre/post processing tutorial.
Closes #137

Change-Id: I092a6152d8c9c2f3809f3ef27e237c06ff0a6490
2015-09-08 21:49:03 +00:00
Joey Parrish 4cc4e96dbd Overhaul license comments and file annotations
* Updates all Copyright years to 2015.
* Adds licenses annotations to all JS.
* Makes all licenses identical to avoid repeated appearance in the
  compiled output.
* Drops fileoverview annotations, which do not affect docs output.
* The linter still requires fileoverview on externs.

This patch required a newer closure compiler, since the previous
version we used had a bug regarding license annotations that caused
the license comment block to appear in the output once per file
regardless of uniqueness.

Change-Id: I2e9272db680cba7ecc4613d97f1d3a94ac2244cc
2015-09-08 12:02:34 -07:00
Joey Parrish 4d9177240a Revert "Adding license annotation to js files."
This reverts commit 8cb24652cb, due to
the fact that the new annotations caused our binary size to jump
by 52%.

The compiler preserves all 'unique' licenses, which causes trouble
since the comment blocks with the license annotations are not unique
and contain file overview comments as well.

We can re-examine this once we have restructured the license headers.

Change-Id: I418e407a0e0253630633697f30cf496a7fc2ddfc
2015-09-04 18:36:39 -07:00
Yohann Connell 8cb24652cb Adding license annotation to js files.
Change-Id: Id10592ccaf35608ac4f01844cae2fec4a2030d65
2015-09-04 00:05:17 +00:00
Timothy Drews 4aef840881 Make configure docs consistent.
Also exports the shaka.player.Defaults docs.

Change-Id: I8ba66ac181f234ff621045e8577d0f4f9ba5f9a6
2015-09-03 18:25:29 +00:00
Joey Parrish 57495735a0 Fix load of encrypted offline content
Allows blank license server URLs for offline playback and marks
loaded streamInfos as usable by the key system.

Change-Id: I67f346729e55bb661fdefa554876642bab951ac7
2015-09-02 00:14:41 +00:00
Timothy Drews 2167dfbf90 Clone StreamConfig DrmInfo instead of mutating it.
Change-Id: I89b7563341f79f85e3e618aa534bc3f1d117f0a5
2015-09-01 23:05:30 +00:00
Joey Parrish 36e121b859 Support rewind outside of buffered area
Closes #165

Change-Id: I684560b332808f9acffcfc09ad8fffcd8c164fba
2015-09-01 21:56:42 +00:00
Joey Parrish 60491b4080 Deflake rebuffering test
The underflow threshold was too small (measured 0.13s buffered during
underflow), and the minBufferTime was unnecessarily large.

Change-Id: I468a010a5f30ad64ccde8ce05d6482b02e71b9d4
2015-09-01 16:46:14 +00:00
Joey Parrish 39be45d3d5 Shrink no-offline build
There was a static method on OfflineVideoSource which forced the
compiler to keep ContentDatabase in the build.

This fix increases the savings for a no-offline build from 488 bytes
to 9592 bytes, an increase in savings of 19.6x.

Change-Id: I24816e83249da9aef7ace07886723575ad4f23b5
2015-09-01 16:45:39 +00:00
Joey Parrish 97769bd413 Clean up exceptions on Player.destroy()
This introduces a new method on PublicPromise called destroy(),
which does for Promises what destroy() does for the other classes:
shuts down async processes and cleans up references.

In addition to catching errors and shutting down more cleanly in a
wider array of circumstances, this may also help with GC, since we
no longer leave pending Promises around with handlers attached to
them.

Closes #151

Change-Id: I205c5979418fbc18cd7e35d91d0de2746f337137
2015-09-01 00:16:05 +00:00
Timothy Drews 689c2a47aa Use 'keystatuseschange' events and support @group.
Use 'keystatuseschange' events from EME together with cenc:default_KID
from the MPD so StreamVideoSource can determine if the key system
can/will decrypt a stream before it attempts to play it. This enables
the Player to safely (and automatically) switch between streams that
are encrypted with different keys.

Support AdaptationSet @group, which is the preferred approach to safely
use multiple encryption keys over multiple Representations.

* Squash AdaptationSets from the same group into one StreamSetInfo.
  This enables support for @group without introducing special case code
  into StreamVideoSource and EmeManager.
* Fire 'trackchanged' events when tracks becomes available/unavailable
  either from application restrictions or key status changes.
* Pull key IDs out of DrmInfo and put them into StreamInfo so key status
  changes can drive per stream availability instead of per StreamSet
  (AdaptationSet) availability.

Closes #67
Issue #160

Change-Id: Ife0814deb65715923a572b45880137a99b378035
2015-08-31 23:13:17 +00:00
Timothy Drews 22ac026802 Improve DrmInfo documentation.
* Further clarify DrmInfo documentation and provide basic examples for
  license pre/post processing.
* Update the tutorials to use DrmInfo instead of DrmSchemeInfo.
* Use @exportDoc instead of @expose where applicable.

Issue #137

Change-Id: I9e931623a137004566123073447ccd71d8532e38
2015-08-31 18:22:35 +00:00
Joey Parrish 419f26a486 Fix loading of clear offline content
This was broken during the DrmInfo refactor.

Issue #71

Change-Id: I5fb02cfa1723cf7bceaa5f84ba0d7d3ef51f2bdf
2015-08-26 22:25:21 +00:00
Timothy Drews 150fdd49c9 Align buffering conditions w/ buffering goals.
Make the Player exit the buffering state when the minimum
buffering goal between all Streams has been reached.

Closes #166

Change-Id: I09753c88e2ea998e9a794763592254a89bc35af9
2015-08-26 20:05:38 +00:00
Timothy Drews 49e34bce2d Create SourceBuffer objects in SBM.
* Create SourceBuffer objects in SBM instead of StreamVideoSource.
* Apply timestamp offsets in SBM.fetch(), which allows for different
  streams to have different timestamp offsets.
* Improve log messages in SBM by using MIME type information.

Change-Id: Ibad7c91fa5937e053db84b8e2d6e71957652ddc2
2015-08-25 23:12:20 +00:00
Jacob Trimble 603fae9695 Added disable live build option.
A new build option --disable-live added to disable the ability to
play live content.

Issue #116

Change-Id: I35876f51bddc3689d60ff6dc1b736d74c8ed4f80
2015-08-25 14:29:51 -07:00
Jacob Trimble 8fc33a5122 Network callback now called for MPD requests.
Closes #148

Change-Id: I20455ca1f17d4172f2f3019fa3e23c2f163d18e9
2015-08-25 21:25:48 +00:00
Timothy Drews dc008cc6cf Parse the default_KID attribute.
Issue #67

Change-Id: I7df48dcad94823b2937b3bc88a0d5d9c6087edc5
2015-08-25 18:33:22 +00:00
Timothy Drews 0a6baab9db Improve Stream docs; rm minBufferTime from switch.
* Make IStream more precise by adding more documentation.
* Make misc. docs related to Stream more consistent.
* Remove |minBufferTime| from IStream; use a configuration
  option instead.

Issue #147

Change-Id: Ie6261ced49a8f815d270e0ee94af5dc40acff63f
2015-08-24 13:44:48 -07:00
Timothy Drews 1c58dee0c2 Add new ContentProtection interpretation API.
Add new ContentProtection interpretation API that allows applications to
return multiple DRM configurations for each ContentProtection element
and to parse raw ContentProtection XML elements.

This patch deprecates DrmSchemeInfo in favor of DrmInfo. Furthermore,
DrmSchemeInfo will be removed post v1.5.0.

* Replace DrmSchemeInfo with DrmInfo.
* Move Restrictions class definition into its own file.
* Populate initData values from explicit PSSHs without application
  intervention.
* Allow explicit PSSHs to differ between Representations

Issue #71
Issue #137
Closes b/23428584

Change-Id: Ib8d6ba630b930ee64f923a3f4a3e518abacccf88
2015-08-24 10:41:41 -07:00
Jacob Trimble e74ad98eaa Added setNetworkCallback method to dash and offline video sources.
This allows the app to intercept media requests to modify its URLs.
The callback accepts the URL for the request and returns a modified
URL or null to use the original.

Closes #148

Change-Id: I08352754ace05f318706fd93910097c0fa7696f0
2015-08-24 09:35:27 -07:00
Sanborn Hilland b45a7dff33 Correct typo in getAdaptationEnabled causing it to return undefined 2015-08-20 17:33:21 -04:00
Timothy Drews f5c4eb1667 Improve end-of-stream behavior.
For static content, if the playhead moves to the end of the video then
either the video should pause or loop. Before this patch media timeline
misalignment and buffering detection would sometimes prohibit this from
happening.

* Ensure the MediaSource's duration is >= the end of each
  stream's last segment (both before and after timestamp correction).
* Use an append window to keep the MediaSource's duration constant.
* Rework Stream startup so that the MediaSource can be modified
  safely during timestamp correction.
* Remove timestamp correction member variables from StreamVideoSource.
* Fix buffering detection when there are no buffered ranges.
* Add sanity checks and improve logging for debugging MSE issues.
* Improve Stream startup documentation.

Closes #155

Change-Id: I6f7a1d15240af62a2282f3f62b29cd3acd5b1873
2015-08-19 09:30:00 -07:00
Timothy Drews 4d2a26d33a Make VideoSource configuration more consistent.
Make VideoSource configuration more consistent by treating
bitrate adaptation, content restrictions, and preferred
language as configuration options.

Change-Id: I761311dc806b5af8153875b654fc62ca9fd53234
2015-08-17 22:20:50 +00:00
Jacob Trimble e0e6621d21 Changing the text track now fires AdaptationEvent.
Closes #147

Change-Id: Idd57ada8155273db50f422096f2d40b8bce38230
2015-08-17 20:54:02 +00:00
Timothy Drews 9070446915 Export StreamVideoSource.get*Tracks methods.
This permits offline on the demo page in compiled mode.

Change-Id: I4901370b5c5614e13220d06a751c6b695c341a6c
2015-08-17 20:33:28 +00:00
Jacob Trimble 671611ef37 Added build options to disable unneeded features
build.sh now accepts several arguments that will  disable features
that will not be needed.  The default is to include all features.
Part of #116.

--disable-offline
--disable-dash
--disable-http

Change-Id: Icdaf82b322debbdc1e898e93c539e35894678a8d
2015-08-14 15:58:00 -07:00
Timothy Drews 97809a008a Rename RangeRequestTimeout opt. & fix unit convs.
* Rename the RangeRequestTimeout option to SegmentRequestTimeout
  since the RangeRequest class no longer exists.
* Fix a few unit conversion errors between seconds and
  milliseconds and vice versa.

Change-Id: I8695c3bfb79ae0e20ec5bc75d9ae9f941bccd023
2015-08-13 16:41:27 +00:00
tdrews 7d308a15db Merge pull request #144 from blinkbox/pull-request/clear-buffer-on-switch
Optional offset param to IVideoSource.selectVideoTrack for partial buffer clear
2015-08-12 09:45:45 -07:00