Open XML SDK: AddMediaReferenceRelationship and AddVideoReferenceRelationship in Open XML Version 2.13.0 and Open XML Version 2.12.3

Ian Hoppus 1 Reputation point
2021-06-22T06:16:01.08+00:00

The code is run, both in version 2.13.0 and 2.12.3

Sample Code:

MediaDataPart mediaDataPart1 = document.CreateMediaDataPart("video/mp4", ".mp4");
System.IO.Stream mediaDataPart1Stream = System.IO.File.Open(@"D:\samplevideo.mp4", System.IO.FileMode.Open);
mediaDataPart1.FeedData(mediaDataPart1Stream);
mediaDataPart1Stream.Close();

slidePart1.AddMediaReferenceRelationship(mediaDataPart1, "rId2");
slidePart1.AddVideoReferenceRelationship(mediaDataPart1, "rId1");

Sample Result:

In slide1.xml.rels in version 2.12.3

<Relationship Type="http://schemas.microsoft.com/office/2007/relationships/media" Target="/media/mediadata.mp4" Id="rId2" />
<Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/video" Target="/media/mediadata.mp4" Id="rId1" />

video inside power point presentation is playable

In slide1.xml.rels in version 2.13.0

<Relationship Type="http://schemas.microsoft.com/office/2007/relationships/media" Target="/media/mediadata.mp4" Id="Rc3519f9b3fa04f59" />
<Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/video" Target="/media/mediadata.mp4" Id="R365391439af74425" />

video inside Power point presentation isn't playable anymore

what happen to relationship id reference in version 2.13.0(e.g. Id="Rc3519f9b3fa04f59" and not Id="rId1") ?

Is this a bug or another feature? Thank you.

Microsoft 365 and Office | Open Specifications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Bowen 2,051 Reputation points Microsoft Employee Moderator
    2021-06-22T16:59:55.637+00:00

    Hi @Ian Hoppus ,

    The Open XML SDK is a GitHub project, so this issue will be handled on GitHub Issues here: https://github.com/OfficeDev/Open-XML-SDK/issues/949

    Mike Bowen
    Microsoft Open Specifications

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.