Creating an oEmbed Request Handler

To create your own site-specific oEmbed request handler:

  1. Copy LiveCenterOEmbedRequestHandler.properties from the plug-in installation into your webapp configuration layer (not the common configuration layer), and rename appropriately. For Flickr, for example, you might enter:

    $ cp /opt/escenic/engine/plugins/live-center/misc/siteconfig/com/escenic/livecenter/service/proxy/LiveCenterOEmbedRequestHandler.properties \
    > /etc/escenic/engine/common/com/escenic/livecenter/service/proxy/FlickrOEmbedRequestHandler.properties
  2. Open the copied file for editing and set the following properties as required:

    urlPatterns

    A comma-separated list of host names (not URL patterns as listed here) for which this handler is to be used. For Flickr, for example, you might want to set this property as follows:

    urlPatterns=flickr.com,flic.kr
    OEmbedUrlEndPoint

    The URL to which embed requests are to be sent. These URLs are included in the list of oEmbed providers

    requestHeaders.field-name

    These are optional properties that you can add if you want to include any special fields in the headers of your embed requests. field-name must be the name of an HTTP header field. To set the User-Agent field to some special value, for example, you would need to specify:

    requestHeaders.User-Agent=user-agent-string
  3. Register your request handler as described in Register Request Handlers.