diff options
author | rohan09-raj <[email protected]> | 2022-08-25 11:52:33 +0530 |
---|---|---|
committer | rohan09-raj <[email protected]> | 2022-08-25 11:55:12 +0530 |
commit | 54a27fb52551069fa6d40c6f5941c5d49c0f0506 (patch) | |
tree | 8aff7da60822a847ea081c981da904880d6fb807 /client/src/components/AudioAutoplay | |
parent | 772fc663fd31bc247dcc7da31090234b5b89f155 (diff) |
admin UI improvement and back button added
Diffstat (limited to 'client/src/components/AudioAutoplay')
-rw-r--r-- | client/src/components/AudioAutoplay/AudioAutoplay.jsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/client/src/components/AudioAutoplay/AudioAutoplay.jsx b/client/src/components/AudioAutoplay/AudioAutoplay.jsx new file mode 100644 index 0000000..285aeb6 --- /dev/null +++ b/client/src/components/AudioAutoplay/AudioAutoplay.jsx @@ -0,0 +1,26 @@ +import React from 'react' + +const AudioAutoplay = ({ audio }) => { + const language = localStorage.getItem('i18nextLng') + + const audioLanguage = () => { + if (language === 'en') { + return `${audio}-english.mp3` + } else if (language === 'hi') { + return `${audio}-hindi.mp3` + } else { + return `${audio}-english.mp3` + } + } + + return ( + <iframe + src={audioLanguage()} + allow="autoplay" + style={{ display: 'none' }} + id="iframeAudio" + /> + ) +} + +export default AudioAutoplay |