Merge branch 'develop' of https://github.com/sampotts/plyr into develop
This commit is contained in:
@ -42,11 +42,13 @@ Some awesome folks have made plugins for CMSs and Components for JavaScript fram
|
|||||||
| Type | Maintainer | Link |
|
| Type | Maintainer | Link |
|
||||||
| --------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
| --------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
| WordPress | Brandon Lavigne ([@drrobotnik](https://github.com/drrobotnik)) | [https://wordpress.org/plugins/plyr/](https://wordpress.org/plugins/plyr/) |
|
| WordPress | Brandon Lavigne ([@drrobotnik](https://github.com/drrobotnik)) | [https://wordpress.org/plugins/plyr/](https://wordpress.org/plugins/plyr/) |
|
||||||
|
| Angular | Simon Bobrov ([@smnbbrv](https://github.com/smnbbrv)) | [https://github.com/smnbbrv/ngx-plyr](https://github.com/smnbbrv/ngx-plyr) |
|
||||||
| React | Jose Miguel Bejarano ([@xDae](https://github.com/xDae)) | [https://github.com/xDae/react-plyr](https://github.com/xDae/react-plyr) |
|
| React | Jose Miguel Bejarano ([@xDae](https://github.com/xDae)) | [https://github.com/xDae/react-plyr](https://github.com/xDae/react-plyr) |
|
||||||
| Vue | Gabe Dunn ([@redxtech](https://github.com/redxtech)) | [https://github.com/redxtech/vue-plyr](https://github.com/redxtech/vue-plyr) |
|
| Vue | Gabe Dunn ([@redxtech](https://github.com/redxtech)) | [https://github.com/redxtech/vue-plyr](https://github.com/redxtech/vue-plyr) |
|
||||||
| Neos | Jon Uhlmann ([@jonnitto](https://github.com/jonnitto)) | [https://packagist.org/packages/jonnitto/plyr](https://packagist.org/packages/jonnitto/plyr) |
|
| Neos | Jon Uhlmann ([@jonnitto](https://github.com/jonnitto)) | [https://packagist.org/packages/jonnitto/plyr](https://packagist.org/packages/jonnitto/plyr) |
|
||||||
| Kirby | Dominik Pschenitschni ([@dpschen](https://github.com/dpschen)) | [https://github.com/dpschen/kirby-plyrtag](https://github.com/dpschen/kirby-plyrtag) |
|
| Kirby | Dominik Pschenitschni ([@dpschen](https://github.com/dpschen)) | [https://github.com/dpschen/kirby-plyrtag](https://github.com/dpschen/kirby-plyrtag) |
|
||||||
|
|
||||||
|
|
||||||
## Quick setup
|
## Quick setup
|
||||||
|
|
||||||
Here's a quick run through on getting up and running. There's also a [demo on Codepen](http://codepen.io/sampotts/pen/jARJYp). You can grab all of the source with [NPM](https://www.npmjs.com/package/plyr) using `npm install plyr`.
|
Here's a quick run through on getting up and running. There's also a [demo on Codepen](http://codepen.io/sampotts/pen/jARJYp). You can grab all of the source with [NPM](https://www.npmjs.com/package/plyr) using `npm install plyr`.
|
||||||
|
@ -401,10 +401,13 @@ const defaults = {
|
|||||||
publisherId: '',
|
publisherId: '',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// YouTube nocookies mode
|
||||||
|
noCookie: false,
|
||||||
|
|
||||||
// Preview Thumbnails plugin
|
// Preview Thumbnails plugin
|
||||||
previewThumbnails: {
|
previewThumbnails: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaults;
|
export default defaults;
|
||||||
|
@ -19,7 +19,7 @@ export const types = {
|
|||||||
*/
|
*/
|
||||||
export function getProviderByUrl(url) {
|
export function getProviderByUrl(url) {
|
||||||
// YouTube
|
// YouTube
|
||||||
if (/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/.test(url)) {
|
if (/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(url)) {
|
||||||
return providers.youtube;
|
return providers.youtube;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,6 +153,7 @@ const youtube = {
|
|||||||
// https://developers.google.com/youtube/iframe_api_reference
|
// https://developers.google.com/youtube/iframe_api_reference
|
||||||
player.embed = new window.YT.Player(id, {
|
player.embed = new window.YT.Player(id, {
|
||||||
videoId,
|
videoId,
|
||||||
|
host: player.config.noCookie ? 'https://www.youtube-nocookie.com' : undefined,
|
||||||
playerVars: {
|
playerVars: {
|
||||||
autoplay: player.config.autoplay ? 1 : 0, // Autoplay
|
autoplay: player.config.autoplay ? 1 : 0, // Autoplay
|
||||||
hl: player.config.hl, // iframe interface language
|
hl: player.config.hl, // iframe interface language
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
import is from './is';
|
import is from './is';
|
||||||
|
|
||||||
// Time helpers
|
// Time helpers
|
||||||
export const getHours = value => parseInt((value / 60 / 60) % 60, 10);
|
export const getHours = value => Math.trunc((value / 60 / 60) % 60, 10);
|
||||||
export const getMinutes = value => parseInt((value / 60) % 60, 10);
|
export const getMinutes = value => Math.trunc((value / 60) % 60, 10);
|
||||||
export const getSeconds = value => parseInt(value % 60, 10);
|
export const getSeconds = value => Math.trunc(value % 60, 10);
|
||||||
|
|
||||||
// Format time to UI friendly string
|
// Format time to UI friendly string
|
||||||
export function formatTime(time = 0, displayHours = false, inverted = false) {
|
export function formatTime(time = 0, displayHours = false, inverted = false) {
|
||||||
|
Reference in New Issue
Block a user