[wp-trac] [WordPress Trac] #61941: Adding app.screencast.com as an oEmbed provider

WordPress Trac noreply at wordpress.org
Mon Sep 23 15:53:25 UTC 2024


#61941: Adding app.screencast.com as an oEmbed provider
-------------------------+-----------------------------
 Reporter:  brhodes      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Embeds       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+-----------------------------

Comment (by swissspidy):

 > So our ask is the addition of the new Screencast media.

 We'll get there :) But first we need to ensure your oEmbed endpoint is
 standards-compliant. **Right now this isn't the case.** Once it is, it
 will work with WordPress out of the box.

 We have a certain standard for oEmbed providers in core. In order to add a
 new one to the existing allow-list, they must:

 1. be well-established, popular, and mainstream services,
 2. properly and fully implement the oEmbed specification,
 3. and clearly be a trusted provider.

 Right now at least (2) is missing.

 Glad you fixed the HTTP status issue, but there are more problems.

 Here are some of my observations:

 **Issue 1: Missing oEmbed discovery tags**

 https://app.screencast.com/jRnW7zEIqmf6w/e does not contain any `<link>`
 tags with oEmbed discovery markup.

 Weirdly enough, https://app.screencast.com/xNlN9BMD8Emli does contain
 them.

 Why is that?

 If both support embedding, you should add the discovery tags to both.

 **Issue 2: incorrect markup**

 The "+" (plus sign) character in the `<link>` tag's `type` attribute is
 mistakenly encoded.

 This is the markup you serve at https://app.screencast.com/xNlN9BMD8Emli:

 {{{
 <link rel="alternate" type="application/json&#x2B;oembed"
 href="https://app.screencast.com/api/v1/oembed/.json?url=https%3a%2f%2fapp.screencast.com%2fxNlN9BMD8Emli"
 title="(9&#x2B;) frame_08.png - TechSmith Screencast - 2024-09-10_13-46-28
 oEmbed Profile" />
 <link rel="alternate" type="text/xml&#x2B;oembed"
 href="https://app.screencast.com/api/v1/oembed/.xml?url=https%3a%2f%2fapp.screencast.com%2fxNlN9BMD8Emli"
 title="(9&#x2B;) frame_08.png - TechSmith Screencast - 2024-09-10_13-46-28
 oEmbed Profile" />
 }}}

 This should be `type="application/json+oembed"`, NOT
 `type="application/json&#x2B;oembed"`. Ditto for
 `type="text/xml&#x2B;oembed"`, which should be `type="text/xml+oembed"

 According to the screenshot you shared on
 https://app.screencast.com/xNlN9BMD8Emli?conversation=zTolDBzVZxpcYJUNWHzku0,
 this appears to have been correct at one point but regressed.

 So this needs to be fixed.

 **Issue 3: incorrect oEmbed response (`photo` vs `rich`)**

 https://app.screencast.com/api/v1/oembed/.json?url=https%3a%2f%2fapp.screencast.com%2fxNlN9BMD8Emli
 returns the following response:

 {{{#!json
 {
   "type": "photo",
   "version": "1.0",
   "title": "(9+) frame_08.png - TechSmith Screencast -
 2024-09-10_13-46-28",
   "author_name": "Benjamin Rhodes",
   "provider_name": "TechSmith Screencast",
   "provider_url": "https://app.screencast.com",
   "width": 1434,
   "height": 70,
   "html": "<iframe scrolling='no' frameborder='0' style='width: 1434px;
 height: 70px; border:0;'
 src='https://app.screencast.com/connector/embed/index/xNlN9BMD8Emli'
 allowfullscreen></iframe>",
   "url": "https://app.screencast.com/xNlN9BMD8Emli",
   "thumbnail_url": "https://app.screencast.com/xNlN9BMD8Emli/thumbnail",
   "thumbnail_width": 320,
   "thumbnail_height": 180
 }
 }}}

 According to https://oembed.com/, the `photo` type must return URL to a
 photo file.

 However, what you are returning is an `html` field with an `<iframe>`
 code.

 If you want to keep `photo`, return a proper photo URL and remove `html`.
 If you want to return an iframe embed code in `html`, switch to `type:
 rich`.

 **Additional recommendations**

 Some additional things I noticed when embedding those URLs. Not blocking
 for this ticket but I thought I'd share it nonetheless.

 * Embeds throw errors trying to set cookies when the iframe is sandboxed
 * Embeds should probably have a minimum height. Embedding
 https://app.screencast.com/connector/embed/index/xNlN9BMD8Emli with a
 height of 70px cuts off all the emoji reactons and the Screencast logo.
 See https://i.imgur.com/OehbtFJ.png for an example.
 * There are console warnings for using `document.write()`, which is
 discouraged. See https://developers.google.com/web/updates/2016/08
 /removing-document-write
 * There are console warnings for non-passive event listeners, which is bad
 for performance. See https://www.chromestatus.com/feature/5745543795965952

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61941#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list