Timecode-Links in Captions of Youtube-Videos


0. In the u5CMS backend, embed your Youtube video according to user manual page 28 .

1. In the u5CMS-backend, create a page named youtubetimecodejump.

Its content must be

  
[h:]
<script>
function w(ytt) {
document.write('<a href="javascript:void(0)" name="'+yhash+'" onclick="goytt(this.innerHTML,this.name)">'+ytt+'</a>');
}
function goytt(ytt,yhash) {
ifrs=document.getElementsByTagName('iframe');
iframenumber=-1;
for(i=0;i<ifrs.length;i++) {
if(ifrs[i].src.indexOf(yhash)>-1)iframenumber=i;
}
ysrc=document.getElementsByTagName('iframe')[iframenumber].src;
ysrc=ysrc.split('?')[0];
ytt1=ytt.split(':')[0]*60;
ytt2=ytt.split(':')[1];
ytt=parseInt(ytt1)+parseInt(ytt2);
ysrc=ysrc+'?autoplay=1&start='+ytt;
document.getElementsByTagName('iframe')[iframenumber].src=ysrc;
}
</script>
[:h]

2. In the u5CMS-backend write in the metadata's caption field of the youtube video of interest something like this:

  
Michael Zisman (Bandoneon) und Jazz Orchester der Universität Bern — Tribute to Astor Piazzolla 
[$$$:youtubetimecodejump]
[h:]<script>yhash='I507jPNt4Is' //Youtube hash must be indicated here</script>
[h:]<script>w('00:00')</script>[:h] - 05:50 Milonga del Angel, comp. Astor Piazzolla, arr. Fred Sturm
[h:]<script>w('06:11')</script>[:h] - 16:07 Resurreccion del Angel, comp. Astor Piazzolla, arr. Fred Sturm
[h:]<script>w('21:35')</script>[:h] - 27:02 Choral, comp. Astor Piazzolla, arr. Daniel Zisman
[h:]<script>w('27:47')</script>[:h] - 31:34 Milonga Loca, comp. Astor Piazzolla, arr. Fred Sturm
[h:]<script>w('38:33')</script>[:h] - 42:25 Tres Minutos con la Realidad, comp. Astor Piazzolla, arr. Fred Sturm
[h:]<script>w('44:40')</script>[:h] - 50:39 Libertango, comp. Astor Piazzolla, arr. Fred Sturm

Do not forget to set the correct hash in the above script.

Example Result

Michael Zisman (Bandoneon) und Jazz Orchester der Universität Bern — Tribute to Astor Piazzolla

- 05:50 Milonga del Angel, comp. Astor Piazzolla, arr. Fred Sturm
- 16:07 Resurreccion del Angel, comp. Astor Piazzolla, arr. Fred Sturm
- 27:02 Choral, comp. Astor Piazzolla, arr. Daniel Zisman
- 31:34 Milonga Loca, comp. Astor Piazzolla, arr. Fred Sturm
- 42:25 Tres Minutos con la Realidad, comp. Astor Piazzolla, arr. Fred Sturm
- 50:39 Libertango, comp. Astor Piazzolla, arr. Fred Sturm

Download

Content Management System u5CMS

Service

English⇄German Translation Service

Flowers

blumen-bern-maarsen.ch