From 52cb2d52aaca792eeb8fd41cbbe2e5dcff01d12c Mon Sep 17 00:00:00 2001 From: LKoren Date: Wed, 13 Apr 2022 15:21:00 +0200 Subject: [PATCH 1/2] Added mute config option When running on chromium or chrome if video is not muted autoplay won't work. Added mute option to enable autoplay when sound is not important. --- MMM-EmbedYoutube.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MMM-EmbedYoutube.js b/MMM-EmbedYoutube.js index 0870d2a..93e5d9f 100644 --- a/MMM-EmbedYoutube.js +++ b/MMM-EmbedYoutube.js @@ -10,6 +10,7 @@ Module.register("MMM-EmbedYoutube", { defaults: { autoplay: false, + mute: false, cc_load_policy: false, color: "red", controls : true, @@ -41,6 +42,7 @@ Module.register("MMM-EmbedYoutube", { } } params += (this.config.autoplay) ? "autoplay=1" : "autoplay=0"; + params += (this.config.mute) ? "&mute=1" : "&mute=0"; params += (this.config.cc_load_policy) ? "&cc_load_policy=1" : "&cc_load_policy=0"; params += (typeof this.config.color !== "undefined" && this.config.color != "red")? "&color=" + this.config.color:""; params += (this.config.controls)? "&controls=1":"&controls=0"; From c4ba9f8f25acea3c78cfc00c8940238dafdc1ac0 Mon Sep 17 00:00:00 2001 From: LKoren Date: Wed, 13 Apr 2022 15:23:59 +0200 Subject: [PATCH 2/2] Added mute option to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7874f40..5e5016d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ The following properties can be configured: | Option | Description | Default Value | Type Data | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | --------- | | `autoplay` | Autoplay video when it loaded | `false` | Boolean | +| `mute` | Mute video | `false` | Boolean | | `cc_load_policy` | Subtitles/Closed captions enabled automatically | `false` | Boolean | | `color` | Player's video progress bar to highlight the amount of the video that the viewer has already seen but color can be only `red` or `white` | `"red"` | String | | `controls` | Show youtube video controls bar | `true` | Boolean |