Summary: | Wanted to create A linked video presentation. | ||
---|---|---|---|
Product: | POI | Reporter: | Rahul <rahul.kr.sharma29> |
Component: | XSLF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 4.1.2-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
The Image describe how can we do this manually. I want same functionality by POI.
Example code to link the video |
Description
Rahul
2020-11-30 14:57:08 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. Original SO question: https://stackoverflow.com/questions/65060554/how-to-create-pptx-file-for-link-video-in-slide-using-apache-poi Old answer to this: https://stackoverflow.com/a/16322340/2066598 Example link: https://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/examples/xslf/AddVideoToPptx.java.txt?view=markup Please verify, if this still works ... (I haven't done so yet) ... 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 http://svn.apache.org/repos/asf/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestMovieShape.java 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. Thanks. 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? Thanks 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 Created attachment 37585 [details]
Example code to link the video
I've added the source as an attachment and also to your Stackoverflow question.
|