Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The canonical way to include sound files in LaTeX beamer is to use the
\movie
command of themultimedia
package. This also works in pympress, however, it replaces the text link (or whatever is used) with a black box while the audio is playing. See the attached minimal working example for a.tex
,.ogg
and.pdf
file displaying that behavior: test.zipThis PR is a straightforward fix:
GstOverlay
, define amedia_type
attribute that is overridden during construction (which callsset_file
). I followed the original code to create a class attributemedia_type
that is later shadowed by an instance attribute. (Which may or may not have been intentional, see https://www.bruceeckel.com/2022/05/11/misunderstanding-python-class-attributes/. It's also not done consistently, e.g.,sink
does not have a corresponding class attribute. I'd also be fine removing the class attribute and setting an instance attribute in the constructor instead.)set_file
, askGio
to guess the mime type from the file extension. This works fine as long as the extension is sane. If a user has a video file with an audio extension, it will be mistaken for an audio file, but I guess we could live with that.on_play
, only unhide the video sink if the mime type does not start withaudio
. This is more defensive than only showing the video sink if the mime type starts withvideo
, so it should not break things when mime type guessing did not work.Let me know if you'd like to see any changes! And thank you for maintaining pympress, I think it solves all the issues I had with pdfpc or evince 🎉