I want to write a python macro that adds videos to LibreOffice Impress. So far, I have been able to add images with python, but the script does not work for video files. A demo of my working image script is shown below.
import uno
from com.sun.star.awt import Size
from com.sun.star.awt import Point
def add_page():
"""
Create a slide for each of the items in folder
"""
document = XSCRIPTCONTEXT.getDocument()
MAX_X = 28000
MAX_Y = 15750
page = document.DrawPages.getByIndex(0)
page.Layout = -1
path = '/home/doakey/Desktop/image.png'
graphic = document.createInstance('com.sun.star.drawing.GraphicObjectShape')
graphic.GraphicURL = "file://" + path
graphic.setSize(Size(MAX_X, MAX_Y))
graphic.setPosition(Point(0, 0))
page.add(graphic)