This commit is contained in:
parent
341932fd0e
commit
230f542b54
@ -27,7 +27,18 @@
|
|||||||
const canPlayType = (canPlayTypeRaw === "maybe") || (canPlayTypeRaw === "probably");
|
const canPlayType = (canPlayTypeRaw === "maybe") || (canPlayTypeRaw === "probably");
|
||||||
if(canPlayType) {
|
if(canPlayType) {
|
||||||
const Button = videojs.getComponent("Button");
|
const Button = videojs.getComponent("Button");
|
||||||
const Component = videojs.getComponent("Component");
|
const DownloadButton = videojs.extend(videojs.getComponent("Component"), {
|
||||||
|
createEl: () => {
|
||||||
|
const elem = document.createElement("a");
|
||||||
|
elem.href = info.download;
|
||||||
|
elem.classList.add("vjs-control");
|
||||||
|
elem.classList.add("vjs-button");
|
||||||
|
elem.classList.add("fas");
|
||||||
|
elem.classList.add("fa-download");
|
||||||
|
elem.classList.add("vjs-big-download");
|
||||||
|
return elem;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const cbutton = {};
|
const cbutton = {};
|
||||||
cbutton.clickHandler = (ev) => {
|
cbutton.clickHandler = (ev) => {
|
||||||
@ -35,9 +46,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bigCastButtonWrapper = new Button(player, cbutton);
|
const bigCastButtonWrapper = new Button(player, cbutton);
|
||||||
const bigDownloadButtonWrapper = new Component(player);
|
const bigDownloadButtonWrapper = new DownloadButton(player);
|
||||||
bigDownloadButtonWrapper.el_ = document.createElement("a");
|
|
||||||
|
|
||||||
const bigCastButton = bigCastButtonWrapper.el();
|
const bigCastButton = bigCastButtonWrapper.el();
|
||||||
const bigDownloadButton = bigDownloadButtonWrapper.el();
|
const bigDownloadButton = bigDownloadButtonWrapper.el();
|
||||||
|
|
||||||
@ -47,14 +57,8 @@
|
|||||||
bigCastButton.classList.add("fa-chromecast");
|
bigCastButton.classList.add("fa-chromecast");
|
||||||
bigCastButton.classList.add("vjs-big-chromecast");
|
bigCastButton.classList.add("vjs-big-chromecast");
|
||||||
player.addChild(bigCastButtonWrapper);
|
player.addChild(bigCastButtonWrapper);
|
||||||
|
|
||||||
if(info.download) {
|
if(info.download) {
|
||||||
bigDownloadButton.href = info.download;
|
|
||||||
bigDownloadButton.classList.add("vjs-control");
|
|
||||||
bigDownloadButton.classList.add("vjs-button");
|
|
||||||
bigDownloadButton.classList.add("fas");
|
|
||||||
bigDownloadButton.classList.add("fa-download");
|
|
||||||
bigDownloadButton.classList.add("vjs-big-download");
|
|
||||||
player.addChild(bigDownloadButtonWrapper);
|
player.addChild(bigDownloadButtonWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user