I have created a PPTX file through Aspose.slide lib. In that PPTX file, I have attached/embedded video. Here is my code:-
//Create a presentation
presentation = new Presentation();
slide1 = presentation.getSlides().get_Item(0);
//Add Video Frame
String videoUrl = "/home/pr/Desktop/test.mp4";
IVideoFrame vf = slide1.getShapes().addVideoFrame(50, 150, 300, 150, videoUrl);
//Set Play Mode and Volume of the Video
vf.setPlayMode(VideoPlayModePreset.Auto);
vf.setVolume(AudioVolumeMode.Loud);
//Set default image if in case the video does not appear.
IPPImage img =null;
img = presentation.getImages().addImage(new FileInputStream(new File("/home/pr/Desktop/cow.jpeg")));
vf.getPictureFormat().getPicture().setImage(img);
//Write the presentation to disk
try{
presentation.save("/home/pr/Desktop/as.pptx",SaveFormat.Pptx);
}catch(Exception e){
e.printStackTrace();
}
My issue is that When I’m opening this PPTX file in Libre Office/MS Office 2010/2008 then my video is not playing. The only default image is displaying. Could you help me what is the error in my code OR if there are some PP tools, who can handle video inside the slide, then please explain it
I have observed the sample code shared and there seems no issue in the code. Can you please provide the source code, sample video and generated output with us that we may test on our end to help you further.
It would be great if you also guide me that which format of video is suitable for embedding with PPTX.
And you have already seen my code so you need again ?
I have worked with files shared by you and it seems to be an issue with API while playing the added video. An issue with ID SLIDESJAVA-37603 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
We have investigated the requirement in detail on our end. his is not a bug.
If you try to insert attached video in PowerPoint 2010, you will receive an error message about absent QuickTime. Please observe attached screen.png.
The video added in PowerPoint 2016 also cannot be played in PowerPoint 2010. The problem is solved by QuickTime installation and suggest you to please try this on your end.