Skip to content

Commit

Permalink
Merge pull request #89 from watson-developer-cloud/fix-cross-browser-…
Browse files Browse the repository at this point in the history
…support

fix: use normal string concatenation for cross-browser support
  • Loading branch information
germanattanasio authored Sep 18, 2018
2 parents 6b8f2ba + 3e0010f commit e704f0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions speech-to-text/get-models.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ module.exports = function getModels(options) {
};
var url = options.url || 'https://stream.watsonplatform.net/speech-to-text/api';
if (options.access_token) {
url = `${url}/v1/models?access_token=${options.access_token}`;
url = url + '/v1/models?access_token=' + options.access_token;
} else {
url = `${url}/v1/models?access_token=${options.token}`;
url = url + '/v1/models?access_token=' + options.token;
}
return fetch(url, reqOpts)
.then(function(response) {
Expand Down
4 changes: 2 additions & 2 deletions text-to-speech/get-voices.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ module.exports = function getVoices(options) {
};
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
if (options.access_token) {
url = `${url}'/v1/voices?watson-token='${options.access_token}`;
url = url + '/v1/voices?watson-token=' + options.access_token;
} else {
url = `${url}'/v1/voices?watson-token='${options.token}`;
url = url + '/v1/voices?watson-token=' + options.token;
}
return fetch(url, reqOpts)
.then(function(response) {
Expand Down
2 changes: 1 addition & 1 deletion text-to-speech/synthesize.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function synthesize(options) {
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
var audio = options.element || new Audio();
audio.crossOrigin = 'anonymous';
audio.src = `${url}/v1/synthesize?${qs.stringify(pick(options, QUERY_PARAMS_ALLOWED))}`;
audio.src = url + '/v1/synthesize?' + qs.stringify(pick(options, QUERY_PARAMS_ALLOWED));
if (options.autoPlay !== false) {
audio.play();
}
Expand Down

0 comments on commit e704f0e

Please sign in to comment.