none
Embedding Video using new office JavaScript based API RRS feed

  • Question

  • Hey Guys,

    I have 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.

    Can you 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..

    Thank you for your efforts...


    Friday, April 8, 2016 3:54 AM

Answers

All replies

  • Check out the docs and let us know about any questions and issues you find in them by submitting an issue directly in this repository. Make sure you state the version+build number of the client you are using, and provide repro steps, console output, and error messages in any issue you open.Let us know about your programming experience, what you would like to see in future versions, code samples, etc. Use this site for entering your suggestions and ideas.
    If you find an issue with the documentation, please create a GitHub issue by clicking the Issues tab above. We also encourage you to fork, make the fix, and do a pull request of your proposed changes.http://goo.gl/8Ur2QK
    Friday, April 8, 2016 7:21 AM
  • I'm not sure why you replied to my question ...because in no way your response is associated to my question!

    I have done through the entire API document and nowhere I could find the API which will allow me to add Video in word document! So my questions to others are, Can they help me in searching right API for embedding video into office 2016/365 and to confirm that whether such API exists or not!

    Friday, April 8, 2016 9:05 AM
  • Hi Hiren2009,

    >> Embedding Video using new office JavaScript based API

    Based on the link below, it seems you could add html to word document.
    # Inserting images with apps for Office
    https://blogs.msdn.microsoft.com/officeapps/2012/10/26/inserting-images-with-apps-for-office/

    But, as my test, it seems there is something wrong in the setSelectedDataAsync method. The html string will be inserted as text string, I suggest you check whether this issue exist at your side. If yes, I suggest you submit a feedback in the link below:
    https://officespdev.uservoice.com/

    >> 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

    There is no click event. You could try Office.EventType.DocumentSelectionChanged, and how video in add-in web page.
    # Document.SelectionChanged event
    https://dev.office.com/reference/add-ins/shared/document.selectionchanged.event

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, April 11, 2016 5:13 AM
  • Thanks for spending your time...

    I was able to insert HTML into word document and it worked perfectly... Then I tried adding Iframe (youtube embedded code) and it did not worked for me. It shows nothing.

    The later seems good to me... May be adding some image with some extra information (as properties) and then on selection of that, I can play the video within add-in..

    Let's see how this works!, Let me know if you get any success in this implementation...

    Monday, April 11, 2016 6:46 AM
  • Hi Hiren2009,

    >> Then I tried adding Iframe (youtube embedded code) and it did not worked for me. It shows nothing.

    Based on the link below, iframe is not supported in word.
    # Unsupported HTML Elements Compared with the HTML 4.01 Specification
    https://msdn.microsoft.com/en-us/library/aa338201(v=office.12).aspx#Word2007MailHTMLandCSS_SupportedHTMLElementsAttributesandCSSProperties

    >> May be adding some image with some extra information (as properties) and then on selection of that, I can play the video within add-in

    If you have any updates about this, please feel free to let us know.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, April 12, 2016 1:31 AM