scanny / python-pptx

Create Open XML PowerPoint documents in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add_video Documentation Missing?

gaurav21r opened this issue Β· comments

@scanny First of all thanks a ton for this library πŸ™πŸΌ
I am creating app that automates adding video to a PPTX using ffmpeg and Electron JS...

I noticed there is a method called add_video here:
image

...but this seems to be missing in the docs (or Search is not working here)

image

I have some confusion regarding the second parameter called shape_id. Does this mean I need to first add a Shape and then use add_video as a child? How do I add the video data here? (Video File Path / Base64 representation?)

If you can just let me know how to do it here, I'd love to add this to the docs with a PR (unless its not been added voluntarily).

Kindly forgive if I've misunderstood anything here. New to Python & this Library!

For anyone else wondering, this wonderful library already has what I want here:

https://python-pptx.readthedocs.io/en/latest/api/shapes.html?highlight=add_movie#pptx.shapes.shapetree.SlideShapes.add_movie

image

I guess I faltered because video is a more generic term than movie but I understand that in Microsoft Powerpoint Parlance, movie is the right term.

Closing this issue and sorry for any confusion!

Yeah, as a matter of convention we adhere to user-interface concept-naming in the API and XML element-naming in the XML-layer to reduce mental translation for users and developers.

Unfortunately those don't always line up exactly but still seems to be the best convention. An end-user is more likely to find what they're after using UI language, like Insert > Movie from the toolbar, and someone working on the XML uses code that matches the XML they are manipulating, like .add_video() adds a <p:video> element.