Also avoid fetching manifest updates when minimumUpdatePeriod is
missing. In the absence of minimumUpdatePeriod, just reprocess
the MPD we already downloaded.
Closes#69, #70.
Change-Id: I138bf136e5b0d691d9d625bbad02fb07ae21d32f
minBufferTime is hard-coded when reconstructing manifestInfo
from offline. This is needed to prevent failing assertions
during playback. 5 was chosen because it is large enough to
keep playback going properly and small enough that the buffered
data won't get garbage collected.
Change-Id: Iabb08137bda95d15f35a5e5f6386c0be321de7fa
Only install a getter for fullscreenElement if the property does not
exist. Previously, we installed the getter if the property existed
but was null.
Change-Id: Ibea5bc63a75a98cd1d50c56ca99fac2aa38e449b
If the user's preferred audio language is missing, and there are no
subtitles in the user's preferred language either, do not enable
subtitles by default.
Change-Id: I57e7ba3679758bbd0e8f460767913d090d0d5630
* Wait to move the seek end time until all the streams have
started so that the playhead starts at 00:00.
* Only fire 'seekrangechanged' events after the streams have
started so the seek range doesn't jitter (caused by timestamp
correction).
Change-Id: I82f90d896d124c7bb49580100d9592948a358935
* 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
Underflow is now possible before the playhead enters a gap in the
buffered ranges. Some misbehaving live content freezes with as much
as 50ms of data still buffered, so going into an underflow/buffering
state with a positive amount of buffered data is desirable.
To keep this from causing trouble at EOF, there is a special check
against video.duration.
Change-Id: I5a350c543fe33910a55cd8e9ebd8fd1ab2d6408c
Since a task stage is asynchronous, some async part of it may need to
call end(). Because of this, we cannot realistically know if the
caller is part of the stage or not.
Change-Id: I2a31515b9a4c6dd1bf246079fb42effe7a2da622
Instead of always replacing the currentTime, only replace starting
at the currentTime for immediate switches. Otherwise, use bandwidth
estimates to guess what the video currentTime will be when the new
segments have been fetched, and replace the old segments starting
at that point.
Relates to #51.
Change-Id: I0e8546402cb0f7a007a6c210ed3b215c8379e236
Instead of measuring switch time for non-immediate switches, measure
for all switches in non-compiled mode. Switch latency for non-
immediate switches is a much looser metric, but still useful for
debugging and performance testing.
Change-Id: I0cf83aa016406569d5bb3ce86387bdaab3fe0038
Strip extraneous minBufferTime copies.
Default minBufferTime in MpdProcessor if missing.
Pass minBufferTime as a parameter to Stream.start().
Keep a buffering goal separate from minBufferTime, which will only
be used for stream startup (as intended by the DASH spec).
This allows us to startup quickly and still buffer ahead.
Relates to #51.
Change-Id: I94b6b2566419344fa761ff75b0884719f255cd66
This reduces flakiness around inaccurate delay() calls.
Also:
* Changed some tests to avoid a playbackRate race.
* Reduced the playback rate in one test to improve stability.
* ...?
* Profit!
Change-Id: I452f6eb3b7f331c973a8d20b436ecab2b5576f21
* Export FakeEventTarget so IBandwidthEstimator implementations
can use it.
* Expose IBandwidthEstimator methods so they do not get renamed
in compiled mode.
Change-Id: Ib4c58d2357afdf402482202dc9fb8cf42dbbfad1
Running the watchdog timer all the time and inhibiting its function
during certain states, as opposed to starting and stopping it on
various events, improves stability and reliability.
This fixes some corner cases and bad interactions with various live
streams.
Change-Id: I0dfdcc54dc0d11eb1f313971e5fabb5ed606b139
Fix a number of error cases which caused failed assertions
and erratic behavior.
* Handle EOF in resync().
* Handle aborted clear() in resync().
* Ignore 'seeking' and 'play' events from onStreamsStarted().
* Handle empty SegmentIndex in setTargetUpdateTime_().
Change-Id: Ia1fafff068cae238eaeca0cee06391a3a837514a
Update the currentTime UI while dragging the seek bar.
Defer seek-bar-initiated changes to avoid spamming video.currentTime
with seeks.
Change-Id: I8f8f6e52d05f4b94d671e30ab7423014bcbb8e13
This interfered with key rotation, and was not widely used. Removing
the feature is the more general approach, and the worst that will
happen is that some applications will see more sessions than they
strictly need.
Change-Id: Ide2238433af296e729e4401711672fb17257093e
I should not have used "this" inside an anonymous function.
Converted this.references_ to a captured variable.
Change-Id: Ifc191c35aceac25e69b1de267688f91d4f66badd
Use Stream.BUFFER_SIZE_SECONDS_ on startup.
Improved the way adaptation latency is measured.
Avoid calling abort() twice during adaptation.
Reduce the size of the Promise chain slightly.
Merge the SPLICING state into SWITCHING.
Change-Id: Ie06e6c56df4df17e7acb379d0e19f639f791c99b
Since SegmentTimeline streams may not have segment numbers, we should
not use segment numbers as reference IDs. These IDs must be unique
for the buffering and streaming systems to function properly.
This also adds assertions to check that reference IDs are unique.
Issue #21.
Change-Id: Ia94a48c68149283f87d27c6595a4f5a6cca07a27
If an event handler throws an exception, this should not affect the
caller of dispatchEvent. This corrects FakeEventTarget's behavior to
more closely resemble EventTarget, and makes many of our asynchronous
processes more resilient to errors in application-level handlers.
Change-Id: I41202aa24650ebdba3310f20864568eea32b74ce
A SegmentIndex only provides an approximation of its media timeline. The
differences between the two can be particularly problematic if the
SegmentIndex is "behind" its media timeline, as such an offset may cause
the stream to get stuck during startup.
* Correct each SegmentIndex using timestamps in the actual segments.
* Make hasStarted() return true only after the Stream fully initializes.
* Adjust the seek range after computing a timestamp correction.
* Set timestampOffset for all types of SegmentTemplate based manifests.
* Remove PTO rounding, which is not required with timestamp correction.
* Only attempt to resync Streams after all streams have started.
Change-Id: Id03c38826d07513d8f451029ffc9d891854c19df
* Only fallback to 0 for the earliest timestamp if there are
no segments.
* Don't allow the best timestamp to be less than the earliest
timestamp.
Issue #21
Change-Id: Ie4df6e36d60adc0ee0dfc54dcbefef7ae0de2705
The BUFFER_SIZE_SECONDS_ parameter should be used only as a sanity
check in case the MPD specifies a tiny minBufferTime or none at all.
Having a large value meant that we sometimes tried to overbuffer for
live streams.
Relates to issue #21.
Change-Id: If086ef54618621fa77b169be58f4bfc9e255525e
Drop unused SWITCH_BUFFER_SIZE_SECONDS_ and combine
SINGLE_FRAME_SECONDS_ and the unnamed nudge constant into NUDGE_.
Issue #51.
Change-Id: I5d9a001aa6432a859b6205ded6e1d75be759b9db