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