1
votes

I developed one plugin with office VSTO for MS Word using which I was able to embed a Video into word document using following code.

Globals.ThisAddIn.Application.ActiveDocument.InlineShapes.AddWebVideo(@"<iframe width='400' height='400' src='http://www.youtube.com/embed/qk51u8-4uo4' frameborder='0' allowfullscreen />"
, VideoWidth: 400
, VideoHeight: 400
, PosterFrameImage: "https://i.ytimg.com/vi/qk51u8-4uo4/hqdefault.jpg"
, Range: currentRange);

Now, I'm developing another add-in using JavaScript based API based on API reference here at:

Add-In APIs - Javascript Office 365/2016

My question is, I was not able to find any relative API for embedding a video into word document.

Please help me in identifying the right API?

If that's limitation, Can I add some text/XML/picture in the document, add binding to it and then when user clicks on that text/XML/picture, the video will be played in Add-In itself.

1

1 Answers

1
votes

At this point in time we don't have an API to insert a video specifically, but you can insert rich content into Word using OOXML. Here's an overview: https://dev.office.com/docs/add-ins/word/create-better-add-ins-for-word-with-office-open-xml

Here's the new Api and usage of how to insert it: https://dev.office.com/reference/add-ins/word/body#insertooxmlooxml-string-insertlocation-insertlocation