0.1.0 • Published 5 months ago

staffbase-widget-dacast v0.1.0

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

staffbase-widget-dacast

This custom widget plugin for Staffbase was bootstraped with @staffbase/create-widget. Learn more about Staffbase Custom Widgets here.

Motivation

The Dacast platform provides 2 mechanisms for embedding its video player in external sites: Via an <iframe>, or via a <script> tag. Staffbase's built-in embeded content plugin allows editors to load a given URL in an <iframe>, but for security it does not permit the use of <script> tags in its pages. However, Dacast's Domain Control functionality only works from <script> embeds. To close this gap, this custom widget provides a simple wrapper for Dacast's <script> embedding. This allows Domain Control to limit the player to being loaded only from those domains specified in its configuration; presumably, only from your Staffbase site domain.

The widget accepts a single property: the Content ID for a DaCast Player.

Demo Screenshot

Demo

Installation

$ npm install

TODO:

  • Fix dynamic sizing headaches
  • Publish NPM Module
  • Explain Staffbase Installation

Running the app

CommandDescription
npm startStarts the development server
npm run buildCreates the production build
npm run build:watchCreates the production build and watch for changes
npm run testRuns the unit tests
npm run test:watchRuns the unit tests and watches for changes
npm run type-checkChecks the codebase on type errors
npm run type-check:watchChecks the codebase on type errors and watches for changes
npm run lintChecks the codebase on style issues
npm run lint:fixFixes style issues in the codebase

Building the form for configuration

This project uses react-jsonschema-form for configuring the widget properties. For more information consult their documentation