add responseType option to xhr helper
Showing
1 changed file
with
6 additions
and
0 deletions
... | @@ -111,6 +111,7 @@ var | ... | @@ -111,6 +111,7 @@ var |
111 | options = { | 111 | options = { |
112 | method: 'GET' | 112 | method: 'GET' |
113 | }, | 113 | }, |
114 | responseType, | ||
114 | request; | 115 | request; |
115 | 116 | ||
116 | if (typeof callback !== 'function') { | 117 | if (typeof callback !== 'function') { |
... | @@ -120,9 +121,14 @@ var | ... | @@ -120,9 +121,14 @@ var |
120 | if (typeof url === 'object') { | 121 | if (typeof url === 'object') { |
121 | options = videojs.util.mergeOptions(options, url); | 122 | options = videojs.util.mergeOptions(options, url); |
122 | url = options.url; | 123 | url = options.url; |
124 | responseType = options.responseType; | ||
123 | } | 125 | } |
126 | |||
124 | request = new window.XMLHttpRequest(); | 127 | request = new window.XMLHttpRequest(); |
125 | 128 | ||
129 | if (responseType) { | ||
130 | request.responseType = responseType; | ||
131 | } | ||
126 | if (pluginOptions.withCredentials) { | 132 | if (pluginOptions.withCredentials) { |
127 | request.withCredentials = true; | 133 | request.withCredentials = true; |
128 | } | 134 | } | ... | ... |
-
Please register or sign in to post a comment