Conversation
|
Thanks for the PR! Real clean, didn’t know Gio had that I’ve just moved it up to the base class so all overlays can profit from it. Probably not very useful to the gif backend but now we achieve the same on the VLC one.
Thanks. I’m aware of the issue but never bothered to fix it. I’ve opened #274 to discuss it.
That’s an oversight. I’ve added the missing one. |
Also good to know we do some things better and it’s just not whichever software people stumble upon first. |
|
Wow, thanks for the quick merge!
Copied it from a similar hack I did for pdfpc. Only later I learned about
Thank you! I can currently only test gstreamer and didn't want to be risky :) |
The canonical way to include sound files in LaTeX beamer is to use the
\moviecommand of themultimediapackage. 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,.oggand.pdffile displaying that behavior: test.zipThis PR is a straightforward fix:
GstOverlay, define amedia_typeattribute that is overridden during construction (which callsset_file). I followed the original code to create a class attributemedia_typethat 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.,sinkdoes 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, askGioto 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 🎉