diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-07-18 08:08:31 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-07-18 08:08:31 -0700 |
commit | a567ef360523e71040348fdded761c6d71a6d4d5 (patch) | |
tree | f662ea0b4566c69c21418fd9e5f05c5b7504f078 /ext/fg/js/client.js | |
parent | cea8471290d906cc268902e82704f8efad82fda6 (diff) |
Pronounce => Play Audio
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r-- | ext/fg/js/client.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js index 1f77ed95..10e8a0ae 100644 --- a/ext/fg/js/client.js +++ b/ext/fg/js/client.js @@ -168,9 +168,13 @@ class Client { }); } - api_pronounce(index) { - const dfn = this.definitions[index]; - const url = `http://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kana=${dfn.reading}&kanji=${dfn.expression}`; + api_playAudio(index) { + const definition = this.definitions[index]; + + let url = `https://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kanji=${definition.expression}`; + if (definition.reading) { + url += `&kana=${definition.reading}`; + } for (let key in this.audio) { this.audio[key].pause(); |