Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.js.oembed

How to install collective.js.oembed

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.js.oembed
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0a Available View build log
Windows (64-bit)
1.0a Available View build log
Mac OS X (10.5+)
1.0a Available View build log
Linux (32-bit)
1.0a Available View build log
Linux (64-bit)
1.0a Available View build log
 
License
GPL
Dependencies
Lastest release
version 1.0a on Jan 3rd, 2012

Introduction

This addon register the jquery plugin oembed in the Plone resource registry.

Version: 1.1.0 RC

How to use jquery.oembed

Explicit example:

<script type="text/javascript">
$(document).ready(function() {
        $("#container").oembed("http://www.flickr.com/photos/14516334@N00/345009210/");
});
</script>
<div id="container"></div>

Implicit example:

<script type="text/javascript">
        $(document).ready(function() {
                $("a.oembed").oembed();
        });
</script>
<div><a href="http://www.flickr.com/photos/14516334@N00/345009210/" class="oembed">Flickr Image</a></div>
<div><a href="http://vimeo.com/3108686" class="oembed">Vimeo Video</a></div>
Configuring multiple providers example
<script type="text/javascript">
        $(document).ready(function() {
                $(".oembed").oembed(null,
                        {
                        embedMethod: "append",
                        maxWidth: 1024,
                        maxHeight: 768,
                        vimeo: { autoplay: true, maxWidth: 200, maxHeight: 200}
                        });
        });
</script>
<div><a href="http://vimeo.com/3108686" class="oembed">Vimeo Video</a></div>
<div><a href="http://www.flickr.com/photos/14516334@N00/345009210/" class="oembed">Flickr Image</a></div>
Supported OEmbed providers
  • 5min
  • Amazon Product Images
  • Flickr
  • Google Video
  • Hulu
  • Imdb
  • Metacafe
  • Myspace Videos
  • Qik
  • Revision3
  • Screenr
  • Slideshare
  • Twitpic
  • Viddler
  • vVimeo
  • Wikipedia
  • WordPress
  • YouTube

This javascript plugin relays in 'jsonp', so only oEmbed providers that support callback methods are directly implemented.

Any other oEmbed provider uses embedly service.

How to manage providers

'greedy' option let you activate a fallback service to not natively supported services, by default the service used is oohembed.

allowed providers:

$(".oembed").oembed(null, { allowedProviders: ["flickr", "youtube"] });

custom providers:

$(".oembed").oembed(null, {
    greedy: false,
    customProviders: [{
        "name": "streetfire.net",
        "urlschemes": ["streetfire\\.net\/video\/.*"],
        "apiendpoint": "http://api.embed.ly/v1/api/oembed?"
    }]
});

disallowed providers:

$(".oembed").oembed(null, { disallowedProviders: ["flickr", "youtube"] });

default oembed provider:

$(".oembed").oembed(null, {defaultOEmbedProvider: "embed.ly"});
embeded method

append:

$(".oembed").oembed(null, {embedMethod: "append"});

It append to the .oembed container the result with a container classified:

<a href="..." class="oembed">...</a>
<div class="oembed-container oembed-container-Vimeo">...</div>

fill:

$(".oembed").oembed(null, {embedMethod: "fill"});

It fill the link with the results:

<a href="..." class="oembed">
  <div>...</div>
</a>

replace:

$(".oembed").oembed(null, {embedMethod: "replace"});

It replaces the link with the html snippet

manage size

You can add a size constraint to the html snippet. You can set maxWidth and/or maxHeight:

$(".oembed").oembed(null, {
        maxWidth: 400,
        maxHeight: 300 });
});

Credits

Companies

makinacom

Authors

Contributors

Changelog

1.0a (2012-01-02)
  • Initial release

Subscribe to package updates

Last updated Jan 3rd, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.