4

I am looking for a web audio player to embed on my website that allows links to jump to a specific time in the audio, a la youtube.

I am uploading lecture audio from lectures that are over an hour. I'd like to provide a way to link to specific times in the audio to jump to different topics, just like in youtube comments where users can enter 00:33 and have it turned in to a link that, when clicked, will jump to 00:33 part of the video. I can't seem to find anything that can do this.

The site is only for myself and a few friends, FYI, so wide compatibility is not required.

Joe
  • 41
  • 2

2 Answers2

3

If you are using the HTML5 audio tag, you can scan the HTML looking for a XX:XX pattern and add a link to a certain function, let say ChangeTime, and then do something like this in Javascript:

function ChangeTime(time){  
    var oAudio = document.getElementById(myAudio);  
    oAudio.pause();  
    oAudio.currentTime = time;  
    oAudio.load(); //for cross browser  
    oAudio.play();  
}

Of couse, you need to see in which format are the currentTime and convert from XX:XX to int format.

Su'
  • 19,342
  • 3
  • 43
  • 65
3

FlowPlayer has the seek() function for doing this. (No anchors on that page, unfortunately; just do an in-page search.)

JWPlayer has a similar function, though I'm not as familiar with their docs and can't find a specific page at the moment. You'd basically do it like so document.getElementById('playerID').sendEvent('SEEK', 12.5);

Su'
  • 19,342
  • 3
  • 43
  • 65