Youtube recipe question
-
Similar to the Radio recipe functionality, is it possible to set one up to play a specific YouTube video upon command (using MMM-GA extension because of its better capability)?
If so, how should I modify the exec / command section?
"YouTube": { functionExec: { exec: () => { this.radioCommand({ link: "https://www.youtube.com/watch?v=sOnqjkJTMaA" }) } },
-
Sure, something like that:
"YouTube": { functionExec: { exec: () => { this.ExtentedOpen({ photos: [], urls: ["https://www.youtube.com/watch?v=sOnqjkJTMaA"] }) } }, soundExec: { chime: "open" } },
-
@bugsounet This is my recipe:
var recipe = { transcriptionHooks: { "MJ": { pattern: "play MJ", command: "MJ" }, }, commands: { "MJ": { functionExec: { exec: () => { this.ExtentedOpen({ urls: ["https://www.youtube.com/watch?v=sOnqjkJTMaA"] }) } }, soundExec: { chime: "open" } }, } } exports.recipe = recipe
After saying “play MJ”, there is a down arrow icon, so it looks like the recipe is being recognised but after the open chime sound, it just brings me back to the home screen and no YouTube video is played.
-
missing
photos: [],
Note: it’s really needed and must be an empty array, in your case
-
Awesome, that works! Thanks @bugsounet
-
Attention… Normaly, this function is ONLY for reserved for main core … And not really ready for recipe using
Use it at your risk