Apache POI XSLF 将电影添加到幻灯片 [英] Apache POI XSLF Adding movie to the slide

查看:32
本文介绍了Apache POI XSLF 将电影添加到幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Apache POI 库来创建带有 Java 的幻灯片.我们的客户对嵌入的文本、图像和视频感兴趣.不花哨现在需要像图表之类的东西.我了解 XSLF 仍然是正在开发中,尚未成熟的产品.

I am using the Apache POI library to create powerpoint slides with Java. Our client is interested in embedded text, images and videos. No fancy stuff like charts etc. is needed for now. I understand that XSLF is still under development and not yet a mature product.

我使用 Apache POI HSLF 模型实现了我的目标,但唯一缺少的是嵌入的视频没有显示任何播放控件.经过很少的研究,我发现是 pptx 和 ppt 文件标准使事情变得不同.所以现在为了解决这个问题,我正在从 HSLF 迁移到 XSLF.但遗憾的是 XSLF 库没有任何添加视频文件的方法(与 HSLF addmovie 方法不同).

I have achieved my target using Apache POI HSLF model but the only thing it is missing is that videos which are embedded doesn't show up any playback controls. After little researching I found that it is the pptx and ppt file standards which are making the things different. So now to solve this issue I am migrating from HSLF to XSLF. But unfortunately XSLF library doesn't have any method to add video file (unlike HSLF addmovie method).

你们推荐什么方法?有没有其他方法可以在 ppt 文件(而不是 pptx)上显示播放控件?我的意思是额外的 activex 控件/媒体播放器.如果是,应该如何使用 Java 来完成?

What method you guys recomend ? Is there any other way to show the playback controls on ppt files(and not pptx)?I mean by additional activex control/mediaplayer. If yes how should it be done using Java ?

推荐答案

Begininger">Begininger>从 Powerpoint 2010 开始,可以在 PPTX 文件中嵌入视频(...而不是链接它们或使用某种 ActiveX/youtube 组合).如果您嵌入 您需要安装 Quicktime 插件的 MP4 视频.

Beginning from Powerpoint 2010 it's possible to embed videos in PPTX-files (... instead of linking them or using some kind of ActiveX/youtube combo). If you embed MP4-videos you need to have the Quicktime plugin installed.

关于播放控件,当您将鼠标移到视频形状上时,我的 PP 2010 查看器会显示它们.有时,当您直接点击图片而不是等待弹出窗口时,它们就再也不会出现了.

Regarding the playback controls, my PP 2010 viewer displays them when you move the mouse over the video shape. Sometimes they never show up again, when you click straight into the image instead of waiting for the popup.

以下代码...

  • 获取 MPEG(也可能是本地文件)
  • 在第 5 秒创建帧的快照,用作预览图像.我在这里使用了 Xuggle 库,但当然任何其他库也可以(...普通 JMF(没有扩展包)无法处理(这)MPEG)
  • 嵌入图像和视频
  • 并添加一些任意的;)东西,PP需要实际播放视频
  • fetches a MPEG (could be also a local file)
  • creates a snapshot of the frame on the 5th second, which is used as the preview image. I've used the Xuggle libs here, but of course any other libs are ok too (... plain JMF (without extension pack) couldn't handle (this) MPEGs)
  • embeds image and video
  • and adds some arbitrary ;) stuff, which PP needs to actually play the video

代码在XSLF 示例.

(2016-02-06 更新:将代码移至 POI 示例,因此只有在有新功能时需要修改的地方.此外,POI 3.13 中存在回归,无法添加图片将电影添加到媒体目录 - 此问题已在即将发布的 POI 3.14 中修复)

这篇关于Apache POI XSLF 将电影添加到幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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