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

6.0.10 • 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",
};

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

Readme

Keywords

Package Sidebar

Install

npm i @ndla/video-search

Weekly Downloads

147

Version

6.0.10

License

GPL-3.0

Unpacked Size

207 kB

Total Files

12

Last publish

Collaborators

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