425d7a72 by Katrina Ellison Geltman Committed by David LaPalomento

Add support for status code 206 in videojs.Hls.xhr responses

1 parent 2a8faddc
...@@ -28,9 +28,13 @@ ...@@ -28,9 +28,13 @@
28 request.timedout = false; 28 request.timedout = false;
29 } 29 }
30 30
31 // videojs.xhr no longer consider status codes outside of 200 and 0 (for file uris) to be 31 // videojs.xhr no longer considers status codes outside of 200 and 0
32 // errors but the old XHR did so emulate that behavior 32 // (for file uris) to be errors, but the old XHR did, so emulate that
33 if (!error && response.statusCode !== 200 && response.statusCode !== 0) { 33 // behavior. Status 206 may be used in response to byterange requests.
34 if (!error &&
35 response.statusCode !== 200 &&
36 response.statusCode !== 206 &&
37 response.statusCode !== 0) {
34 error = new Error('XHR Failed with a response of: ' + 38 error = new Error('XHR Failed with a response of: ' +
35 (request && (request.response || request.responseText))); 39 (request && (request.response || request.responseText)));
36 } 40 }
......