Giter Site home page Giter Site logo

collective.oembed's Introduction

Introduction

This addon integrate oembed into Plone. You can find a demo at http://youtu.be/kHikGIWrvCs

oEmbed official documentation: http://http://oembed.com/

oembed provider

Your site will become an oembed provider using @@oembed view as an endpoint:

URL Scheme: http://mysite.com/*
API endpoint: http://mysite.com/@@oembed
Supports discovery via <link> tags

oembed client

This addon provide an integration of jquery.oembed plugin. Because there are many fork you have to choose the one you will use. The official plugin has been integrated to plone throw the addon collective.js.oembed

The oembed client is integrated using a viewlet that is not activated by default. You have to activate it throw the controlpanel. It is configured that way:

<script type="text/javascript">
  jqueryOmebedSettings = {...} //extracted from the controlpanel
</script>
<script type="text/javascript">
        $(document).ready(function() {
            $(".oembed").oembed(null,jqueryOmebedSettings);
        });
</script>

consumer

A consumer is availabe throw a utility:

>>> url = "http://www.youtube.com/watch?v=it1hMtZKle8"
>>> consumer = component.getUtility(collective.oembed.interfaces.IConsumer)
>>> consumer.get_data(url, maxwidth=300, maxheight=None, format='json')
{...}

There is also a @@collective.oembed.consumer view, which can take params throw attributes:

>>> consumer_view = component.queryMultiAdapter((self.context,self.request),
...                                 name=u'collective.oembed.consumer')
>>> consumer_view._url = url
>>> consumer_view.embed_auto()
<div class="oembed-wrapper oembed-video">...</div>

OEmbed link view

This addon register an oembed view to the Link content type. It displays content provided from the remote url and do not set maxwidth & maxheight. It should be achieved by integrators.

The link view stores 3 different lists of components:

oembed:

Contains registered views of type oembed_view , able to get the html embed template from the targetted provider's oembed api (see below for a list of currently supported providers).

api2embed:

NOT IMPLEMENTED YET

If you have an API key for the targeted website, you should be able to use it through those views. Once this feature is implemented, you should be able to choose whether you want to activate it or not.

url2embed:

Contains registered views of type url2embed_view, which get the embed template directly from the target's url. Used as a fallback for websites who do not support the oEmbed format.

NOTE:
While the returned data will be sufficient to embed the target widget in your view, you won't be able to access the metadata which could have been associated with it in a straight oEmbed format.

All three lists are checked in the same order as they're presented here, and the first valid component found is used to get the embed code. If no match at all is found, then nothing will be displayed.

Check endpoint.csv to see which of those views are currently supported for each service.

Embed.ly

This addon can use embed.ly service. You can set the embed.ly api key in the control panel or install and configure collective.embedly, this addon will use the configuration provided by this one.

Providers

embed.ly is activated only if you have added an api_key or configured collective.embedly. The addon provide native support for the following services:

External providers:

Video providers:

Photo providers:

Rich providers:

Other Plone addons

Credits

Companies

makinacom

Authors

Contributors

collective.oembed's People

Contributors

toutpt avatar raphigaziano avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.