Bug 64945 - Wanted to create A linked video presentation.
Summary: Wanted to create A linked video presentation.
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2020-11-30 14:57 UTC by Rahul
Modified: 2020-12-02 22:33 UTC (History)
0 users

The Image describe how can we do this manually. I want same functionality by POI. (34.91 KB, image/png)
2020-11-30 14:57 UTC, Rahul
Example code to link the video (3.98 KB, text/x-java)
2020-12-02 22:33 UTC, Andreas Beeker

Note You need to log in before you can comment on or make changes to this bug.
Description Rahul 2020-11-30 14:57:08 UTC
Created attachment 37579 [details]
The Image describe how can we do this manually. I want same functionality by POI.

Hi I am trying to create a A linked video presentation as mentioned in bellow URL:


I got the example for Embedded one form the example AddVideoToPptx.java available in Examples of POI. and I am able to create Embedded video presentation.

But I have not got any example related to link-Video presentation.

Please suggest how can I create Link-Video presentation.

Previously I was doing this using Aspose-slides library Now I want to do this using POI.

Please help.

Thanks & Regards.
Comment 1 PJ Fanning 2020-11-30 16:12:17 UTC
Hi Rahul,
The bugzilla platform is tracking bugs and enhancements. I think it would be more appropriate to post this on stackoverflow or use the POI users email list.
Comment 3 Rahul 2020-12-01 07:44:57 UTC
Hi Andreas,

Thanks for your quick reply.

The stackoverflow question which you mentioned, I am the one who requested that question 5 days before and still I have not got any answer.

And the Example Link which you mentioned the file name AddVideoToPptx.java.txt is the example for making embeded-video presentation which I have already created and it's working successfully.

My requirement is to create linked-video presentation. which file size is smaller and we have to take care of the existence of linked files. 

I also got one example 


using this example, the created Pptx file giving error.

From last 20 days I am fighting for this and I have not get anything yet.
That's why I posted this request to you thinking that may be I can get something from here as you guys are creator of POI.

  I request apology to you that I requested this on bugzilla platform knowing this that it's not a bug, as you also aware the time-line for a project matters very much in software industry and request you that kindly help me out.

Comment 4 Rahul 2020-12-01 15:24:35 UTC

I does some changes in Embedded-Video presentation example. I commented the code section in which the byte-stream of file is adding in PackagePart class object. and in place of that I put bellow line

part.addExternalRelationship(video.getPath(), "http://schemas.microsoft.com/office/2007/relationships/media"); part.addExternalRelationship(video.getPath(), "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video");

Also in Add Video method I during adding relationship to PackagePart of Slide I pass video Uri and TargetMode External by bellow line of code

prsEmbed1 = slide1.getPackagePart().addRelationship(video.toURI(), TargetMode.EXTERNAL, "http://schemas.microsoft.com/office/2007/relationships/media"); PackageRelationship prsExec1 = slide1.getPackagePart().addRelationship(video.toURI(), TargetMode.EXTERNAL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video");

Doing this created a linked-video presentation but it gives error and needed to be repaired after that video played successfully.

I compared all the xml file of repaired one and non-repaired one and I find no any difference. So something I missed what I do not know? Can you help me in this?

Comment 5 Andreas Beeker 2020-12-01 23:05:02 UTC
So if it crashes after the video was played successfully, try the following:

- the error mighty be still somewhere in your .pptx - check also the /[Content_type].xml, /ppt/presentation.xml and /ppt/slides/_rels/slide1.xml.rels

- keep replacing parts in your original / Powerpoint created version until it doesn't work anymore, e.g. synchronize the slide1.xml - my guess is, it might need a specific transition for the video

- I assume, it works correctly when you set it up in Powerpoint - if not, try a different .mp4
Comment 6 Andreas Beeker 2020-12-02 22:33:03 UTC
Created attachment 37585 [details]
Example code to link the video

I've added the source as an attachment and also to your Stackoverflow question.