Re: Can audio bookmarks be hyperlinks?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/27/2010 08:16 AM, marbux wrote:
Does anyone know of such a URI specification?

Paul, I haven't seen any answer fly by, so I thought I'd take a stab at it. There's no defined standard for doing it, so it varies from player to player. With a little JavaScript, you can do like YouTube does and read the offset value from window.location.hash and use it to control whichever embedded media-player you're using. If you're using HTML5, there's an built-in media player for .wav/.ogg/.mp3 (the supported subset of those three audio-types varies by browser) with a .currentTime property that you can set when the content is loaded. Then your URL would look something like

 http://example.com/page_displaying_html5_embedded_audio#t=3.2

where your JavaScript code parses out the "3.2" and uses that to set the .currentTime offset to begin playing. If I read things correctly, you may also have to set the "autobuffer" and "autoplay" accordingly to load the content at page-load (rather than when the user initiates it manually), specifying a callback to set the offset after the content has finished loading.

A couple good resources with fragments of useful code:

http://blog.gingertech.net/2009/08/19/jumping-to-time-offsets-in-videos/

http://stackoverflow.com/questions/3165444/html5-video-chrome-error-settings-currenttime


As always with JavaScript, the devil is in the details -- unless you can mandate support for HTML5, you'd have to also have a media player (Flash, Silverlight, whatever) with fallback.

Hope that helps point you in the right direction,

-tim




_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list


[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]