Skip to content

Add video #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
May 14, 2025
Merged

Add video #334

merged 25 commits into from
May 14, 2025

Conversation

mkaszewiak
Copy link
Collaborator

Here is another pull request @twsouthwick Thanks

Copy link
Contributor

Learn Build status updates of commit 798e91f:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ⚠️Warning Details
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/presentation/insert_a_new_slideto/cs/insert_a_new_slideto_cs.csproj ✅Succeeded
samples/samples.sln ✅Succeeded

docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md

  • Line 105, Column 185: [Warning: disallowed-html-tag - See documentation] HTML tag 'cNvPr' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
  • Line 105, Column 348: [Warning: disallowed-html-tag - See documentation] HTML tag 'videoFile' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
  • Line 105, Column 427: [Warning: disallowed-html-tag - See documentation] HTML tag 'hlinkClick' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
  • Line 105, Column 641: [Warning: disallowed-html-tag - See documentation] HTML tag 'cNvPicPr' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 86255f9:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/presentation/insert_a_new_slideto/cs/insert_a_new_slideto_cs.csproj ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit c421671:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/presentation/insert_a_new_slideto/cs/insert_a_new_slideto_cs.csproj ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit df45c27:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/presentation/insert_a_new_slideto/cs/insert_a_new_slideto_cs.csproj ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit ed67d1c:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 62a8d4c:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@twsouthwick twsouthwick requested a review from Copilot March 31, 2025 17:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds functionality to programmatically insert a video into a slide of a presentation and updates the corresponding documentation to guide users through the process.

  • Implements AddVideo method with Open XML SDK to manage video insertion, placeholder image, and related relationships.
  • Updates documentation to include code snippets and a comprehensive guide for using the new video functionality.

Reviewed Changes

Copilot reviewed 2 out of 6 changed files in this pull request and generated 2 comments.

File Description
samples/presentation/add_video/cs/Program.cs Implements video insertion functionality using the Open XML SDK.
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md Updates documentation with detailed usage steps and code references.
Files not reviewed (4)
  • samples/presentation/add_video/cs/add_video_cs.csproj: Language not supported
  • samples/presentation/add_video/vb/Program.vb: Language not supported
  • samples/presentation/add_video/vb/add_video_vb.vbproj: Language not supported
  • samples/samples.sln: Language not supported

@twsouthwick
Copy link
Collaborator

Looks like copilot found some spelling issues, but other than that, LGTM

}
// <Snippet2>
//Get presentation part
PresentationPart presentationPart = presentationDocument.PresentationPart;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the samples not use var? Not a blocker, but we should be consistent

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will stick with data types but we may discuss it on the meeting as the current samples have it mixed var and data types. Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to avoid var in the docs for clarity. Maybe we should go through older files and make them consistent

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add an editorconfig that enforces it for all of them


## Getting a Presentation Object

In the Open XML SDK, the `PresentationDocument` class represents a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a shared snippet that could be used here that has links to the APIs. @mikeebowen do you know what I'm referring to?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing that is a match for this, but if this gets repeated, we should create one

@twsouthwick twsouthwick mentioned this pull request Mar 31, 2025
Copy link
Collaborator

@twsouthwick twsouthwick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's clean a few of these things up

mkaszewiak and others added 3 commits April 1, 2025 11:22
Typo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Taylor Southwick <tasou@microsoft.com>
Copy link
Contributor

Learn Build status updates of commit 7978539:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Co-authored-by: Taylor Southwick <tasou@microsoft.com>
Copy link
Contributor

Learn Build status updates of commit 8db9e3b:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 4283f96:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit b35f7d8:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit b51ceb6:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit de275e6:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 6da971d:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md ⚠️Warning Details
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md ⚠️Warning Details
docs/toc.yml ⚠️Warning Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md

  • Line 8, Column 8: [Warning: duplicate-titles - See documentation] Title 'Delete all the comments by an author from all the slides in a presentation' is duplicated in: 'presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md(8,8), presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md(8,8)'. Titles must be unique within a docset.
  • Line 17, Column 1: [Warning: duplicate-h1s - See documentation] H1 'Delete all the comments by an author from all the slides in a presentation' is duplicated with other articles: 'presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md(17,1), presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md(17,1)'. First level headings must be unique within a docset.

docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md

  • Line 8, Column 8: [Warning: duplicate-titles - See documentation] Title 'Delete all the comments by an author from all the slides in a presentation' is duplicated in: 'presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md(8,8), presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md(8,8)'. Titles must be unique within a docset.
  • Line 17, Column 1: [Warning: duplicate-h1s - See documentation] H1 'Delete all the comments by an author from all the slides in a presentation' is duplicated with other articles: 'presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md(17,1), presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md(17,1)'. First level headings must be unique within a docset.

docs/toc.yml

  • Line 52, Column 15: [Warning: file-not-found - See documentation] Invalid file link: 'presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md"'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 5e9f8d3:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/presentation/overview.md ⚠️Warning Details
docs/presentation/working-with-comments.md ⚠️Warning Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md ✅Succeeded n/a (file deleted or renamed)
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md ✅Succeeded
docs/toc.yml ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

docs/presentation/overview.md

  • Line 33, Column 3: [Warning: file-not-found - See documentation] Invalid file link: 'how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md'.

docs/presentation/working-with-comments.md

  • Line 196, Column 1: [Warning: file-not-found - See documentation] Invalid file link: 'how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 924ce4c:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md ✅Succeeded n/a (file deleted or renamed)
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md ✅Succeeded
docs/presentation/overview.md ✅Succeeded
docs/presentation/working-with-comments.md ✅Succeeded
docs/toc.yml ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit f4b38b3:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md ✅Succeeded n/a (file deleted or renamed)
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md ✅Succeeded
docs/presentation/overview.md ✅Succeeded
docs/presentation/working-with-comments.md ✅Succeeded
docs/toc.yml ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

}
// <Snippet2>
//Get presentation part
PresentationPart presentationPart = presentationDocument.PresentationPart;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to avoid var in the docs for clarity. Maybe we should go through older files and make them consistent

mkaszewiak and others added 2 commits May 13, 2025 18:10
…ion.md

Co-authored-by: Michael Bowen <10384982+mikeebowen@users.noreply.github.com>
…ion.md

Co-authored-by: Michael Bowen <10384982+mikeebowen@users.noreply.github.com>
Copy link
Contributor

Learn Build status updates of commit 2163d2f:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md ✅Succeeded n/a (file deleted or renamed)
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md ✅Succeeded
docs/presentation/overview.md ✅Succeeded
docs/presentation/working-with-comments.md ✅Succeeded
docs/toc.yml ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit e53cec1:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md ✅Succeeded n/a (file deleted or renamed)
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md ✅Succeeded
docs/presentation/overview.md ✅Succeeded
docs/presentation/working-with-comments.md ✅Succeeded
docs/toc.yml ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

…ion.md

Co-authored-by: Michael Bowen <10384982+mikeebowen@users.noreply.github.com>
Copy link
Contributor

Learn Build status updates of commit 780f1ee:

✅ Validation status: passed

File Status Preview URL Details
docs/presentation/how-to-add-a-video-to-a-slide-in-a-presentation.md ✅Succeeded
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentatio.md ✅Succeeded n/a (file deleted or renamed)
docs/presentation/how-to-delete-all-the-comments-by-an-author-from-all-the-slides-in-a-presentation.md ✅Succeeded
docs/presentation/overview.md ✅Succeeded
docs/presentation/working-with-comments.md ✅Succeeded
docs/toc.yml ✅Succeeded
samples/presentation/add_video/cs/add_video_cs.csproj ✅Succeeded
samples/presentation/add_video/cs/Program.cs ✅Succeeded
samples/presentation/add_video/vb/add_video_vb.vbproj ✅Succeeded
samples/presentation/add_video/vb/Program.vb ✅Succeeded
samples/samples.sln ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@mkaszewiak mkaszewiak requested a review from mikeebowen May 14, 2025 15:38
Copy link
Collaborator

@mikeebowen mikeebowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all of the child elements added required?


## Getting a Presentation Object

In the Open XML SDK, the `PresentationDocument` class represents a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing that is a match for this, but if this gets repeated, we should create one

@twsouthwick twsouthwick merged commit f1f74eb into OfficeDev:main May 14, 2025
3 checks passed
@mkaszewiak mkaszewiak deleted the addVideo branch May 15, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants