aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-10-24 22:31:35 +1100
committerSam Potts <sam@potts.es>2018-10-24 22:31:35 +1100
commit03c9b53232aeab78a7c592e1bcf387312f77a569 (patch)
treefc845c092d209e7c78fb0d412e738dc39d278ef1 /src/js/plyr.js
parentebaded66b4c1f05b7b323b968fbe506002c8f019 (diff)
downloadplyr-03c9b53232aeab78a7c592e1bcf387312f77a569.tar.lz
plyr-03c9b53232aeab78a7c592e1bcf387312f77a569.tar.xz
plyr-03c9b53232aeab78a7c592e1bcf387312f77a569.zip
Allow custom download URL (for streaming, etc)
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 77582dd7..d549b177 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -789,6 +789,15 @@ class Plyr {
}
/**
+ * Get a download URL (either source or custom)
+ */
+ get download() {
+ const { download } = this.config.urls;
+
+ return is.url(download) ? download : this.source;
+ }
+
+ /**
* Set the poster image for a video
* @param {input} - the URL for the new poster image
*/