Would love this feature too, using naming to achieve sorting can be a mess...
@TwoD, thanks for your detailed review.
I ran into this problem while implementing discovery mechanism on a site, which pages I want to consume video resources into drupal as oEmbed content (media remote video field).
oEmbed specification on oembed.com is really light, but I agree that "discovery" means looking into the page's discovery tags to identify (and request) the actual media source, which of course could be provided by another domain than the one implementing the discovery tags.
To sum it up from an integrator pov:
- site foo.com serves pages with video content provided by streaming provider bar.com, which implements a functional oembed endpoint
- bar.com player code is integrated as an iframe into foo.com pages
- foo.com pages having such a player implement discovery tags pointing to bar.com oembed endpoint and media
- drupal site baz.com wants to integrate content displayed on a foo.com page via oembed, and has foo.com and bar.com declared as custom providers using module oembed_providers
- when pasting the foo.com url into the media remote video field and try to save the media => error "The provided URL does not represent a valid oEmbed resource"
- when pasting the bar.com media url, which also implements discovery tags (self-pointed) into the media remote video field, media is embedded correctly.
How to reproduce easily:
- create a page containing discovery tags pointing to any youtube video, eg
<link rel="alternate" type="application/json+oembed" href="https://www.youtube.com/oembed?format=json&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKIDu6a9COmg" title="Panopticom" />
- host this page on your_domain.com
- in drupal, set your_domain.com as custom provider using module drupal/oembed_providers (see instructions)
- paste the your_domain.com url into the media remote video field => error "The provided URL does not represent a valid oEmbed resource"
Obviously this is a grey zone for many oEmbed implementations (same happens in wordpress core embed block).
oEmbed sourcing mechanism shoud be like:
- an url is pasted into the remote video field
- drupal checks discovery tags of the url page
- drupal requests oembed response using the oembed discovery tag href attribute, which domain MAY be different from the pasted url one
- if no discovery tags found, drupal (or modules) may eventually rely on some supported oEmbed directories
Finally, there are 2 useful online oEmbed checker:
- https://charhey.com/oembed: works correctly according to oEmbed sourcing mechanism above
- http://debug.iframely.com: although more popular, this one doesn't
I think this pb should really be addressed, as pasting a youtube url to integrate a video has become a very common practice, which should be made easily accessible to other media providers.
I'm available for any help testing if needed.
Thanks a lot John.
Hi John, many thanks for your return.
I'm an experienced Drupal integrator, but this is my first real approcach with commerce, so sorry if I still miss some concepts or best practices.
As you mentionned, I was on the track to not use the Add to cart form, to keep the process straightforward as only registrations are sold.
While awaiting your fixes, I will however setup the solution you suggest to see how it fits with the project.
Thanks John.
Tell me if you need a dump of the test site.
pmunch → created an issue.
@lthomasen Great solution thanks !