Cimbali / pympress

Pympress is a simple yet powerful PDF reader designed for dual-screen presentations
https://cimbali.github.io/pympress/
GNU General Public License v2.0
1.14k stars 88 forks source link

No video when note slide located at bottom of page #309

Open einhander opened 6 months ago

einhander commented 6 months ago

Describe the bug Then \setbeameroption{show notes on second screen=bottom} used video can't be played. show notes on second screen=right plays video ok.

To Reproduce Steps to reproduce the behavior:

  1. Use MWE:
    \documentclass{beamer}
    \usepackage{multimedia}
    \setbeameroption{show notes on second screen=bottom} 
    \begin{document}
    \begin{frame}{Just a mp4 here}
    \centering
    \movie[width=0.3\textwidth]{\includegraphics[width=0.4\textwidth]{frame1}}{movie.mp4}
    \end{frame}
    \end{document}
  2. Run pympress on result pdf file
  3. Click on video frame
  4. See no video playing, only sound

Expected behavior Play video on presenter window

Environment (please complete the following information):

Debug information (see below for file locations)

Cimbali commented 6 months ago

Weird bug, but can reproduce. Thanks for reporting!

Cimbali commented 6 months ago

The clickable area to play the video appears in the notes slide. And the same bug happens with notes on the left, while notes on top works. There must be something wrong in the media position computation.

einhander commented 6 months ago

Yes, clickable area works on notes slide, I can hear sound from the video. But video didn't appear on any screen.

Cimbali commented 6 months ago

This seems to me to be a variant of #115 of some kind. Essentially beamer generates the wrong coordinates in the PDF for the media if you’re using the second* half (right or top) for content and the first half (left or bottom) for notes.

We can shift the media on the slide page when it is on a right or bottom notes page, under the rather safe assumption that nobody puts medias on notes pages. However the click area means shifting links which is less obvious: there is likely a valid use case for links on notes pages.

* in the sense of latex/beamer coordinates

Cimbali commented 6 months ago

Frankly I think the most efficient workaround is to not use bottom- or left-screen note pages. My favourite option would be to display notes on separate pdf pages. Your example would become:

\documentclass{beamer}
\usepackage{multimedia}

% Show beamer notes but on separate pages
\setbeameroption{show notes}

% Tell pympress which pages are notes pages
\addtobeamertemplate{note page}{}{\thispdfpagelabel{notes:\insertframenumber}}

% Only add this bit if you want all note pages to show even when empty
\makeatletter
\def\beamer@framenotesbegin{% at beginning of slide
  \gdef\beamer@noteitems{}%
  \gdef\beamer@notes{{}}% used to be totally empty.
}
\makeatother

% Rest of document unchanged
\begin{document}
\begin{frame}{Just a mp4 here}
    \centering
    \movie[width=0.3\textwidth]{\includegraphics[width=0.4\textwidth]{frame1}}{movie.mp4}
\end{frame}
\end{document}
einhander commented 6 months ago

@Cimbali Thanks for the clarification of the source of the problem and the code snippet for the notes on separate pdf pages.

if you’re using the second* half (right or top) for content and the first half (left or bottom) for notes.

Yes, the top position works fine. I'll stop there for now, unless there's a workaround. Unfortunately, the hack posted in #115 didn't work for me in case of bottom position.

Cimbali commented 6 months ago

The hack in 115 is for links. We’d need to expand the patch for \movie.