* 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#139Closes#140Closes#145
Issue #172
Change-Id: I0675203931f35ca3e0dee60a87c54ba74cbdbaea
* Renamed mpd_* files to mpd_parser_* where applicable.
* Gave the mpd test groups more descriptive names.
* Split mpd_processor_spec into several files.
* Cleaned up the createStreamInfoFromSegmentTemplate_ tests.
Closes#189
Change-Id: I71daa1600e944b53937030ff87b53a3dbca3948e
* Split player_integration into several files.
* Moved some helper methods from player_integration to
integration_util.
Closes#188
Change-Id: I14cb2eda8375fc24ef0419e7993027b90e881d5b
For static content that uses SegmentTemplate + @duration, compress
the last SegmentReference so that it does not go beyond the
Period's duration.
Issue #173Closes#187
Change-Id: Ifb9404ddfe267915541c035a5d6286f63f7bc032
* Ensure AdaptationSets with different languages but with the same group
end up in different StreamSetInfos.
* Set the main flag in a StreamSetInfo if any one of the source
AdaptationSets has their main flag set (commit
689c2a47aa broke Role 'main' support).
Closes#182
Change-Id: Ia017e294e0b359c62133adc42a8d701d614f3b0d
* 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
The manifest didn't declare an XML namespace. Firefox and IE are
very strict about this, whereas Chrome is not.
Change-Id: I96fd44bb2debb974d7587603732965982681eadd
* 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
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
The underflow threshold was too small (measured 0.13s buffered during
underflow), and the minBufferTime was unnecessarily large.
Change-Id: I468a010a5f30ad64ccde8ce05d6482b02e71b9d4
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
This test has failed once in many, many, many test runs.
Add extra debugging so that we can deflake it if it fails again.
b/23226999
Change-Id: Id2f7f4b7cb535ab155c6ba35c9912f755e381c57
In several places in the integration tests it uses delay() to wait
for something to happen. Now it uses wait* methods instead. This
should make the tests less flaky.
Closes b/23226999
Change-Id: I17c4a51c4e7f3f794de5aacf5c44378fd9d9f37e
The final chunk was only being stored when the endTime of the final
segment happened to be null. An index with explicit end times for
all segments, even on one stream, would trigger this bug.
For example, the end time of the final video segment may be null, but
the end time of the final audio segment may be equal to the content
duration. The stored audio would be missing a chunk, causing the
computed stream limit to be too short on playback.
This corrects the off-by-one error in the storage code by explicitly
signalling when a segment is the last one, rather than checking for
a null endTime.
Closes#157
Change-Id: Ic99d53b9e2b071409d4d9472b8bc4ae0cf76f940
Make the Player exit the buffering state when the minimum
buffering goal between all Streams has been reached.
Closes#166
Change-Id: I09753c88e2ea998e9a794763592254a89bc35af9
Can now specify negative values for the r attribute in SegmentTimeline.
Not supported with live when used on the last element.
Issue #162
Change-Id: I7206e02f7af469a7daf1e4710befb2d102f4f979
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
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
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
* 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
Added a new class called FailoverUri which handles multiple URLs and
switches to others when one fails. This is also handles the request
itself. This replaces SegmentMetadata as well as a number of manual
requests.
The MPD parser now produces arrays of URIs rather than just one. The
MPD Processor then converts it to a FailoverUri inside the manifest.
Added unit tests to test the new functionality and updated the old ones
to the new changes.
This does not support failover on subtitles since subtitles are handled
by the browser.
Closes#68
Change-Id: I5410104827b9e4102b243444b1b5a3f01dcaf10d
The circular dependency,
ContentDatabase -> RangeRequest -> AjaxRequest -> ContentDatabase,
causes issues for the upstream Closure compiler. This patch breaks that
cycle by factoring out reading and writing operations from ContentDatabase
into ContentDatabaseReader and ContentDatabaseWriter respectively.
The following minor changes have been made to code that has moved:
* Removed retrieveInitSegment() since it's not used.
* Changed .stream_ids to ['stream_ids'] in retriveGroup().
* Reworked deleteGroup() so that it doesn't depend on retrieveGroup().
* Made deleteStream() private.
* Made minor formatting changes to meet the 80 character limit.
Change-Id: Idfc5d04ad32225a915b1531e0f4205137de5cc73
Changed the current tests for SegmentList and added new tests that
include testing SegmentTimelines.
Change-Id: I82e6429f31f396ba065aaae89bd95a1149a942ac
* Instead of intercepting specific 'seeking' events to forego stream
resync, record the particular seeks using a member variable, which is
less error prone.
* Don't rely on 'playing' events for stream resync after pause/play:
'playing' events aren't reliable; instead, just check if we need to
clamp the playhead when we update the seek range.
* Don't fire seeking events when starting the video at t=0, or when
there is no timestamp correction.
Closes#132Closes#136
Change-Id: I350ee6e9966af9f44d3e8bda4dc8297271e41855
A SegmentTimeline can appear inside a SegmentList and describes the
duration of the items in the list. A SegmentTimeline can also be
inherited from the Period or AdaptationSet. These have all been
added. Also added SegmentList support for dynamic MPDs.
Closes#88
Change-Id: I849491b1c6a5808a58c597eccfd439154e2e6ecd
The license pre-processor test was sometimes failing because the fake
LicenseRequest constructor's prototype did not define a 'send' function.
Change-Id: I029088607dd260e90e09db39ca5328b424e648e5
Multiple calls to DashVideoSource.addExternalCaptions will each
add a caption source to the object. Added unit and integration
tests for this.
Change-Id: I387d285b5d11aa345b3abefab05d633194863030
This allows an app to specify an external caption source so the captions
can come from a different source than the MPD. The method should be
called before the call to load().
Closes#133
Change-Id: I0686fd800e0fe3a73d89a71e2f374dffef905dba
* Add a URL override and an HTTP method override to LicenseRequestInfo.
* Use LicenseRequestInfo objects as dictionaries so the pre-processor
interface works like the Player.configure() interface.
* Ensure LicenseRequestInfo fields are valid after the pre-processor
is called.
* Improve pre-processor integration test.
* Add @expose to some typedefs so they are included in the documentation.
Closes#134Closes#135
Change-Id: Ia29d36d70fa661d58196d166cbc60b281c679594
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
* Reject Task Promise if one of its stages fails so that the caller's
catch handler is invoked.
* Use TypedBind consistently in affected Promise chains.
Closes#131
Change-Id: I94fa6688949444212fa0b1edd3a94e0de4d6956f
ContentProtection elements aren't parsed at the Period level,
so ContentProtection elements cannot be inherited or overridden from
Period.
Change-Id: I6155cfa89a99c78f5164e24044853ccba052014f