Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MMM-EmbedYoutube.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Module.register("MMM-EmbedYoutube", {
defaults: {
autoplay: false,
mute: false,
cc_load_policy: false,
color: "red",
controls : true,
Expand Down Expand Up @@ -41,6 +42,7 @@ Module.register("MMM-EmbedYoutube", {
}
}
params += (this.config.autoplay) ? "autoplay=1" : "autoplay=0";
params += (this.config.mute) ? "&mute=1" : "&mute=0";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did you get mute? I can't find this parameters from Youtube IFrame API docs.

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";
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down