Free Support Forum - aspose.com

ASPOSE Slides for .NET - Embedded video? Formats Supported?

Does ASPOSE Slides .NET have a feature of embedding a video file in a powerpoint? if so what formats are supported?

Can you please guide me to the dll which supports that and also the sample code.

Thanks

Sreedhar

Hi Sreedhar,


Thanks for your interest in Aspose.Slides.

I like to share that Aspose.Slides does have the support for embedding videos inside presentation. Please use the following sample code to serve the purpose on your end. Please share, if I may help you further in this regard.

PresentationEx pres = new PresentationEx();
VideoFrameEx vf = pres.Slides[0].Shapes.AddVideoFrame(110, 70, 100, 60, null);
VideoEx vid = pres.Videos.AddVideo(new FileStream(@"…\Wildlife2.wmv", FileMode.Open)); // adding VideoEx from stream
vf.EmbeddedVideo = vid;
pres.Write(@"…\NewEmbed.pptx");

Many Thanks,

Thanks Fayyaz. It worked perfectly.

I have some more questions.

Can you please tell me what all video formats are supported in Aspose slides??

When I use the code above by default when I open the PPT the media shows as "No Image". Can I change this and put my own image there so that I can instruct the user to hover on it to see the play button at the bottom.

Also can you guide me to the documentation where I can get all the code samples (The latest document).

Thanks

Sreedhar

Hi Sreedhar,


Please try using the following sample code on your end to serve the purpose. Secondly for your query related to supported video formats, Aspose.Slides supports all videos format that PowerPoint supports and that can be played from PowerPoint. The video formats that can be played in PowerPoint are those for which proper media player supporting codecs are installed. In my opinion, the PowerPoint supports standard video format like mpege, wmv and avi. Please share, if I may help you further in this regard.

PresentationEx pres = new PresentationEx();
VideoFrameEx vf = pres.Slides[0].Shapes.AddVideoFrame(110, 70, 100, 60, null);
VideoEx vid = pres.Videos.AddVideo(new FileStream(@“C:\Users\Public\Videos\Sample Videos\Wildlife.wmv”, FileMode.Open)); // adding VideoEx from stream
vf.EmbeddedVideo = vid;

//Set the picture
System.Drawing.Image img = (System.Drawing.Image)new Bitmap(@“C:\Users\Public\Pictures\Sample Pictures\Desert.jpg”);
ImageEx imgx = pres.Images.AddImage(img);


vf.FillFormat.FillType = FillTypeEx.Picture;
vf.Image = imgx;
// vf.FillFormat.PictureFillFormat.Picture.Image = imgx;
pres.Write(@“D:\Aspose Data\NewEmbed.pptx”);


Many Thanks,

Thanks Fayyaz. It worked.

Can you point me to the latest Documentation for Aspose Slides for .NET.

Sreedhar

Hi Sreedhar,


Please visit this documentation link for your kind reference. The documentation is in accordance with latest version of Aspose.Slides. Also, when you install Aspose.Slides for .NET, the chm file is also installed that you can access and use. It also contains the code samples and API reference documentation.

Many Thanks,