Skip to content

Commit e704f0e

Browse files
Merge pull request #89 from watson-developer-cloud/fix-cross-browser-support
fix: use normal string concatenation for cross-browser support
2 parents 6b8f2ba + 3e0010f commit e704f0e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

speech-to-text/get-models.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ module.exports = function getModels(options) {
5454
};
5555
var url = options.url || 'https://stream.watsonplatform.net/speech-to-text/api';
5656
if (options.access_token) {
57-
url = `${url}/v1/models?access_token=${options.access_token}`;
57+
url = url + '/v1/models?access_token=' + options.access_token;
5858
} else {
59-
url = `${url}/v1/models?access_token=${options.token}`;
59+
url = url + '/v1/models?access_token=' + options.token;
6060
}
6161
return fetch(url, reqOpts)
6262
.then(function(response) {

text-to-speech/get-voices.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ module.exports = function getVoices(options) {
5555
};
5656
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
5757
if (options.access_token) {
58-
url = `${url}'/v1/voices?watson-token='${options.access_token}`;
58+
url = url + '/v1/voices?watson-token=' + options.access_token;
5959
} else {
60-
url = `${url}'/v1/voices?watson-token='${options.token}`;
60+
url = url + '/v1/voices?watson-token=' + options.token;
6161
}
6262
return fetch(url, reqOpts)
6363
.then(function(response) {

text-to-speech/synthesize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = function synthesize(options) {
5151
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
5252
var audio = options.element || new Audio();
5353
audio.crossOrigin = 'anonymous';
54-
audio.src = `${url}/v1/synthesize?${qs.stringify(pick(options, QUERY_PARAMS_ALLOWED))}`;
54+
audio.src = url + '/v1/synthesize?' + qs.stringify(pick(options, QUERY_PARAMS_ALLOWED));
5555
if (options.autoPlay !== false) {
5656
audio.play();
5757
}

0 commit comments

Comments
 (0)