From a567ef360523e71040348fdded761c6d71a6d4d5 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Mon, 18 Jul 2016 08:08:31 -0700 Subject: Pronounce => Play Audio --- ext/fg/js/client.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ext/fg/js/client.js') 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(); -- cgit v1.2.3