Embed Video in PowerPoint using Java

PowerPoint presentations often contain video frames to demonstrate something or to attract the audience. In many cases, the videos are used to save time and make the presentations effective. In this article, you will learn how to work with videos in PowerPoint files programmatically. Particularly, the article will cover how to embed or extract a video in a PowerPoint presentation using Java.

Java API to Embed Video in PowerPoint Presentations

In order to embed or extract videos in PowerPoint presentations, we will use Aspose.Slides for Java. The API is designed to create and manipulate PowerPoint and OpenOffice documents. You can either download the API’s JAR or install it using the following Maven configurations.

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>
<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <version>21.8</version>
    <classifier>jdk16</classifier>
</dependency>

Embed a Video in PowerPoint Presentation using Java

The following are the steps to embed a video in a PowerPoint presentation using Java.

The following code sample shows how to embed a video in a PowerPoint presentation using Java.

Embed Video from a Web Source using Java

You can also embed a video in the PowerPoint presentations from a web source. The following are the steps to achieve this.

The following code sample shows how to embed a video into the presentation from a web source.

Extract Video from a PowerPoint Presentation in Java

Aspose.Slides for Java also allows you to extract a video from a presentation. Below are the simple steps to achieve this.

The following code sample shows how to extract videos from a PowerPoint presentation using Java.

Get a Free API License

You can use Aspose.Slides for Java without evaluation limitations by requesting a temporary license.

Conclusion

In this article, you have learned how to embed videos in PowerPoint presentations using Java. Moreover, you have seen how to extract videos from a presentation programmatically. In addition to this, you can visit the documentation to explore more about Aspose.Slides for Java. Also, you can post your queries to our forum.

See Also

Info: Aspose recently developed a free MP4 to MP3 web app that can be used to extract audio from video files.