* Document timestamp correction better.
* Add additional API details to Stream.
* Tidy-up and make comments/docs more consistent.
Change-Id: I41d873967a930634fa48c83fe65b6e9cf512d782
* 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
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
* 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
* Reject fetch() Promise in SBM if appending a segment doesn't
actually buffer the segment.
* Remove an 'assert' in Stream that was triggering for self-initializing
streams.
* Improve log messages in Stream.
Change-Id: I8c74ae24948e7a8fc2bd7539f617a7932a2b9f43
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
* 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
There should never be multiple buffered ranges, but if there are
then at least try to keep playing.
Issue #121
Change-Id: I562bdb194dcc1f66701ad1b5bb3246b4e2fbe431
Newer versions of the Closure Compiler issue warnings for several
anonymous functions due to what appears to be a failure to infer
certain types. This patch uses TypedBind to mollify the compiler.
This patch also fixes another issue raised by the newer compiler,
which is that index does not have duration and key_system properties.
b/21559591
Change-Id: Icff84ad084bfcd049f962bd4a0698b3fc78fc279
This suppression no longer works on this scope in newer versions of
the Closure compiler. In any case, making the assertions in the
class that owns those members is a better design.
b/21559591
Change-Id: I27696b3fd3c5a87bb595e5c6952ca7a523132f5f
* 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#51Closes#109
Change-Id: Ic6f0b96065d3c5dfb5c03ca1c52363bd77b22875
* Allow segments from different streams (Representations) to coexist
in buffer.
* Only fetch a single segment at a time.
* Remove id field from SegmentReference and remove SegmentRange.
* Only start the Streams once the buffer is "full".
* Stop DashVideoSource from triggering an extra resync during startup.
* Make Task.abort call order deterministic.
A follow-up patch is required to handle certain seek patterns in
live streams.
Issue #51
Change-Id: Ib7c9021471f1ed89323f19764463202b119cb491
* Remove the acceptableErrors system and replace with a status check
in SBM on request failure.
* End an SBM fetch task early on 404 or 410, but only during start
and switch.
* Retry segment fetch to recover from 404/410 errors sooner.
* Set retry delay based on segment duration.
* Remove the 'truncated' fetch mechanism and the 'pleasebuffer'
mechanism. (Retry is more robust than entering a buffering state.)
* Retry MPD requests as well. (Some live streams seem to experience
very transient 404 errors when requesting updates.)
Issue #21.
Change-Id: I2d3b838a9afe950e9ed0a91da9b952d8a30bf0a1
* The segmentNumber member in SegmentReference is used as an ID,
so rename it and update the doc string.
* Tidy up SegmentIndex unit tests.
Change-Id: I888b8cbfd6a198bab09f6ab846cbdbf70cfcaa5a
The Stream should not rely on the segment index for timestamps, since
this can be inaccurate, especially for live content.
Closes#44
Change-Id: Ie7202e04b6a96c3758541680ceed781bf6bd2ab3
* Implement an update() method on StreamVideoSource that merges
a new manifest into its existing one.
* Re-fetch and re-process MPDs from DashVideoSource to generate new
SegmentReferences.
* Compute last available segment numbers and times in MpdProcessor
when generating SegmentLists.
* Re-work Period computation in MpdProcessor.
* Handle stream EOF differently for live content.
Additional work is required to handle all "styles" of manifests.
Issue #21
Change-Id: I38be9513dc73e4683d1079b4dedb489e8206043d
Move segment metadata fetching into StreamInfo so that segment metadata
can be retreived outside of Stream. This enables other components to
access segment indexes.
Change-Id: I322bcf7cdabc7daecb5d554834275c1b6d1775ee
Checks to see if a seek is within the buffered zone or not.
Clears the SourceBuffer if seeking outside the buffered zone.
This allows the efficient indexed lookup for inserted segments to still
be used while streaming, optimizes buffered seeks, keeps the playback
timeline sane in spite of the browser's eviction strategy, and obviates
the need for an earlier fix for some other MSE weirdness.
Closes#15.
Change-Id: I0226ebb679fab6739d3d0cc071e22f434983c9d2
* Move internal non-DASH specific code into the 'media' namespace.
* Remove DASH references from generic stream code.
The documentation is not changed as a follow-up patch will factor out
DASH functionality from StreamVideoSource back into a new
DashVideoSource class.
b/18903621
Change-Id: I78d6e4f2824d4983619f17872828d95655fcfe50