Add an oembed example

Created on 6 March 2025, 2 months ago

Problem/Motivation

There is no oembed example. Add one.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Grevil
  • 🇩🇪Germany Grevil

    Basically, we want to return a simple Json response in the example that looks a bit like this:

    {
    	"version": "1.0",
    	"type": "video",
    	"provider_name": "YouTube",
    	"provider_url": "https://youtube.com/",
    	"width": 425,
    	"height": 344,
    	"title": "Amazing Nintendo Facts",
    	"author_name": "ZackScott",
    	"author_url": "https://www.youtube.com/user/ZackScott",
    	"html":
    		"<object width=\"425\" height=\"344\">
    			<param name=\"movie\" value=\"https://www.youtube.com/v/M3r2XDceM6A&fs=1\"></param>
    			<param name=\"allowFullScreen\" value=\"true\"></param>
    			<param name=\"allowscriptaccess\" value=\"always\"></param>
    			<embed src=\"https://www.youtube.com/v/M3r2XDceM6A&fs=1\"
    				type=\"application/x-shockwave-flash\" width=\"425\" height=\"344\"
    				allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed>
    		</object>",
    }
    

    (https://oembed.com/)

    Except, that we won't use the legacy "object" element in the html, but an iframe instead (with the "sandbox" attribute of course). Checkout "WidgetJsonExample" for reference.

  • 🇩🇪Germany Anybody Porta Westfalica

    @grevil: Let's talk about this first. I don't understand what you mean by example. Shouldn't we instead perhaps add an oembed endpoint submodule, if it helps?

    See https://www.hashbangcode.com/article/drupal-9-content-sharing-between-dr...

    The oembed json is individual per oembed entity, so an example wouldn't help much, I guess?

    But first let's discuss, which advantages this would bring anyway.

  • 🇩🇪Germany Anybody Porta Westfalica
Production build 0.71.5 2024