使用Apache Open Office API将视频以编程方式嵌入到幻灯片中 [英] Programatically embed a video in a slideshow using Apache Open Office API

查看:333
本文介绍了使用Apache Open Office API将视频以编程方式嵌入到幻灯片中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个插件,通过自动指定视频的位置,在Open Office Impress的打开实例中的当前幻灯片上添加视频.我已成功将形状添加到幻灯片.但是我找不到嵌入视频的方法.

I want to create a plugin that adds a video on the current slide in an open instance of Open Office Impress by specifying the location of the video automatically. I have successfully added shapes to the slide. But I cannot find a way to embed a video.

使用.uno:InsertAVMedia,我可以接受用户输入来选择文件,并且该文件可以工作.我要如何以编程方式指定文件的位置?

Using the .uno:InsertAVMedia I can take user input to choose a file and it works. How do I want to specify the location of the file programmatically?

结论:

API不支持此功能.可以在没有用户干预的情况下插入图像和音频,但是无法以这种方式完成视频.希望此功能在后续版本中发布.

This is not supported by the API. Images and audio can be inserted without user intervention but videos cannot be done this way. Hope this feature is released in subsequent versions.

推荐答案

可以添加

It is possible to add an XPlayer on the current slide. It looks like this will allow you to play a video, and you can specify the file's URL automatically.

以下是使用createPlayer的示例: https ://forum.openoffice.org/en/forum/viewtopic.php?f = 20& t = 57699 .

编辑:

此基本代码可在我的系统上使用.要播放视频,只需调用例程即可.

This Basic code works on my system. To play the video, simply call the routine.

sub play_video
    If Video_flag = 0 Then
        video =converttoURL( _
            "C:\Users\JimStandard\Downloads\H264_test1_Talkinghead_avi_480x360.avi")
        Video_flag = 1
        'for windows:
        oManager = CreateUnoService("com.sun.star.media.Manager_DirectX")
        ' for Linux
        ' oManager = CreateUnoService("com.sun.star.media.Manager_GStreamer")
        oPlayer = oManager.createPlayer( video )
        ' oPlayer.CreatePlayerwindow(array()) ' crashes?
        'oPlayer.setRate(1.1)
        oPlayer.setPlaybackLoop(False)
        oPlayer.setMediaTime(0.0)
        oPlayer.setVolumeDB(GetSoundVolume())
        oPlayer.start() ' Lecture
        Player_flag = 1
    Else
        oPlayer.start() ' Lecture
        Player_flag = 1
    End If
End Sub

这篇关于使用Apache Open Office API将视频以编程方式嵌入到幻灯片中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆