Wrapper of google-youtube and Google YouTube APIs as a customizable Polymer 1.0 WebComponent in ES6 syntax.
🚧 Currently needs to be developed with more features. 🚧
<link rel="import" href="[your_bower_folder]/polymer-youtube-feed/youtube-feed.html">
<youtube-feed key="[YourKey]" q="[yourSearchParam]"></youtube-feed>
The component will install them.
$ bower install polymer-youtube-feed
/**
* API key of YouTube APIs
*/
key: {
type: String
},
/**
* Order of items
* (date|rating|relevance|title|videoCount|viewCount)
*/
order: {
type: String,
value: 'date'
},
/**
* Param of search
*/
q: {
type: String,
value: 'Never Gonna Give You Up'
},
/**
* Number of results
*/
maxResults: {
type: Number,
value: 5
},
/**
* Safe search for explicit content or standard content
* (moderate|none|strict)
*/
safeSearch: {
type: String,
value: 'moderate'
},
/**
* Video definition of the results
* (any|high|standard)
*/
videoDefinition: {
type: String,
value: 'any'
},
/**
* Thumbnails definition of the results (also depending on size)
* (high|medium|default)
*/
thumbDefinition: {
type: String,
value: 'high'
}
Load (or reload) content with the current properties if needed.
Type: string
The video id related to the video you want to show.
After the correct loading of the videos feed.
Changing the following properties will run a reload of the content:
q
order
Other properties must be force-reloaded with the loadContent()
method:
(e.g.)
var youtubeFeed = document.querySelector('youtube-feed');
youtubeFeed.set('videoDefinition', 'standard');
youtubeFeed.loadContent();
Of course you can set all properties directly on the element:
<youtube-feed
key="[YourKey]"
q="[yourSearchParam]"
video-definition="high"
order="title" thumb-definition="medium"></youtube-feed>
And so on.
Clone the repository inside a folder (ex: sandbox-youtube-feed/youtube-feed
) and inside the youtube-feed
folder:
$ yarn install && bower install
Developing mode: watch on base files and Babel that transpiles (http://localhost:8080/youtube-feed/demo)
$ yarn start
Build: only the Babel action simply run
$ yarn run build
Standard for coding style and WCT for unit test:
$ yarn test
MIT © LasaleFamine