[Tex/LaTex] Include live remote image in Beamer presentation

beamerjavascriptmedia9

From this question, I see that it is possible to include remote images within a PDF, via the media9 package. Can direct inclusion of Javascript–as in this question–be used to update the image (technically, the swf object) at a specified interval?

Best Answer

Version [2015-05-11] of media9 provides SlideShow.swf which is an image gallery app for live and static remote (downloaded at viewing time) and static embedded image files in the PNG, JPEG and GIF formats. SlideShow.swf is configured via an XML file with very simple syntax.

The app can be interacted with using the right-click menu or the keyboard.

The link which follows is the slide-show example embedded in the media9 documentation file, opened in the web browser. (The fourth image doesn't work here because it uses a URL which is relative to the player SWF file):

http://mirrors.ctan.org/macros/latex/contrib/media9/players/SlideShow.swf?xml=../doc/files/config.xml

A minimal beamer-class example of a single-image "slide-show" using the remote live image URL given in the OP would read:

\documentclass{beamer}
\usepackage{media9}

\begin{document}
\begin{frame}{Live remote image}
  \includemedia[
    width=\linewidth,
    height=0.46\linewidth,
    activate=pageopen,
    passcontext, %show context menu
    addresource=show.xml,
    flashvars={ xml=show.xml }
  ]{}{SlideShow.swf}
\end{frame}
\end{document}

with file show.xml containing the lines:

<SlideShow>
  <Img live="3">
    <caption>Live remote image.</caption>
    <URL>http://dev.eightbeers.org/tex/corner-icon.png</URL>
  </Img>
</SlideShow>

The remote image will be refreshed every three seconds.