Hello,
The Embed library can extract info from BBC or CNN, but this module wont.

URL Embed should work with everything that works with the Embed library or I'm missing something?
With Youtube or Facebook the module works as expected.

Thanks

CommentFileSizeAuthor
#12 Selection_002.png50.73 KBjuampynr
#10 2864302-10.patch1.23 KBmarcoscano
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gge created an issue. See original summary.

marcoscano’s picture

Issue tags: +D8Media
marcoscano’s picture

I believe that as of today this module works with any adapters that implement the ::getCode() method. Not all of the supported ones do.

You can go to https://oscarotero.com/embed2/demo/ and test the URL you are trying to fetch. Wathever you see under the CODE section on that page is what is going to be rendered when embedding this URL into a wysiwyg.

Dave Reid’s picture

You can see in the Embed library responses that it's returning a type of link and the response does not include the code property to embed. You would need to file an issue with the Embed library itself.

gge’s picture

Status: Active » Closed (works as designed)

I did notice that empty property, but I thought that URL Embed will grab the image instead.

Thanks for clarifying!

I will file an issue on GitHub.

Dave Reid’s picture

Title: Doesn't work with BBC or CNN » Add validation to ensure URL is embeddable
Component: Code » User interface
Category: Bug report » Feature request
Status: Closed (works as designed) » Active

It might make sense to kind of re-purpose this to help avoid this problem for others in the future. What if we added validation to the Embed form that checks to make sure the URL is actually embeddable?

marcoscano’s picture

+1 for the validation.
This was more or less the idea behind #2761187: Improve how the module deals with non-embeddable URLs (although looking now at that patch I'm not sure I agree with that solution either...). Whatever gives the user some feedback is going to be useful.

gge’s picture

Hi,

Glad to see this re-opened :) The proposal #2761187: Improve how the module deals with non-embeddable URLs is a good start, but I don't understand why valid URLs should be considered only those with code not empty.
I think if that property is empty, the user should have an option to embed other properties like title, description, image.

Thanks.

Dave Reid’s picture

Yeah, I think that's totally valid, but also a much more complex issue since we're having to build new things to support that workflow. Right now restricting to things that have an embeddable 'code' is easy since it's there for us, which is why adding the validation now might make sense to avoid the problem in the near future, while we figure out what the longer-term way to solve it.

marcoscano’s picture

Status: Active » Needs review
FileSize
1.23 KB

Something like this seems to work for me.

juampynr’s picture

Status: Needs review » Reviewed & tested by the community

This works great. At the moment if you enter an unsupported URL, the <drupal-url> tag is created but the editor does not render it, nor it is shown when the content is viewed which is confusing for editors.

juampynr’s picture

Issue summary: View changes
FileSize
50.73 KB

Here is how it looks like:

BarisW’s picture

Great patch! Based on this code, I added an alter hook in this validation, to be able to block certain providers: #3033293: Add an option to alter the list of providers

mpp’s picture

#10 works but shouldn't we solve this with a Constraint on the link field?

This would require an API change as the field itself needs to be marked as a "url_embed" link and we'd need an isApplicable() on the FieldFormatter to check if the field is a url_embed field.

navneet0693’s picture

Status: Reviewed & tested by the community » Needs work

I wouldn't say this fixes the original problem of handling the non-embeddable URLs. Adding a validation which stops user from adding a link altogether is not a viable solution.

navneet0693’s picture

navneet0693’s picture

If the scope of this issue is just add a validation, then this can be set to RTBC again.