Wijzigen voor document Speler voor video's

Laatst gewijzigd door Jeeves de Butler op 09-10-2026 10:34

Van versie 2.1
gewijzigd door Jeeves de Butler
op 06-10-2026 04:09
Opmerking bij wijziging: Er is geen opmerking bij deze versie
Naar versie 1.1
gewijzigd door Jeeves de Butler
op 06-10-2026 04:09
Opmerking bij wijziging: Er is geen opmerking bij deze versie

Samenvatting

Details

XWiki.JavaScriptExtension[0]
cache
... ... @@ -1,1 +1,0 @@
1 -long
code
... ... @@ -1,55 +1,0 @@
1 -// Syntess Atrium leren: chapter list under each clip. A click jumps to that moment and plays; while playing, the
2 -// current chapter is highlighted. A link to #clip-<nummer>@m:ss opens the page at that clip and moment.
3 -(function () {
4 - function seconds(tc) {
5 - return tc.split(':').reduce(function (total, part) { return total * 60 + parseInt(part, 10); }, 0);
6 - }
7 -
8 - function setup(fig) {
9 - if (fig.getAttribute('data-wb-klaar')) return;
10 - fig.setAttribute('data-wb-klaar', '1');
11 - var video = fig.querySelector('video');
12 - var buttons = Array.prototype.slice.call(fig.querySelectorAll('.wb-hoofdstukken button'));
13 - if (!video || !buttons.length) return;
14 -
15 - buttons.forEach(function (button) {
16 - button.addEventListener('click', function () {
17 - video.currentTime = Number(button.getAttribute('data-t'));
18 - video.play();
19 - });
20 - });
21 -
22 - video.addEventListener('timeupdate', function () {
23 - var current = null;
24 - buttons.forEach(function (button) {
25 - if (Number(button.getAttribute('data-t')) <= video.currentTime + 0.25) current = button;
26 - });
27 - buttons.forEach(function (button) {
28 - var active = button === current;
29 - button.classList.toggle('wb-actief', active);
30 - if (active) button.setAttribute('aria-current', 'true'); else button.removeAttribute('aria-current');
31 - });
32 - });
33 - }
34 -
35 - function openFromHash() {
36 - var match = decodeURIComponent(location.hash).match(/^#clip-([0-9.]+)@([0-9:]+)$/);
37 - if (!match) return;
38 - var fig = document.getElementById('clip-' + match[1]);
39 - var video = fig && fig.querySelector('video');
40 - if (!video) return;
41 - var start = seconds(match[2]);
42 - var jump = function () { video.currentTime = start; };
43 - if (video.readyState >= 1) jump(); else video.addEventListener('loadedmetadata', jump, { once: true });
44 - fig.scrollIntoView({ block: 'start' });
45 - }
46 -
47 - function init() {
48 - Array.prototype.forEach.call(document.querySelectorAll('figure.wb-clip'), setup);
49 - openFromHash();
50 - }
51 -
52 - if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init();
53 - window.addEventListener('hashchange', openFromHash);
54 -})();
55 -
name
... ... @@ -1,1 +1,0 @@
1 -Hoofdstukken bij clips
parse
... ... @@ -1,1 +1,0 @@
1 -Nee
use
... ... @@ -1,1 +1,0 @@
1 -onDemand