|
316 | 316 | hideCursorTime: {{ hide_cursor_time }}
|
317 | 317 | });
|
318 | 318 |
|
319 |
| - {% if data_uri %} |
320 |
| - // Fix found by @t-fritsch on GitHub |
321 |
| - // see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-6651475. |
322 |
| - function fixBase64VideoBackground(event) { |
323 |
| - // event.previousSlide, event.currentSlide, event.indexh, event.indexv |
324 |
| - if (event.currentSlide.getAttribute('data-background-video')) { |
325 |
| - const background = Reveal.getSlideBackground(event.indexh, event.indexv), |
326 |
| - video = background.querySelector('video'), |
327 |
| - sources = video.querySelectorAll('source'); |
328 |
| - |
329 |
| - sources.forEach((source, i) => { |
330 |
| - const src = source.getAttribute('src'); |
331 |
| - if(src.match(/^data:video.*;base64$/)) { |
332 |
| - const nextSrc = sources[i+1]?.getAttribute('src'); |
333 |
| - video.setAttribute('src', `${src},${nextSrc}`); |
334 |
| - } |
335 |
| - }); |
336 |
| - } |
| 319 | + {% if data_uri -%} |
| 320 | + // Fix found by @t-fritsch on GitHub |
| 321 | + // see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-6651475. |
| 322 | + function fixBase64VideoBackground(event) { |
| 323 | + // event.previousSlide, event.currentSlide, event.indexh, event.indexv |
| 324 | + if (event.currentSlide.getAttribute('data-background-video')) { |
| 325 | + const background = Reveal.getSlideBackground(event.indexh, event.indexv), |
| 326 | + video = background.querySelector('video'), |
| 327 | + sources = video.querySelectorAll('source'); |
| 328 | + |
| 329 | + sources.forEach((source, i) => { |
| 330 | + const src = source.getAttribute('src'); |
| 331 | + if(src.match(/^data:video.*;base64$/)) { |
| 332 | + const nextSrc = sources[i+1]?.getAttribute('src'); |
| 333 | + video.setAttribute('src', `${src},${nextSrc}`); |
| 334 | + } |
| 335 | + }); |
337 | 336 | }
|
338 |
| - Reveal.on( 'ready', fixBase64VideoBackground ); |
339 |
| - Reveal.on( 'slidechanged', fixBase64VideoBackground ); |
340 |
| - {% endif %} |
| 337 | + } |
| 338 | + Reveal.on( 'ready', fixBase64VideoBackground ); |
| 339 | + Reveal.on( 'slidechanged', fixBase64VideoBackground ); |
| 340 | + {%- endif %} |
341 | 341 | </script>
|
| 342 | + |
| 343 | + {% if env['READTHEDOCS'] -%} |
| 344 | + <style> |
| 345 | + readthedocs-flyout, readthedocs-notification { |
| 346 | + display: none; |
| 347 | + } |
| 348 | + </style> |
| 349 | + {%- endif %} |
342 | 350 | </body>
|
343 | 351 | </html>
|
0 commit comments