aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2019-01-26 17:20:18 +1100
committerGitHub <noreply@github.com>2019-01-26 17:20:18 +1100
commitdc54eba8f8dfc79ce51fe8ca47bb0e252fccf1b4 (patch)
tree9f9e927b6ecbeba39c2a6dfc1b51b2d750b352db
parent8b57104f8396c4110f217c854099243d8d04ae20 (diff)
parenta84fc396e8a53fd595c204deff227104b0255865 (diff)
downloadplyr-dc54eba8f8dfc79ce51fe8ca47bb0e252fccf1b4.tar.lz
plyr-dc54eba8f8dfc79ce51fe8ca47bb0e252fccf1b4.tar.xz
plyr-dc54eba8f8dfc79ce51fe8ca47bb0e252fccf1b4.zip
Merge pull request #1319 from fanmio/issues/1316-allow-to-customize-vimeo-url-params
Adds options for vimeo plugin #1316
-rw-r--r--demo/src/js/demo.js3
-rw-r--r--readme.md1
-rw-r--r--src/js/config/defaults.js9
-rw-r--r--src/js/plugins/vimeo.js10
4 files changed, 18 insertions, 5 deletions
diff --git a/demo/src/js/demo.js b/demo/src/js/demo.js
index 8520615a..5df96208 100644
--- a/demo/src/js/demo.js
+++ b/demo/src/js/demo.js
@@ -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
diff --git a/readme.md b/readme.md
index f1324108..3651ed8a 100644
--- a/readme.md
+++ b/readme.md
@@ -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 advertisements. `publisherId`: Your unique [vi.ai](https://vi.ai/publisher-video-monetization/?aid=plyrio) 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. |
| `previewThumbnails` | Object | `{ enabled: false, src: '' }` | `enabled`: Whether to enable the preview thumbnails (they must be generated by you). `src` must be either a string or an array of strings representing URLs for the VTT files containing the image URL(s). Learn more about [preview thumbnails](#preview-thumbnails) below. |
1. Vimeo only
diff --git a/src/js/config/defaults.js b/src/js/config/defaults.js
index 8aaf0166..650bcd2a 100644
--- a/src/js/config/defaults.js
+++ b/src/js/config/defaults.js
@@ -415,6 +415,15 @@ const defaults = {
enabled: false,
src: '',
},
+
+ // Vimeo plugin
+ vimeo: {
+ byline: false,
+ portrait: false,
+ title: false,
+ speed: true,
+ transparent: false,
+ },
};
export default defaults;
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js
index c0bcf8af..5fcd9ac8 100644
--- a/src/js/plugins/vimeo.js
+++ b/src/js/plugins/vimeo.js
@@ -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,
};