2

I am using the code presented by AlexG to present videos in slides prepared with beamer.

The code can be found here: Media9 is becoming obsolete Dec 2020. Any alternatives for embedding video/audio in LaTeX? and uses pdfbase package,

I wanna if is it possible to loop the video, i.e., repeat it automatically over and over ...

Thanks in advance.

1 Answers1

1

There is no way to achieve looping with Alexander Grahn's code, since it uses Flashless Rich Media, which doesn't have a way to achieve this. It is in fact "Plain Rich Media".

There is a way to do this with the older mechanism "Multimedia" (also called "Renditions") which is also implemented in some TeX packages (notably movie15, ConTeXt and pdfextra) and also this is what Fritz used in his answer. With the "Multimedia" mechanism there is an option called RC that controls "Repeat count". The setting that might interest you is 0, which means loop forever.

In ConTeXt, this option isn't exposed.

With movie15 you can achieve this by using repeat option (with value of 0 or no value at all).

Fritz's code could be modified to add this option. Let me know if you are interested.

With pdfextra you can use the repeat key with value 0, and you probably also want autoplay and a preview image:

\documentclass{article}

\usepackage{graphicx} \usepackage{pdfextra}

\begin{document}

\render[video.mp4][ repeat=0, aactions=\renditionautoplay, ]{\includegraphics[width=\textwidth]{example-image.pdf}}

\end{document}

More specific things could be achievable with JavaScript, but that is Acrobat Reader only.

And what you may find is, that in fact the RC option I describe above, doesn't work in Acrobat Reader(*), there is no repeat! It works in Foxit Reader thoug, and I would generally reccomend it for PDF + multimedia on Windows. Okular also works on Linux and I guess adding support to Evince wouldn't be too hard.

(*) Also I couldn't get any recent Acrobat installation to play multimedia at all, I am still unsure about the cause.