Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| js:wrap_lazy-videos [2026/07/21 09:12] – avillepreux | js:wrap_lazy-videos [2026/07/27 10:10] (Version actuelle) – avillepreux | ||
|---|---|---|---|
| Ligne 22: | Ligne 22: | ||
| & | & | ||
| opacity: 1; | opacity: 1; | ||
| + | | ||
| + | &: | ||
| + | cursor: pointer; | ||
| + | } | ||
| } | } | ||
| } | } | ||
| Ligne 80: | Ligne 84: | ||
| document.addEventListener(" | document.addEventListener(" | ||
| + | |||
| + | var no_autoplay = (document.querySelectorAll(" | ||
| document.querySelectorAll(" | document.querySelectorAll(" | ||
| - | var video_path = wrap_video.textContent; | + | var video_path = wrap_video.textContent.trim(); |
| - | var dokuwiki_path = video_path; | + | var dokuwiki_path = video_path.replaceAll("/", |
| - | var src_path = ("/ | + | var src_path = ("/ |
| var basename = src_path.split('/' | var basename = src_path.split('/' | ||
| - | var html = '< | + | var html = '< |
| '< | '< | ||
| '<a href="' | '<a href="' | ||
| Ligne 137: | Ligne 143: | ||
| video.load(); | video.load(); | ||
| - | if (video.autoplay) { | + | if (video.autoplay |
| video.play().catch(() => {}); | video.play().catch(() => {}); | ||
| } | } | ||