Adds options for vimeo plugin #1316

This adds replaces hard coded vimeo options with options that can be passed to the Plyr instance when initializing.
This commit is contained in:
Christian Gambardella 2019-01-24 12:07:01 +01:00
parent c577eb01ce
commit 052e426810
4 changed files with 18 additions and 5 deletions

View File

@ -85,6 +85,9 @@ import Raven from 'raven-js';
'https://cdn.plyr.io/static/demo/thumbs/240p.vtt',
],
},
vimeo: {
transparent: true,
},
});
// Expose for tinkering in the console

View File

@ -335,6 +335,7 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke
| `loop` | Object | `{ active: false }` | `active`: Whether to loop the current video. If the `loop` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true This is an object to support future functionality. |
| `ads` | Object | `{ enabled: false, publisherId: '' }` | `enabled`: Whether to enable vi.ai ads. `publisherId`: Your unique vi.ai publisher ID. |
| `urls` | Object | See source. | If you wish to override any API URLs then you can do so here. You can also set a custom download URL for the download button. |
| `vimeo` | Object | `{ byline: false, portrait: false, title: false, speed: true, transparent: false }` | `byline`: Wheather to show the vimeo uploader. `portrait`: Wheather to show the vimeo portrait (avatar). `title`: Wheather to show the vimeo title. `speed`: Wheather to show speed controls. `transparent`: Makes the background transparent. Might be helpful to add your custom styles. |
1. Vimeo only

View File

@ -413,6 +413,15 @@ const defaults = {
previewThumbnails: {
enabled: false,
},
// Vimeo plugin
vimeo: {
byline: false,
portrait: false,
title: false,
speed: true,
transparent: false,
},
};
export default defaults;

View File

@ -70,11 +70,11 @@ const vimeo = {
loop: player.config.loop.active,
autoplay: player.autoplay,
muted: player.muted,
byline: false,
portrait: false,
title: false,
speed: true,
transparent: 0,
byline: player.config.vimeo.byline,
portrait: player.config.vimeo.portrait,
title: player.config.vimeo.title,
speed: player.config.vimeo.speed,
transparent: player.config.vimeo.transparent === true ? 1 : 0,
gesture: 'media',
playsinline: !this.config.fullscreen.iosNative,
};