@ndla/video-search
TypeScript icon, indicating that this package has built-in type declarations

8.0.70-alpha.0 • Public • Published

ndla-video-search

A simple library for selecting NDLA videos

Installation

yarn add @ndla/video-search
npm install @ndla/video-search

Example usage

Get video with the video selector

To use the VideoSearch component, you will need to provide translations and a function for searching for videos.

import { VideoSearch, VideoQueryType } from "@ndla/video-search";
import { BrightcoveApiType } from "@ndla/types-embed";

const onVideoSelect = (image: BrightcoveApiType) => {
  // handle video
};

const searchVideos = (query: VideoQueryType) => {
  //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",
  is360Video: "360 video",
  close: "Close",
};

<VideoSearch onVideoSelect={onVideoSelect} searchVideos={searchVideos} translations={translations} locale="nb" />;

Readme

Keywords

Package Sidebar

Install

npm i @ndla/video-search

Weekly Downloads

288

Version

8.0.70-alpha.0

License

GPL-3.0

Unpacked Size

62.3 kB

Total Files

17

Last publish

Collaborators

  • ndlauser
  • jonasc-knowit
  • gunnarvelle
  • jnatten
  • kronen_ki
  • katrinewi
  • rauboti
  • mapoken