next work start from tick_phonics_v1
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<div>
|
||||
<audio controls>
|
||||
<source src="horse.ogg" type="audio/ogg">
|
||||
<source id="audioFile" src="horse.mp3" type="audio/mpeg">
|
||||
Your browser does not support the audio element.
|
||||
</audio>
|
||||
</div>
|
||||
|
||||
<script is:inline>
|
||||
fetch('https://game-du.teachertrainingkolkata.in/items/game_drag/19')
|
||||
.then(response => response.json())
|
||||
.then(responseData => {
|
||||
console.log(responseData); // Log the full response
|
||||
|
||||
// Check if the data contains the 'instruction' field
|
||||
const instructionId = responseData.data.instruction;
|
||||
|
||||
// Assuming you need to build the full URL from this instruction ID
|
||||
const audioUrl = `https://game-du.teachertrainingkolkata.in/assets/${instructionId}.mp3`;
|
||||
console.log(audioUrl)
|
||||
|
||||
// Set the audio source dynamically
|
||||
document.getElementById('audioFile').src = audioUrl;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching audio source:', error);
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user