Created
April 3, 2021 19:51
-
-
Save im-noob/88e0beef97711f8b7f26b0b37123a7cd to your computer and use it in GitHub Desktop.
Play Different Audio In LinkedIn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// let audio_url = 'https://media.licdn.com/media/AAMBAQQiAAgAAQAAAAAAAAriAAAAJDg2ZWY0MzhjLWQ5YTUtNDgyMy1hZjQ3LWYzM2RlOWRjZmZkYg.bin'; | |
let audio_url = 'https://fsb.zobj.net/download/bSCIjtRQgjq9_Y6tM5IdFilYEp18rUjolRsAWyFRQ54YLXrhcs8YkPqexUvo6-8y_FSaAVLZTBAxgRJyfyJmkHU_XtboIwuG6xprhiQl9xn2FXkpi41Y0DUq7nNU/?a=web&c=72&f=small_town_boy.mp3&special=1617478235-s9coL3BX6o9WBKgaxaZf6upK89ytW4oVqSGzPyFIsZY%3D'; | |
let audio = new Audio(audio_url); | |
document.getElementsByClassName('msg-thread')[0].addEventListener("DOMSubtreeModified", function() { | |
if( typeof play_audio_trigger !== 'undefined'){ | |
clearTimeout(play_audio_trigger); | |
} | |
play_audio_trigger = setTimeout(function(){ | |
play_audo(); | |
},1000); | |
}); | |
function play_audo() { | |
for (var i = 0; i < 5; i++) { | |
setTimeout(function(){ | |
audio.play(); | |
},1000) | |
console.log('Playing Audio') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment