Hi all,
Currently I’m facing an issue with my embedded youtube video on MM. My inspiration of controlling the video comes from Jopyth’s Remote Control module( https://github.com/Jopyth/MMM-Remote-Control ).
So my idea is that whenever i press the “hide-all” button , the remote will send a notification to my youtube module telling it to play the module while hiding the rest of my module and when “show-all” button is pressed, it hides and pauses the video while showing un-hiding the rest of my modules. However, currently im met with a problem, the function, this.sendnotification doesn’t work. The following is portion that i have edited.
'show-all-button': function() {
var buttons = document.getElementsByClassName("edit-button");
for (var i = 0; i < buttons.length; i++) {
if (buttons[i].id!="module_5_youtube"){
buttons[i].className = buttons[i].className.replace("toggled-off", "toggled-on");
Remote.showModule(buttons[i].id);
this.sendNotification("PAUSE_VIDEO", payload);
}
else{
buttons[i].className = buttons[i].className.replace("toggled-on", "toggled-off");
Remote.hideModule(buttons[i].id);
}
I have added this line “this.sendNotification(“PAUSE_VIDEO”, payload);”
but MM doesnt process it.
Is my usage of the code wrong ?