64547ed3 by Gary Katsevman

add responseType option to xhr helper

1 parent d18e7c0b
...@@ -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 }
......