Exception ”Method Is Not Implemented” while Saving a PowerPoint Presentation in C#

Hi

Same problem in aspose.slides 22.12/win10/.net as that old ticket:

Exception"Method is not implemented" while loading PPT using Aspose.Slides (Java) (SLIDESJAVA-36885)

Not easy to reproduce but happens once in a while with presentation with videos usually.

Have got some ?

Thank you

@pcaillol,
Thank you for contacting support.

We need the presentation file that can be used to reproduce the error and fix it. It will be great if you can provide the presentation.Otherwise, we will not be able to find the cause of the problem and fix it.

hi Andrey

I finally reproduced the problem and here are pptx and video to insert and code:
https://www.dropbox.com/s/vadx8uyu8w3xd05/method_not_implemented_exception.zip?dl=0

i am trying to replace a video as follows and that line + the video vFrame.EmbeddedVideo = newVideo; causes "Exception ”Method Is Not Implemented” when saving the pptx file !

using (var newVideoStream = File.OpenRead(vid_normalized))
{
    var newVideo = presentation.Videos.AddVideo(newVideoStream, LoadingStreamBehavior.ReadStreamAndRelease);

    // Replace the embedded video.
    **vFrame.EmbeddedVideo = newVideo; **

        success = true;
}

looking forward to hearing from you
cheers

@pcaillol,
Unfortunately, I was unable to reproduce the exception you encountered. Please share a complete compilable code example.

here are the files at same location:

here is the code trying to replace a video in a shape within a groupshape:

using (var stream = new FileStream(ppt, FileMode.Open))
{
    var presentation = new Aspose.Slides.Presentation(stream, loadOptions);
    var outPpt = Path.Combine(ppt_out_dir, Path.GetFileName(ppt));

    for (int i = 0; i < presentation.Slides.Count(); i++)
    {
        var slide = presentation.Slides[i];

        //all shapes and then recursive
        var group_shapes = slide.Shapes.Where(s => s is GroupShape || s is VideoFrame).ToList();
        for (int i_group_shape = 0; i_group_shape < group_shapes.Count; i_group_shape++)
        {
            var group_shape = group_shapes[i_group_shape];
            if (group_shape is GroupShape)
            {
                var shapes = ((GroupShape)group_shape).Shapes.Where(s => s is VideoFrame).ToList();
                for (int i_shape = 0; i_shape < shapes.Count; i_shape++)
                {
                    var shape = shapes[i_shape];
                    var vFrame = shape as VideoFrame;
                    var vid_normalized = @"D:\Work\BUGS PPT\PPT_pcr\video.mp4";

                    try
                    {
                        using (var newVideoStream = File.OpenRead(vid_normalized))
                        {
                            var newVideo = presentation.Videos.AddVideo(newVideoStream, LoadingStreamBehavior.ReadStreamAndRelease);

                            // Replace the embedded video: causes exception when saving pptx
                            vFrame.EmbeddedVideo = newVideo;
                        }
                    }
                    catch (Exception ex)
                    {
                        success = false;
                    }
                }
            }
        }
    }
    try
    {
        presentation.Save(outPpt, Aspose.Slides.Export.SaveFormat.Pptx);
    }
    catch (Exception ex)
    {
        Console.WriteLine("");
    }
    finally
    {
        if (presentation != null)
        {
            presentation.Dispose();
            presentation = null;
        }
    }
}

@pcaillol,
Thank you for the code example. I will get back to you ASAP.

@pcaillol,
Unfortunately, I have still not managed to reproduce the error. We need more information on how to do this.