Mosaic embed youtube broke -

Recently, trying to embed youtube videos in mosaic has broken. It's due to Youtube changing their api slightly and has not been updated with fixes.

I'm not confident that will be maintained.
Note Future of this service · Issue #114 · leedo/noembed · GitHub also, where noembed seems to be moving under new maintenance.

Any thoughts on how to fix this in Mosaic? I'm not keen on relying on a 3rd party site to figure out embed codes for us, especially if it's maintenance has gone away. I'm not keen on rewriting all this perl into a plone package either. Maybe can host a noembed fork? What's the best way out of this one?

I use a custom fragment and that works:
If it is OK to paste all the iframe code from youtube: view/data/iframe is the complete embed code.
The CSS is to make it responsive, so I set the height (as percent of width) in the settings.

<html xmlns="" xml:lang="en"

  <div class="videoWrapper disabled-${view/data/disabled|None}"
      <div tal:replace="structure view/data/iframe"/>

  .videoWrapper {
  	position: relative;
  	padding-bottom: ${view/data/height|None}%; /* 16:9 */
  	padding-top: 0;
  	height: 0;
  .videoWrapper iframe {
  	position: absolute;
  	top: 0;
  	left: 0;
  	width: 100%;
  	height: 100%;


Update: here is the XML

<model xmlns:form=""
  <field name="disabled" type="zope.schema.Bool">
      <title>Hide fragment</title>
      <description>Click here to hide fragment</description>
  <field name="iframe" type="zope.schema.Text">
    <title>Complete iframe code from youtube</title>
  <field name="height" type="zope.schema.Float">
    <description>Divide height by width. 16:9 (9/16) = 56.25</description>
    <title>Height (ratio) in percent</title>

and the py

def editmode(self):
form = self.request.form
if  '_layouteditor' in form:
    return True
if  'disabled' in
    return['disabled']  == False
return True
1 Like

this is a good workaround, but I still am concerned that "core mosaic" (can I call it that?) is broken as long as is broken. Insert->Media->Embed will not do youtube, and I think that's a big feature of mosaic.

Ok, it's in . I'd like to raise the question - should this package really depend on the proper functioning of ? That site seems to be unmaintained.

I never use the standard embed, since it is not responsive..

That said: I did a test on a site that I am working on, and the standard approach works for me.

By standard approach, I mean

  1. In tinyMCE, select "insert media"
  2. Paste the Youtube Url.
  3. Save
  4. Reload (view) page

I noticed the same issue 2 days ago, was still investigating myself. At first only a few URL's/video's would break at's api and return 503, but others kept working fine. (You can test at https://noembed/com/demo .

Also in my case some recent vidoes but also older ones (> 2 yeers) from a customers channel would randomly break and others still worked. With one video there was even a variation in it if you use or in the request URL to the service :-S . But it seems to deteriorate now with more and more videos becoming unavailable.

Another observation:
I customised/extended the default embed tile with some styling options and I also did some rewrites on the url to

But now that I'm debugging my code tile that does this it seems 100% broken because I was depending on a url key being returned in the json response from It's no longer there in the answer and it's also not in the oEmbed answer I get directly from Youtube's oembed api. But I have no clue if noembed was adding this before or if Youtube changed this and noembed was only passing it along.

Fortunately in my project this extended Embed tile was already relabeled to a 'youtube tile', so I don't need the provider choosing and will query directly.

I remember reading somewhere in november or december that Youtube is planning on removing the option alltogether in the near future: take it with tracking/advertising cookies or host your video's somewhere else. :-/

Maybe, but on the other hand it is quite weird (from a UI point of view) that there is a (Media) tile to insert video, but no tile to insert an image.

Inserting them from the same place (TinyMCE) is as logic (I think).

Alternatively, you could make a theme fragment (or tile) just for youtube and put all the 'iframe stuff' inside the template and replace only the url.

1 Like

I am sorry for this :frowning:

NOEMBED_ENDPOINT was always a module global in at master · plone/ · GitHub so that it could be customized in policy package to point to local deployment, but of course that was never documented anywhere. Also, an environment variable could have been better choice. Module globals just were a convention back then.

Also, there was no obvious easy-to-use alternative, because available libraries were generic oEmbed libraries requiring some custom configuration for each supported service.

Fix for this particular Youtube issue is here Fix YouTube provider to use https instead of http by datakurre · Pull Request #5 · noembed/noembed · GitHub

With a little bit of love that tile could also support maxwidth and maxheight options supported by noembed.

1 Like

Some has done it GitHub - iamcal/oembed: The oEmbed Spec

Would anyone be able to test and help to finish this Replace dependency on noembed with python-oembed and list of providers by datakurre · Pull Request #110 · plone/ · GitHub ?

The branch would


Hi Asko. No reason to feel guily about this. I was always aware of this feature and dependency on noembed, but too lazy to host our separate service.

I've debugged this issue quite a bit this week to see if I could find a pattern and I'm not so sure if the https is the only reason for the breakage. I've tested quite a bit of video's on different channels and for some breaks and for others the service works flawlessly. I'm also uncertain if the still working lookups (80%?) I counted wored because of caching of still succesful responses, then I would have expected to slowly see more and more queries fail.

Maybe we should/could host a copy on one of the Plone Foundation managed servers?

1 Like

Noembed does have memcached support in its code. (And Plone uses ram.cache with just URL as its cache key.)

Plone Foundation Code of Conduct