1.7.4 • Published 5 months ago

oovvuu-plugin v1.7.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

oovvuu-plugin

Oovvuu Plugin provides a simple way for publishers to embed videos into their articles without leaving their CMS.

Table of Contents

Usage

via jsDelivr

<script src="https://cdn.jsdelivr.net/npm/oovvuu-plugin@1/dist/oovvuu-plugin.min.js"></script>
<script>
  oovvuuPlugin.setConfig({
    clientId: "client-id",
    cmsName: "cms-name",
    articleId: "article-guid",
    onAddEmbed: (embed) => {
      // Implement this to insert the embed code into the article
      console.log(JSON.stringify(embed, null, 2));
    },
    headline: "article-headline",
  });
  console.log(oovvuuPlugin.version);
</script>

...

<button onclick="oovvuuPlugin.open()">Select Videos</button>

Icons

Oovvuu logos are available via jsDelivr.

ImageExample
oovvuu-logo.png
oovvuu-mark.png

Example use in buttons

<button>
  <img
    src="https://cdn.jsdelivr.net/npm/oovvuu-plugin/assets/oovvuu-logo.png"
    height="20"
  />
</button>

<button>
  <img
    src="https://cdn.jsdelivr.net/npm/oovvuu-plugin/assets/oovvuu-mark.png"
    height="20"
  />
  Select Videos
</button>

API

oovvuuPlugin

The core interface of the plugin.

Properties

NameTypeDescription
versionstringThe current version of the plugin.

Functions

close(): void

This closes the plugin.

getConfig(): CmsConfig

This gets the configuration for the plugin. It raises an exception if the configuration is not set.

open(config?: CmsConfig): void

This opens the plugin. An optional config may be passed as a convenience; it can be partial similar to setConfig.

setConfig(config: CmsConfig): void

This sets the configuration for the plugin. It allows partial updates to the configuration.

handleLoginCallback(): Promise<void>

This sets the handles the Auth0 login callback after a redirect login.

// Update some configuration leaving the rest as is.
oovvuuPlugin.setConfig({
  articleId: "new-article-id",
  headline: "new-article-headline",
  onAddEmbed: (embed) => {
    // do something
  },
});

Types

CmsConfig

A configuration object for the plugin.

Properties

NameTypeDescription
articleIdstringThe unique identifier for the article.
clientIdstringA customer-specific identifier that will be used in the authentication process.
cmsNamestringA globally unique name for the publisher's Content Management System, such as its domain name.
headlinestringThe headline of the article.
loginCallbackPathstringThe callback path used to handle Auth0 login callback. This page needs to call handleLoginCallback()

Functions

onAddEmbed(embed: Embed): void

A JavaScript callback that is invoked every time the user creates an embed. The embed object is passed in.

onClose(): void

A JavaScript callback that is invoked when the plugin is closed.

Embed

The embed object passed to the onAddEmbed callback.

Properties

NameTypeDescription
ampEmbedCodestringAn HTML embed to be used on amp pages.
articleIdstringThis is the id of the article as set in the plugin configuration.
displayTitlestringA title that can be displayed above the video or collection for display purposes.
embedCodestringThe full embed code for the chosen video or collection.
embedIdstringThe unique identifier for the embed of the chosen video or collection.
headlinestringThe headline for the article.
linkToDownloadThumbnailstringA URL from where the poster image for the chosen video or collection can be downloaded.
playerScriptUrlstringThe url for Oovvuu’s playback script.

Redirect Login Flow

In cases where the popup login flow is blocked by CORS, we allow the use of a redirect login flow.

This requires a dedicated page to load the plugin for handling the callback. This page needs to only call the oovvuuPlugin.handleLoginCallback() function which will handle the login and return the user to the previous page.

<script src="https://cdn.jsdelivr.net/npm/oovvuu-plugin@1/dist/oovvuu-plugin.min.js"></script>
<script>
  oovvuuPlugin.setConfig({
    clientId: "client-id",
    loginCallbackPath: "/path-for-callback",
  });
</script>

<script>
  // Wait for page to load before attempting to call
  window.addEventListener("load", function () {
    oovvuuPlugin.handleLoginCallback();
  });
</script>

Author

Oovvuu

License

See the LICENSE file for license rights and limitations (MIT).

1.8.1

3 days ago

1.7.4

5 months ago

1.7.3

6 months ago

1.7.2

6 months ago

1.8.0

6 months ago

1.7.1

9 months ago

1.7.0

9 months ago

1.6.0

10 months ago

1.5.1

11 months ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago