What is oEmbed Protocol? | Embedding third party resources with oEmbed

Поділитися
Вставка
  • Опубліковано 7 вер 2024
  • #oEmbed #oembedprovider #embedresources
    What is oEmbed Protocol? | Embedding third party resources with oEmbed
    oembed.com/pro...
    github.com/iam...
    www.youtube.co...
    www.flickr.com...
    vimeo.com/api/...
    oEmbed is an open format designed to allow embedding content from a website into another website.
    When you share media from an external source and place it on your own site, it’s called embedding and it’s normally achieved with some code. HTML iFrames (inline frames) were a common way to embed content but they are usually a headache for developers. Luckily, oEmbed is the latest format for embedding and its slowly replacing static iframes.
    oEmbed is a specification for allowing an embedded representation of a URL on third party sites through the use of “exchanges”. An oEmbed exchange occurs between a consumer and a provider. Many content providers implement oEmbed, such as Codepen, Flickr, Vimeo, Scribd
    A provider that implements the oEmbed API allows consumers to fetch that representation by using a predefined set of “Endpoints” (URLs that accept queries for embedded resources). The consumer is a website that wishes to show an embedded representation of a third party resource, such as a photo, a news update or an embedded video.
    When querying an oEmbed URL, the provider responds with either a JSON or an XML document (it can be chosen by adding a “format” parameter to the query URL), containing information about the embedded resource, such as its width and height, its type (video, audio, etc.) and most important: the HTML code to embed the resource into a web page.
    The URL scheme describes which URLs provided by the service may have an embedded representation. The API endpoint describes where the consumer may request representations for those URLs.
    Requests sent to the API endpoint must be HTTP GET requests, with all arguments sent as query parameters. All arguments must be urlencoded
    The following query parameters are defined as part of the spec:
    url (required)
    The URL to retrieve embedding information for.
    maxwidth (optional)
    The maximum width of the embedded resource. Only applies to some resource types (as specified below). For supported resource types, this parameter must be respected by providers.
    maxheight (optional)
    The maximum height of the embedded resource. Only applies to some resource types (as specified below). For supported resource types, this parameter must be respected by providers.
    format (optional)
    The required response format. When not specified, the provider can return any valid response format. When specified, the provider must return data in the request format, else return an error (see below for error codes).

КОМЕНТАРІ • 2