appendsdone may cause an abort in segmentloaders which can then cause pendingSegment to be null after we just null checked it. Instead we should check if we have a pendingSegment then trigger appends done and see if an abort happens.
We also want to make sure that if audio contains multiple id3 sections, we support playing back to it as we did in previos versions of VHS.
This is part of a set of upcoming changes to add support for live DASH playback. Specifically, this PR differentiates the handling of 2 cases which were formerly conflated:
- The MPD@minimumUpdatePeriod attribute has a value of 0, indicating that the MPD has no validity after the moment it was retrieved.
- The MPD@minimumUpdatePeriod attribute is absent, indicating the MPD has infinite validity and will never be updated
This pull request updates dash-playlist-loader to use a partial request before we would use sidx. This partial requests downloads as much data as needed to get the container type and ends. If the sidx segment is not mp4 it will be blacklisted. If it is mp4 sidx bytes will be passed along if they were downloaded. Otherwise we will do another request for sidx bytes.
* Update sinon to v8.1.1 and fix abort tracking in mediaRequestsAborted
* Add check to media-segment-request for empty responseText when handling partial data
This was not needed in the past, as the responseText property of a sinon response was
anually set by VHS' test helpers. However, sinon now clears out the responseText property
on a response, the mime type override trick doesn't work like it would in a browser. The
additional check to the code should prove harmless, and acts as a guard against browsers
which don't implement the mime type override trick in the same way.
* Add an abortFn callback to media-segment-request to fix abort tracking in
mediaRequestsAborted
In the previously used version of sinon (v1.10.3), aborts of requests triggered the XHR
callback. In the XHR standard however, this does not happen. Later versions of sinon fixed
this issue. VHS' use of the old sinon lead to tests relying on broken behavior to verify
abort tracking in mediaRequestsAborted.
To properly use mediaRequestsAborted, aborts are tracked on loadend, part of XHR's
[request error steps](https://xhr.spec.whatwg.org/#request-error-steps), and called back
via the abortFn to increment mediaRequestsAborted
* Skip id3 with partial data handling tests until they no longer rely on segments being
fully requested
A couple of tests checking for id3 frames surfacing from partial data handling were found
to rely on the segment finishing its request before the data was surfaced. These tests are
skipped until a fix can be made such that they rely only on partial data.
* No longer override sinon's abort behavior for tests
* No longer work around sinon's response types in standardXHRResponse
With a newer sinon version, a few workarounds needed in test-helpers are no longer needed.
* Skip partial data caption tests until they no longer rely on full segment responses
This feature adds support for passing a JSON object as the source via a
data URI, which VHS looks for alongside a new vendor (VHS) specific
media type, 'application/vnd.vhs+json'. If present, VHS will use the
provided manifest object as the first requested manifest.