Bugsounet Coding

    • Register
    • Login
    • Search
    This Forum is now reserved to registred users!

    Youtube recipe question

    Recipes
    2
    6
    125
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sheepiely last edited by

      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"
                })
              }
            },
      
      1 Reply Last reply Reply Quote 0
      • bugsounet
        bugsounet Main Coder last edited by

        Sure, something like that:

        "YouTube": { 
             functionExec: {
                exec: () => {
                  this.ExtentedOpen({
                    photos: [],
                    urls: ["https://www.youtube.com/watch?v=sOnqjkJTMaA"]
                  })
                }
              },
              soundExec: {
                chime: "open"
              }
        },
        
        S 1 Reply Last reply Reply Quote 0
        • S
          Sheepiely @bugsounet last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • bugsounet
            bugsounet Main Coder last edited by bugsounet

            missing photos: [],

            Note: it’s really needed and must be an empty array, in your case

            1 Reply Last reply Reply Quote 0
            • S
              Sheepiely last edited by Sheepiely

              Awesome, that works! Thanks @bugsounet

              1 Reply Last reply Reply Quote 0
              • bugsounet
                bugsounet Main Coder last edited by

                Attention… Normaly, this function is ONLY for reserved for main core … And not really ready for recipe using
                Use it at your risk

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB | @bugsounet ©2022