Forum Discussion
Microsoft Stream and oEmbed
- Nov 21, 2018
Our oEmbed endpoint allows you to programmatically switch a regular stream link into it's iFrame/embed equivalent. There would need to be code written that detects when you paste the stream link into wordpress, that it crafts the right call to oEmbed and then gets the iframe out of the response and puts it into the blog post instead of the link.
Did you write some plugin/code or do configuration on Wordpress to call our oEmbed endpoint?
From a quick search it looks like Wordpress supports a bunch of oEmbed endpoints by default (like YouTube and other public/consumer products), but depending on if you host your own WP or not you might be able to add URLs to whitelist, but not sure if this works with Stream or not, you'd have to play with it.
I have a plugin that is working. However, Stream is not showing the video. The plugin works as I described in my last comment. It makes a request to the oEmbed endpoint when a proper Stream URL is recognized. The MS Stream oEmbed returns properly formatted JSON and WordPress converts that JSON to properly formatted HTML and embeds that in the post. Here is what is the JSON returned and the HTML embedded in the post
{
"type":"video",
"version":"1.0",
"title":"",
"provider_name":"Microsoft Stream",
"provider_url":"https://stream.microsoft.com",
"embed_url":"https://web.microsoftstream.com/embed/video/3e4b67a0-de91-482f-84ca-78b2196c1810?autoplay=false\u0026showinfo=true",
"html":"\u003ciframe width=\"640\" height=\"360\" src=\"https://web.microsoftstream.com/embed/video/3e4b67a0-de91-482f-84ca-78b2196c1810?autoplay=false\u0026showinfo=true\" style=\"border:none;\" allowfullscreen\u003e\u003c/iframe\u003e",
"width":640,
"height":360,
"thumbnail_url":"https://amsglob0cdnstream13.azureedge.net/streamlogo/Light_640x360.jpg"
}<div style='max-width: 640px'> <div style='position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;'>
<iframe loading="lazy" width="640" height="360" src="view-source:https://web.microsoftstream.com/video/3e4b67a0-de91-482f-84ca-78b2196c1810?autoplay=false&showinfo=falseshowinfo=false" allowfullscreen style="border:none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100%; max-width: 100%;">
</iframe>
</div> </div>
Attached is what is displayed on the site in Firefox and Chrome. Basically Stream is refusing the connection. I am authenticated to my corporate MS account and can view the video if I go to Stream.
- rkentmcDec 27, 2021Copper Contributor
jbreitenbucher Any update on this?