Ask Your Question

How to start/stop movie from macro? [closed]

asked 2012-12-03 06:31:04 +0200

Patrick Bouffard gravatar image

LibO's support for video is mediocre but it still seems to be the least-bad option for presentations on Linux with movies embedded. However I would really like to be able to control playback of an embedded (ok, technically 'linked') movie during the presentation. Ideally this would include things like seeking to different times but for starters it would be nice to just be able to play, pause, and stop. Right now the closest I can get is by adding custom animation actions (a la this answer). But this is not so great because you can't play/pause an indeterminate amount of times; at best you can put in a lot of "toggle pause" actions and hope they are enough at presentation time. But then when you want to go to the next slide you need to hit Alt+PgDn instead of just clicking, fine if you are at the keyboard but if you are using a presentation remote, probably not possible..

So it seems that it should be possible to create a macro and have it run when a shape on the same slide as the video is clicked. I can figure out how to get a handle to the actual video object but I can't see how I would actually do anything (play/pause/seek/stop) with this object in hand. I've looked at OOME but Impress video files don't seem to be covered. Looking at the video object in the variable inspector in LibO's IDE didn't reveal anything useful either.

Here's the code I have that finds the video object based on its name ('video'). How do I make the video start from the macro?

function PlayVideo

dim oPages
opages = ThisComponent.getDrawPages()

dim thispage
thispage = oPages.getByIndex(1)

dim i
dim oShape
for i = 0 to thispage.getCount()
    oShape = thispage.getByIndex(i)
    if oShape.Name = "video" then
        ' here is where I don't know what to do!
        exit function
    end if

msgbox("video element not found")

end function
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-10-27 01:44:05.821176

1 Answer

Sort by » oldest newest most voted

answered 2013-03-17 04:47:37 +0200

qubit gravatar image

Hi @Patrick Bouffard,

Still looking for an answer here? I seem that you've looked at Pitonyak's materials -- I know those can be quite helpful!

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-12-03 06:31:04 +0200

Seen: 870 times

Last updated: Mar 17 '13