我是 Beamer 的新手,在 Linux 上使用它,只用了 evince,没有 Acrobat 软件。我正在用 Beamer 准备演讲,想加入视频。目前我使用 Beamer 的多媒体包来尝试实现这一点:
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{multimedia}
\begin{document}
\begin{frame}{First frame}
\end{frame}
\begin{frame}{Second Frame}
\movie[externalviewer,autostart]{A movie}{my_movie.mp4}
\end{frame}
\end{document}
我可以单击链接,视频会按预期开始播放。不幸的是,我不知道我是否只有演示者,或者我是否有鼠标,所以我希望视频在显示帧时自动开始播放。这应该可以通过使用的命令来实现,但它不起作用 - “autostart”参数不起作用。有什么办法吗,我该如何实现这个?谢谢,mathse
答案1
在 PDF 中,这可以通过使用由页面打开事件触发的“启动”操作来实现。
在 Acrobat Reader 中工作;由于 Evince 不监听页面事件,因此必须通过单击链接手动触发“启动”操作。
pdflatex
或lualatex
; example-video.mp4
,即不是嵌入的,必须复制到 PDF 的目录中:
\documentclass{beamer}
\usepackage{luatex85}
\title{Presentation}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% `launch' action, triggered on `page-open'
\edef\pdfpageattrSaved{{\the\pdfpageattr}}
\begingroup
\edef\x{\endgroup
\pdfpageattr{%
/AA << %additional actions for next page
/O << %on page-open event
%%%%%%%%% adjust this %%%%%%%%%
/S/Launch /F(example-movie.mp4)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>
>>
}%
}%
\x
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{With video}
\leavevmode\pdfstartlink attr {/Subtype/Link} user {/A <<
%%%%%%%%% adjust this %%%%%%%%%
/S/Launch /F(example-movie.mp4)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>}%
Click\pdfendlink\ to trigger `Launch' action manually (Evince).
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% reset no normal behaviour
\expandafter\pdfpageattr\pdfpageattrSaved
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{The End}
\end{frame}
\end{document}