Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/oppia-1647-multiple…
Browse files Browse the repository at this point in the history
…-audios' into release-7-4-9
  • Loading branch information
alexlittle committed Aug 27, 2024
2 parents ed3c939 + 3085f56 commit a132ead
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/src/main/assets/js_injects/observe_audio_player.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
(function(){
var playButton = document.getElementById("play-icon");
playButton.addEventListener("click", function() {
var audioElement = document.querySelector("audio");
var audioSource = audioElement.getAttribute("src");
{{INTERFACE_EXPOSED_NAME}}.onPlayButtonClick(audioSource);
audioElement.addEventListener("ended", function() {
$(".audio-player-container, #audio-player-container").each(function(){
container = $(this);
var audioElem = container.find("audio")[0];
container.find(".play-icon,#play-icon").on('click', function(){
var audioSource = audioElem.getAttribute("src");
{{INTERFACE_EXPOSED_NAME}}.onPlayButtonClick(audioSource);
});
audioElem.addEventListener("ended", function() {
var audioSource = audioElem.getAttribute("src");
{{INTERFACE_EXPOSED_NAME}}.onAudioCompleted(audioSource);
});
});
Expand Down

0 comments on commit a132ead

Please sign in to comment.