Skip to content

Geta/oEmbed

Repository files navigation

oEmbed

  • Master
    Platform Platform

Description

EPiServer integration with bit.ly. This package contains an oEmbed block (properties: URL, max width, max height) plus view. An API key from bit.ly is mandatory to use this package.

Features

  • Configuration section in web.config
  • oEmbed block (URL, max width, max height) + view
  • oEmbedApi class to call APi
Install-Package Geta.oEmbed

After the package is installed you'll have to register a free account on embed.ly to get an API key. In your web.config you should at the bottom see <oEmbedSettings apikey="your-key-here" />. Replace your-key-here with the API key from embed.ly.

Add oEmbedBlock to one of your content types:

public virtual oEmbedBlock EmbedBlock { get; set; }

And in your view:

@Html.PropertyFor(m => m.CurrentPage.EmbedBlock)

There's also a HTML helper method you can use:

@Html.oEmbed(Model.CurrentPage.EmbedBlock)

That's it! Build and run your site. You'll now be able to embed any content from the supported 300 providers.

HTTPS support: In order to use secured protocol you need to enable it in oEmbed settings by adding secure="true" key. Only payed embed.ly plans support SSL, otherwise you will have HTTP Status: 400 error.

You can install the latest using NuGet from nuget.episerver.com.

You need an API key from embed.ly to use oEmbed. There's a free plan supported that supports upto 10 000 URLs each month (as well as paid plans with more options and support).

in Web.config:

<configSections>
    <section name="oEmbedSettings" type="Geta.oEmbed.Configuration.oEmbedSettings, Geta.oEmbed"/>
</configSections>
<oEmbedSettings apikey="your-key-here" />

For an introduction see: Introducing oEmbed for EPiServer and New version of Geta oEmbed.

Cache

By default we cache the response the with a dependency on Episerver. You can disable it in web.config configuration using: DisableCache=true.

Package maintainer

https://github.com/m-kovacina

Changelog

3.0.1.

  1. Added support for Episerver 11
  2. Removed old dynamic content support
  3. Removed legacy custom property

3.0.2.

  1. Added the latest Alloy sample site into solution
  2. oEmbed example added into sample site
  3. Added Docker support