1

I am working on PowerPoint add-ins. I am not able to add the video in PowerPoint using JavaScript API. When I try to add a video its shows a blank image. The image is given below and the code also. code:

Office.context.document.setSelectedDataAsync(`<svg  width="800" height="600"  style="border: 1px solid black;">
  <g>
      <g transform="translate(151,104) scale(1,1)">
          <rect x="0" y="0" width="300" height="200"></rect>
          <foreignObject  width="500" height="400">
              <video  width="300" height="200">
                  <source src=
                  "https://static.observableusercontent.com/files/a1cb7c2d8c7a82427667af8052a1428755a9f0f33bfe715e9b4b31673cfa7c8b875c83bf40b7ca4d02cba4543c64736435b70efa0c69ed5fb0d151f06aa9dcc3" type="video/mp4" />
              </video>
          </foreignObject>
      </g>
  </g>
</svg>`, {
    coercionType: Office.CoercionType.XmlSvg
  },
    function (asyncResult) {
      if (asyncResult.status === Office.AsyncResultStatus.Failed) {
        console.log('asyncResult', asyncResult.error.message)
      }
    });
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Shiv Yadav
  • 467
  • 2
  • 11

0 Answers0