Set download URL via setter

This commit is contained in:
Sam Potts
2019-04-12 19:00:17 +10:00
parent e281078441
commit cdacae6697
4 changed files with 20 additions and 7 deletions

View File

@ -823,6 +823,19 @@ class Plyr {
return is.url(download) ? download : this.source;
}
/**
* Set the download URL
*/
set download(input) {
if (!is.url(input)) {
return;
}
this.config.urls.download = input;
controls.setDownloadUrl.call(this);
}
/**
* Set the poster image for a video
* @param {String} input - the URL for the new poster image