and especially what code need be written to make a post oEmbed'able?

Thx in advance

Comments

Flying Drupalist’s picture

Subscribe

voxpelli’s picture

You would need to activate the oEmbed Provider module - then all of your node/123 url:s will be exposed through oEmbed. The workflow and customization of this should be improved though - but it's at least working for now :)

cvedovini’s picture

I did that and it does not seem to work.
Anyway, I would like to customize the embed code, my nodes contain CCK videos fields and I need the videos to be embeddable.

voxpelli’s picture

If I remember correctly you can override the "oembed_node" theme function to customize what the embed looks like. Currently no other types than rich is supported though - that would need further development.

cvedovini’s picture

I can see in the last release there are hooks for theming.

However, when I navigate to /services/oembed I get 404
I saw in the code that the oEmbed Provider module seems to expose its API on /oembed/endpoint but when I navigate to /oembed/endpoint?url=http%3A//localhost/node/2 I get the following response:

{"type":"rich","version":"1.0","provider_name":"blah","width":0,"height":0,"title":"Not found","error":1,"html":"Could not find a provider that supports this url"}

Even if I finally find how /oembed/endpoint is working how's Facebook supposed to embed my posts given the spec says the API endpoint should be /services/oembed?

UPDATE:
I just made a test asking the embed code of a youtube video to my server on /oembed/endpoint and it worked!!!
I think something is upside down, I don't want my site to be an oEmbed provider for YouTube but for my own content.

voxpelli’s picture

I will digg deeper into this issue when I've time

cvedovini’s picture

Hi, I found two things that could help solving my problems with this module :)

1. "Could not find a provider that supports this url" issue

despite what I put in the previous comment my urls are in the form "node/nodeId" I use nice urls and pathauto. However the regex that is used in the oembedprovider hook of oembedprovider module specify node/* (line 80 of oembedprovider.module)

function oembedprovider_oembedprovider() {
  $base_url = url('', array('absolute' => TRUE)) . 'node/*';
  return array(
    $base_url => array(
      'callback' => 'oembedprovider_node_provider',
    ),
  );
}

I replaced it with the following:

function oembedprovider_oembedprovider() {
  $base_url = url('', array('absolute' => TRUE)) . '*';
  return array(
    $base_url => array(
      'callback' => 'oembedprovider_node_provider',
    ),
  );
}

and now the API is returning something (though I will have to theme the output I guess)

2. API endpoint

After some research I was baffled by the fact that no provider is actually using the same API endpoint and realized that it was actually not enforced in the specifications...
There, I thought that oEmbed was useless if I need to ask Facebook (or any oEmbed plugin provider) to register my site in their list of providers. I then found out that some providers are specifying the API endpoint in the headers of the resource. For example, YouTube have this kind of thing in their headers:

<link rel="alternate" type="application/json+oembed" href="http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3Dp9b4os8S1U4&format=json" title="Thank You" />
<link rel="alternate" type="text/xml+oembed" href="http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3Dp9b4os8S1U4&format=xml" title="Thank You" />

But Flickr doesn't...
I am going to try add that to my site and see what happens.

Regards

Flying Drupalist’s picture

Do you have to ask embed.ly or some other service to add your site?
@cvedovini hows it going?

voxpelli’s picture

@flying: Most oEmbed consumers will need to add information about providers prior to embedding content from them and especially so with Embed.ly. I actually don't know if Embed.ly consumes oEmbed itself or if it's only an oEmbed provider.

As stated in #7 there is a simple autodiscovery mechanism in the oEmbed standard but I haven't bothered supporting it yet since the way it's now constructed would make it very hard to use by consumers. The autodiscovery should be built around patterns, not around absolute URL:s so I would probably push for a new standard rather than implementing the current one - if no one can show any important consumers of the current standard that is.

I still haven't got time revisiting the provider part of this module either - unfortunately.

toemaz’s picture

Use template.php to override the standard theme_oembed_node function:

function phptemplate_oembed_node($node) {
  return [your embed code];
}
jlyon’s picture

This worked great for me.

socialnicheguru’s picture

Issue summary: View changes

Can you outline the steps necessary to make my site an oembed provider.

theodorosploumis’s picture

I am looking for any Documentation about this too. Could not find anything except that the path for embed is:

/oembed/endpoint?url=

astonvictor’s picture

Status: Active » Closed (outdated)

D6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.