Skill Level: Advanced
UNL MediaHub supports oEmbed.
oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.oembed.com
UNL MediaHub supports JSON-encoded and XML-encoded returns.
Application Programming Interface (API)
In order to interact with the API, the following schemes and endpoint should be used:
- URL schemes
- http://mediahub.unl.edu/media/*
- https://mediahub.unl.edu/media/*
- API endpoint
- https://mediahub.unl.edu/oembed
- Examples
- https://mediahub.unl.edu/oembed?url=https%3A%2F%2Fmediahub.unl.edu%2Fmedia%2F10519
- https://mediahub.unl.edu/oembed?url=https%3A%2F%2Fmediahub.unl.edu%2Fmedia%2F10519&format=xml
Example Returns
Example returns are provided below.
JSON Video
Below is an unserialized, example JSON return for a video asset:
[version] => 1.0
[title] => Nebraska East Union Renovation Fly Through
[author_name] => Student Involvement
[provider] => UNL Mediahub
[provider_url] => https://mediahub.unl.edu/
[thumbnail_url] => https://mediahub.unl.edu/media/10519/image.jpg
[thumbnail_width] => 960
[thumbnail_height] => 540
[type] => video
[html] => <iframe src="https://mediahub.unl.edu/media/10519?format=iframe&autoplay=0" title="Video Player: Nebraska East Union Renovation Fly Through" allowfullscreen frameborder="0"></iframe>
[width] => 940
[height] => 529
XML Video
Below is an example XML return for a video asset:
<oembed>
<version>1.0</version>
<title>Nebraska East Union Renovation Fly Through</title>
<author_name>Student Involvement</author_name>
<provider>UNL Mediahub</provider>
<provider_url>https://mediahub.unl.edu/</provider_url>
<thumbnail_url>https://mediahub.unl.edu/media/10519/image.jpg</thumbnail_url>
<thumbnail_width>960</thumbnail_width>
<thumbnail_height>540</thumbnail_height>
<type>video</type>
<html>
<![CDATA[
<iframe src="https://mediahub.unl.edu/media/10519?format=iframe&autoplay=0" title="Video Player: Nebraska East Union Renovation Fly Through" allowfullscreen frameborder="0"></iframe>
]]>
</html>
<width>940</width>
<height>529</height>
</oembed>
JSON Audio
Below is an unserialized, JSON example return for an audio asset:
[version] => 1.0
[title] => Red-White Spring Game interview
[author_name] => Ronnie Green
[provider] => UNL Mediahub
[provider_url] => https://mediahub.unl.edu/
[thumbnail_url] => https://mediahub.unl.edu/media/10993/image.jpg
[thumbnail_width] => 1920
[thumbnail_height] => 1080
[type] => rich
[html] => <iframe src="https://mediahub.unl.edu/media/10993?format=iframe&autoplay=0" title="Audio Player: Red-White Spring Game interview" width="600" height="337" allowfullscreen frameborder="0"></iframe>
[width] => 600
[height] => 337
XML Audio
Below is an example XML return for an audio asset:
<oembed>
<version>1.0</version>
<title>Red-White Spring Game interview</title>
<author_name>Ronnie Green</author_name>
<provider>UNL Mediahub</provider>
<provider_url>https://mediahub.unl.edu/</provider_url>
<thumbnail_url>https://mediahub.unl.edu/media/10993/image.jpg</thumbnail_url>
<thumbnail_width>1920</thumbnail_width>
<thumbnail_height>1080</thumbnail_height>
<type>rich</type>
<html>
<![CDATA[
<iframe src="https://mediahub.unl.edu/media/10993?format=iframe&autoplay=0" title="Audio Player: Red-White Spring Game interview" width="600" height="337" allowfullscreen frameborder="0"></iframe>
]]>
</html>
<width>600</width>
<height>337</height>
</oembed>
Contributed By: IIM