%% @author Arjan Scherpenisse %% @copyright 2011-2026 Arjan Scherpenisse %% @doc Enables embedding media from their URL. %% @end %% Copyright 2011-2026 Arjan Scherpenisse %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed to in writing, software %% distributed under the License is distributed on an "AS IS" BASIS, %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -module(mod_oembed). -moduledoc(" Makes media [resources](/id/doc_glossary#term-resource) from embeddable URLs through the [OEmbed](http://www.oembed.com/) protocol. This module, if activated, checks the pasted URLs in the *create media / page* dialog of the admin. It will show an embed option for services like YouTube, Vimeo or any other service which supports OEmbed. A saved media resource has a thumbnail image which is downloaded from the OEmbed service and embedded in the resource. Furthermore, the resource’s medium record has an `oembed` field which contains the full JSON response of the request. The `oembed` field looks like this: ```erlang \"oembed\": { \"type\": \"video\", \"version\": \"1.0\", \"provider_name\": \"Vimeo\", \"provider_url\": \"http://vimeo.com/\", \"title\": \"Heli Filming Showreel\", \"author_name\": \"Hot Knees Media\", \"author_url\": \"http://vimeo.com/hotknees\", \"is_plus\": \"1\", \"html\": \"