Team, I'm working on an audio streaming platform, i have set up a some media files in my static folder in mp3 format. I have also written a js file to add the seek bar navigation to change the audio.currentTime function to fast forward or rewind.
This works fine in firefox but does not work on chrome or safari. I have looked around for this on the web nothing has worked for me yet.
sample js code:
$(document).on('click',"#tracker",function(e){
audio.addEventListener('canplay', function(){
var parentOffset = $('#tracker').offset();
var relX = e.pageX - parentOffset.left;
var width = $('#tracker').width();
audio.currentTime= ((relX/width))*audio.duration;
});
});