Socket
Book a DemoInstallSign in
Socket

ndla-video-search

Package Overview
Dependencies
Maintainers
5
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ndla-video-search

A simple library for searching NDLA videos

latest
Source
npmnpm
Version
0.5.0
Version published
Maintainers
5
Created
Source

A simple library for selecting NDLA videos.

Installation

$ npm install ndla-video-search

Example usage

Styling

/* Your project's main .scss import file */
@import '~ndla-video-search/scss/video-search'; // with webpack and sass-loader
@import '../path/to/node_modules/ndla-video-search/scss/video-search'; // direct reference

Get video with the video selector

To use the VideoSearch component, some functions for handling search and fetching video is needed. In addition, some translations is needed.

import VideoSearch from 'ndla-video-search';

const videoSelector = image => {
  // handle video
};

const searchVideos = (query, type) => {
  //return a promise
};

const translations = {
  searchPlaceholder: 'Search videos',
  searchButtonTitle: 'Search',
  loadMoreVideos: 'Load more videos',
  noResults: 'Noe videos found',
  addVideo: 'Use video',
  previewVideo: 'Preview',
  publishedDate: 'Published date',
  duration: 'Duration',
  interactioncount: 'Views',
};

<VideoSearch
  onVideoSelect={videoSelector}
  searchVideos={searchVideos}
  translations={translations}
  locale="nb"
  enabledSources={['Brightcove', 'YouTube']}
/>;

PropTypes

PropsTypeRequiredDescription
onVideoSelectfunc*
searchVideosfunc*
translationsobject*
localestring*
enabledSourcesarray

Keywords

ndla

FAQs

Package last updated on 01 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts