Share via

Does embedded generated code for videos in OneDrive (iFrame) still only opens in separate browser tab?

Anonymous
2023-04-06T06:11:17+00:00

Quite a few threads on challenges people experience when wanting to embed a OneDrive video in an external site simply repeat the same answer.

The basic problem is that even with the correct sharing permissions set and HTML embed code generated, those video files still open in a separate browser tab (and not as desired as an iframe on a website).

It seems to work for other file types (but not video).

Some suggested it has to do with the type of video file, but threads cover that also (with the same undesirable outcome).

Here's what I'm doing:

Required outcome: The videos need to show/ be playable within a WordPress lesson page. I understand that there are nifty video streaming services. I have looked at a few great options but that is not the question.

  1. I am using my Microsoft 365 personal/professional account to which I'm uploading mp4 files to OneDrive
  2. I create a public shareable link
  3. I open the link and select to generate embed code
  4. The embed code is pasted to an html block in WordPress
  5. The WordPress page is published
  6. The image of the video shows on the page but then opens in a different browser tab

Can someone confirm that this is still not possible? Or, if it is indeed possible, then how??

Much appreciated

Microsoft 365 and Office | OneDrive | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2023-04-06T07:19:47+00:00

    Dear ElmoPienaar,

    Good day!!

    I understand your concern and tested the behavior by embedding the video stored in the OneDrive in the SharePoint Online site where the embedded video plays in the same embedded page instead of opening it in the new tab, since you are having the problem with external website, I have searched and found that it is still not possible to embed OneDrive videos in an iframe on an external website. When you generate the embed code for a OneDrive video, it will always open in a separate browser tab when clicked.

    This behavior is by design, as Microsoft has implemented this security feature to prevent cross-site scripting (XSS) attacks. When a user clicks on a OneDrive video link, it is expected to open in a separate tab to ensure that the user's credentials and sensitive information are not compromised.

    ​Yes, it is still not possible to embed OneDrive videos in an iframe on an external website. When you generate the embed code for a OneDrive video, it will always open in a separate browser tab when clicked.

    This behavior is by design, as Microsoft has implemented this security feature to prevent cross-site scripting (XSS) attacks. When a user clicks on a OneDrive video link, it is expected to open in a separate tab to ensure that the user's credentials and sensitive information are not compromised.

    Alternatively, you can consider hosting the video on a different platform that allows embedding in iframes, such as YouTube or Vimeo, and then embedding the video on your WordPress lesson page.​​It would definitely be ideal if we can add this feature to SharePoint/OneDrive modern experience. Thank you for bringing this to our attention. You can send your feedback on our feedback web portal https://feedbackportal.microsoft.com/ . Our product Team is constantly checking the comments and feedbacks from our customer to improve our products.

    Sorry for your inconvenience and hope you can understand!

    Best Regards,

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-05-22T11:13:37+00:00

    After struggling for a couple of hours, I finally found this answer.... unfortunately, embedded videos that open in a separate window is not a good option in my case---- and, I imagine, in many, many other cases.

    Maybe try to fix this Microsoft? Your competitors embed video without this requirement....

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2023-04-06T10:35:57+00:00

    Thank you so much. At least I can stop trying to make this work and will now consider alternatives.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2023-04-08T02:46:32+00:00

    Dear ElmoPienaar,

    Thanks for understanding and if you feel my reply helped to explain your situation, please click on the helpful button (Yes or No) in the reply. In the future, if you have any further concerns related to Office 365, please feel free to post a new thread in this community and we will try our best to assist you.

    Have a good day!!

    Best Regards,

    Sophia

    Was this answer helpful?

    0 comments No comments