Commit Graph

88 Commits

Author SHA1 Message Date
Jacob Trimble d84428b42f Removed 1.6.0 deprecated functionality.
Closes #203

Change-Id: I52f72030078c2bf69f1da33fae035664ca50daca
2015-10-15 17:14:11 +00:00
Jacob Trimble 1e16366eb3 Update configuration documentation.
Change-Id: I65df78f278e5a02c81aabb03fe3c0b81ff3ed605
2015-10-13 14:49:14 -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
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 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
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 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 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 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 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
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 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
Yohann Connell 94937d7081 Changes to fix compile errors when using the upstream Closure compiler.
Change-Id: I57b4ae73bdb1980938c3a740904e18da46c6ba23
2015-08-05 15:46:40 +00:00
Natalie Harris a41e6438d6 Make setPlaybackRate behavior consistent. Closes #138.
Change-Id: I6a4be5acd37b42fb92bddc896009ae48cb92b5ec
2015-08-04 11:43:47 -07:00
Natalie Harris 3936bfafb6 Player configuration should not use static variables.
Closes #126.

Change-Id: Ib8ef19e46918276f28d6539a158517f8558867d1
2015-08-04 08:51:22 -07:00
Natalie Harris a88546f4d8 Update fast-forward and rewind to work with play/pause.
Closes #130.

Change-Id: I33ed2e2ac0014eb3b271f72904996d669b0f13ee
2015-07-24 14:21:16 -07:00
Timothy Drews c8cf08f477 Add map getter functions that check types.
These may be used to sanity check arguments coming from outside
the library.

* Use new getter functions in Player.configure().
* Add additional tests for Player.configure().

Change-Id: Ib0b907cde46aeb65ca1273fb424e3f13872fa5da
2015-07-22 16:06:41 +00:00
Timothy Drews 810ebd104d Fix getStats() race.
A 'pause' event may occur before a 'playing' event (which is
different from a 'play' event).

Change-Id: Id332492b5f0de8631bacff586ca2f17804897a0e
2015-07-20 22:42:20 +00:00
Timothy Drews 89d0ef505c Clear the buffer when switching audio streams.
* Add an optional parameter to Player.selectAudioTrack to clear
  the buffer like selectVideoTrack.

Closes #119

Change-Id: I40c4c1969115826890fe9719a988315b51e5b28c
2015-07-20 18:07:34 +00:00
Joey Parrish db01ebb53a Fix test failures caused by configure test
The configure test was setting the timeout to a very small number
and did not reset the config.

Ultimately, this should be fixed by reachitecting the settings to
avoid static variables so that settings are per-instance.

Bug introduced in issue #93
Phase one of issue #126

Change-Id: Icfae6cd425677929115878477eca26d9292d2dff
2015-07-15 16:27:48 +00:00
Joey Parrish f4d1eb2d70 Add text styling API
This API makes it easier to comply with FCC captioning rules.

Closes #115

Change-Id: I4c72fec56213d9c412b87a88ef88d30f05b02310
2015-07-14 19:28:16 +00:00
Joey Parrish f03a890fa6 Clear playback start time between playbacks
Closes #122

Change-Id: Ic36393df77c404bc958ab794af69b3cf0d5a8543
2015-07-14 12:10:03 -07:00
Joey Parrish c5f26f2013 Update VideoPlaybackQuality extern and polyfill
This updates the extern for VideoPlaybackQuality to match the externs
in newer versions of the Closure Compiler.

b/21559591

Change-Id: Id375f8722fa46f6779934e15930bd328310490d5
2015-07-13 20:56:06 +00:00
Joey Parrish 2ca10eff3a Update catch extern
This updates the extern for Promise.prototype.catch to match the ES6
Promise externs in newer versions of the Closure Compiler.

b/21559591

Change-Id: I796d8293f7be3170e465eaf3f30ceb8c9c5698b6
2015-07-13 20:54:41 +00:00
Timothy Drews 59723f10c3 Add configure/getConfiguration API to Player.
Also deprecates some existing getters and setters.

Closes #93

Change-Id: I167e6764bb26c1d37c88b7fbee4a4880181f9812
2015-07-13 20:07:13 +00:00
Joey Parrish 9ae0c1eee6 Fix linter error
Simply removes trailing whitespace.

Change-Id: I6ebec0966a0d67c1fe4a783ee044c8e283dbf9b8
2015-07-13 11:13:32 -07:00
Sanborn Hilland 7148fa7d0a Make setPlaybackStartTime comments clearer. 2015-07-13 10:10:42 -04:00
Sanborn Hilland 32a95f91e0 Remove playbackStartTime getter. 2015-07-10 17:27:53 -04:00
Sanborn Hilland 6598d64f16 Add player method to set playback start time ahead of downloading chunks. 2015-07-10 17:04:35 -04:00
Natalie Harris a04bea1f75 Remove deprecated Player methods. Closes #118.
Change-Id: I2888c3b3a2c4bf3c6cdc674af74d636495b529ab
2015-07-09 09:10:11 -07:00
Joey Parrish dddd830913 Update changelog and bump version to v1.4.0
Change-Id: Iaf47e964ffbae597382ec4bc19ed961da4dff674
2015-07-06 17:44:41 -07:00
Timothy Drews 34915527f0 Complete stream rework: refactor seek ranges.
* Move seek range updates into SegmentIndex implementations
  and StreamVideoSource.
* Remove unnecessary sub-class hooks from StreamVideoSource.
* Remove internal LiveSegmentIndex timer: do SegmentReference eviction
  and generation on demand.
* Rework Stream startup again: consider Streams as started when they
  have buffered some minimum amount of content. As part of this, only
  apply a timestamp correction to the SBM when the streams have started.
* Defer stream switches until all SegmentIndexes have been corrected.
* Partially revert optimistic "bufferedAhead" calculations in Stream:
  check if we've buffered enough content at least every second.
* Make LiveSegmentIndex more robust against a "wrong"
  @availabilityStartTime.
* Fix a bug where a positive timestamp correction would trigger an extra
  Stream resync.
* Fix a bug in evict_() where the first segment would never get evicted.
* Check stream started conditions in onUpdate_ instead of after a segment
  has been inserted.
* Tidy-up immediate/clearBuffer naming and other comments.

Closes #51
Closes #109

Change-Id: Ic6f0b96065d3c5dfb5c03ca1c52363bd77b22875
2015-07-06 14:20:01 -07:00
Joey Parrish 70e370c7eb Add Porting and Browser Support tutorial
Also:
 - removes outdated isBrowserSupported() check for Node.children
 - adds mention of polyfill.installAll() to polyfill tutorial

Closes #66

Change-Id: I8a633858d2536ecf6110aac1326f58c17ccc5672
2015-06-30 22:44:17 +00:00
Joey Parrish ccb3ed5ae3 Merge pull request #110 from ustudio/old-ie
Load without errors in IE 9
2015-06-26 09:36:37 -07:00
Natalie Harris cdb2934a0f Add trick play to the test app. Issue #54.
Change-Id: Icb90675f1f8e7409f53b5a0d9aa50ad92c1e1f12
2015-06-23 14:16:36 -07:00
Thomas Stephens 72608396da Check for Uint8Array in isBrowserSupported 2015-06-19 11:27:33 -05:00
Natalie Harris fcbf4da0c8 Update player destroy to return a promise.
I was seeing errors in the integration tests due to setMediaKeys not
finishing before the next test was started. This ensures that the
mediaKeys will be null before each new test run.

Change-Id: Iaaa9dea67b315b1a91ec83668fb0ed9ffaa3f087
2015-06-02 10:21:19 -07:00
Natalie Harris 48088130b8 Make buffering runtime-configurable.
Closes #49.

Change-Id: I954e247e83a27c5f9f2e56bb7b57c714c1d8db71
2015-05-06 21:27:49 +00:00
Natalie Harris 99e16661bf Make XHR timeout runtime-configurable.
Closes #50.

Change-Id: I812192cdcb3a272977f418c8853a052fa7f650fa
2015-05-05 10:36:59 -07:00
Timothy Drews ecc1f80279 Don't go into a buffering state while paused.
Closes #61

Change-Id: I46ce7b97b6058797ba643b77ccf72399dadc9765
2015-04-20 15:33:17 -07:00