0.5.0 • Published 7 years ago
ndla-video-search v0.5.0
ndla-video-search
A simple library for selecting NDLA videos.
Installation
$ npm install ndla-video-searchExample 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 referenceGet 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
| Props | Type | Required | Description |
|---|---|---|---|
| onVideoSelect | func | * | |
| searchVideos | func | * | |
| translations | object | * | |
| locale | string | * | |
| enabledSources | array |
0.5.0
7 years ago
0.5.0-1
7 years ago
0.5.0-0
7 years ago
0.4.0
7 years ago
0.3.0
7 years ago
0.2.7
8 years ago
0.2.6
8 years ago
0.2.5
8 years ago
0.2.4
8 years ago
0.2.3
8 years ago
0.2.3-0
8 years ago
0.2.2
8 years ago
0.2.1
8 years ago
0.2.0
8 years ago
0.1.19
8 years ago
0.1.18
8 years ago
0.1.17
8 years ago
0.1.16
8 years ago
0.1.15
8 years ago
0.1.14
8 years ago
0.1.13
8 years ago
0.1.12
8 years ago
0.1.10
8 years ago
0.1.9
8 years ago
0.1.8
8 years ago
0.1.7
8 years ago
0.1.6
8 years ago
0.1.5
8 years ago
0.1.4
8 years ago
0.1.3
8 years ago
0.1.2
8 years ago
0.1.1
8 years ago