I like the feature where when someone pastes a link to an YouTube video, the client automatically embeds the video in the chat window and you can watch it right then and there.
How does that work? The reason I am asking is we have an internal video portal “similar” to YouTube but posting links to that does nothing. So is the Mattermost client recognizing the YouTube link and using some API calls to handle that embedding? Is it possible to somehow extend that functionality to handle our internal video portal site?
I looked at YouTube video source and do not find any og:video meta properties. Am I missing something? So when a user pastes a link into Mattermost chat, Mattermost, loads the metadata from the link and if there is opengraph metadata it uses it to load a preview?
Thanks for the example. For some reason when I do view-source in Chrome I don’t see the metadata you pasted (view-source:https://www.youtube.com/watch?v=ih2xubMaZWI) Any idea what I am doing wrong?
Ok I have confirmed the link I am trying has the meta tags. But it still does not embed the video. Any ideas? I am on Mattermost 3.10.0, could this be the issue? YouTube still works fine.
Oh, I think I misread you, you want it to read the page and post the video the same way it does for youtube, in that case I am afraid its not possible.
I see, yes I was able to get the link preview to work with the og meta tags but it would be great if the embedding of the video would work as well. This seems to work ok on Facebook regardless of the URL seems like they just do the video preview purely in the OG tags.
I am not familiar with Open Graph, but I think that is something facebook does internally you would have to check how they render the link, by inspecting it perhaps they further open a embed iframe or something which would be it.
I will give a look at the Open Graph code used on mattermost to see if it does anything different with videos as well.
Well I tried with a random facebook video and it doesn’t convert it into a video like u said above: