• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-AssistantMk2 youtube : start video

Scheduled Pinned Locked Moved Unsolved Troubleshooting
5 Posts 5 Posters 3.4k Views 5 Watching
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.
  • M Offline
    MisterT
    last edited by Apr 27, 2019, 11:37 AM

    Hi,

    i use MMM-AssistantMk2 and it’s awesome but i have a problem with youtube and start video. If i say: Smooth criminals Mickael Jackson, a youtube window open but nothing appened. Just a black screen with youtube logo

    I open console and there are errors but i don’t undestand. See below:

    www-widgetapi.js:99 Error while parsing the 'allow' attribute: 'accelerometer;', 'autoplay;', 'encrypted-media;', 'gyroscope;', 'picture-in-picture' are invalid feature names.
    mb @ www-widgetapi.js:99
    :8080/modules/MMM-AssistantMk2//MMM-AssistantMk2.js:744 Uncaught TypeError: console.log is not a function
        at onReady (:8080/modules/MMM-AssistantMk2//MMM-AssistantMk2.js:744)
        at P.k.H (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:54)
        at Y.k.s (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:98)
        at Y.k.I (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:112)
        at kb.g (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:87)
        at g (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:76)
    

    I post my config.js below with MMM-AssistantMK2 and MMM-Hotword:

       		{
        			module: "MMM-AssistantMk2",
        			position: "top_right",
        			config: {
        			deviceLocation: {
          					coordinates: { // set the latitude and longitude of the device to get localized information like weather or time. (ref. mygeoposition.com)
            				latitude: xx.xxxx, // -90.0 - +90.0
            				longitude: x.xxxx // -180.0 - +180.0
          						     },
      					},
        			profiles: {
          				"default" : { // profile name.
            					profileFile: "default.json", // profile file name.
            					lang: "fr-FR"
            					//currently available (estimation, not all tested):
            					//  de-DE, en-AU, en-CA, en-GB, en-US, en-IN
            					// fr-CA, fr-FR, it-IT, ja-JP, es-ES, es-MX, ko-KR, pt-BR
            					// https://developers.google.com/assistant/sdk/reference/rpc/languages
          					    },
    				 },
          			record: {
            		recordProgram : "arecord",  
            		device        : "plughw:1",
          				},
    			play: {
          			playProgram: "mpg321", // recommended.
        			        },
    			transcriptionHook: {
    
            			HIDE_ALL_MODULES: {
                				pattern: "cache les modules",
                				command: "HIDEMODULES"
              					  },
              			SHOW_ALL_MODULES: {
                				pattern: "affiche les modules",
                				command: "SHOWMODULES"
              					  },
              			SCREEN_ON: {
                				pattern: "allume l'écran",
                				command: "SCREENON"
              					},
              			SCREEN_OFF: {
                				pattern: "eteins l'écran",
                				command: "SCREENOFF"
              					},
              			REBOOT: {
                				pattern: "reboot le miroir",
                				command: "REBOOT"
              				},
              			SHUTDOWN: {
                				pattern: "eteins le miroir",
                				command: "SHUTDOWN"
              					},
              			STOP_PLAY: {
                				pattern: "arrête la video", // this is for youtube but it is preferable to have youtubeAutoplay: false, when running spotify so you don't get interaction with youtube player. 
                				command: "STOP_VID"
              					},
             			// STOP_PLAY2: {
             			//   pattern: "arrête la musique",
            			//   command: "STOP_VID"
             			// },
    
    	 			SPOTIFY_PREVIOUS: {
            				pattern: "musique précédente",
            				command: "SPOTIFY_PREVIOUS"
            					},
            			SPOTIFY_PAUSE: {
            				pattern : "stop",
            				command: "SPOTIFY_PAUSE"
            					},
            			SPOTIFY_PLAY: {
            				pattern : "lance la musique",
            				command: "SPOTIFY_PLAY"
            					},
            			SPOTIFY_NEXT: {
            				pattern: "musique suivante",
            				command: "SPOTIFY_NEXT"
            					},
            			SPOTIFY_VOLUME: {
            				pattern: "met le volume à ([0-9]{1,2}[0]?|100)",
            				command: "SPOTIFY_VOLUME"
            					},
            			SPOTIFY_SEARCH: {
            				pattern: "joue (.*) on Spotify",
            				command: "SPOTIFY_SEARCH"
            					},
    				SPOTIFY_SEARCH_PLAYLIST: {
            				pattern: "playlist (.*) sur Spotify",
            				command: "SPOTIFY_SEARCH_PLAYLIST"
            					},
    				SPOTIFY_MA_PLAYLIST: {
    					pattern: "(.*) ma playlist",   // (.*)  is an action  eg: play my playlist / run my playlist etc... 
    					command: "SPOTIFY_MA_PLAYLIST"
    							},
    				SPOTIFY_TRANSFER: {
    					pattern: "joue la musique sur (.*)", // (.*)  is the name of your device
    					command: "SPOTIFY_TRANSFER"
    						},
              			VOLUME_UP: {
                				pattern: "augmente le volume",
                				command: "CMD_VOLUME_UP"
              					},
              			VOLUME_DOWN: {
                				pattern: "baisse le volume",
                				command: "CMD_VOLUME_DOWN"
              					},
              			SET_VOLUME: {
                				pattern: "met le volume global à ([0-9]{1,2}[0]?|100)",
                				command: "CMD_VOLUME_SET"
              						}
            				},
            		command: {
    
              			STOP_VID: {
                				moduleExec: {
                  						module: ["MMM-AssistantMk2"],
                  						exec: (module, params, key) => {
                    									module.assistant.subdom.youtube.innerHTML = ""; 
                    									module.assistant.subdom.youtube.style.display = "none";
                    									module.youtubePlaying = false;
                  										}
                					    }
              			},
    	   			SPOTIFY_TRANSFER: {
    	    				notificationExec: {
                  							notification: "SPOTIFY_TRANSFER",
    	         						payload: (params) => {
                     									console.log("SPOTIFY_TRANSFER @",params)
                    									return params[1];
                            								}
        
    							   }
              					  },
               			SPOTIFY_PAUSE: {
                				notificationExec: {
                  							notification: "SPOTIFY_PAUSE"
                						  }
              					},
    
            			SPOTIFY_PLAY: {
                				notificationExec: {
                    						notification: "SPOTIFY_PLAY"
                    					  }
            				      },
    	
    				SPOTIFY_MA_PLAYLIST: {
    	    				notificationExec:  {
    							notification: "SPOTIFY_PLAY",
    							payload: (params) => {
    							console.log("SPOTIFY_MA_PLAYLIST")
    							return {
    								context_uri:"spotify:playlist:0bdByehKVfdsfdsfdsOhF5t",   // Uri of a personnal playlist or album
    								}
    										},
    							notification: "SPOTIFY_SHUFFLE",  // added this to toogle shuffle
    							notification: "SPOTIFY_NEXT" // added this to not always have the same song starting first 
    							   }
    						    },		
            
    				SPOTIFY_NEXT: {
             				notificationExec: {
                							notification: "SPOTIFY_NEXT"
                    					  }
            				      },
    
            			SPOTIFY_PREVIOUS: {
             				notificationExec: {
                							notification: "SPOTIFY_PREVIOUS"
                    					  }
            					  },
            			SPOTIFY_VOLUME: {
                				notificationExec: {
               							notification: "SPOTIFY_VOLUME",
               							payload: (params) => {
                     								console.log("SPOTIFY_VOLUME @",params)
                    								return params[1];
                            							     }
                    					   }
            					},
    				SPOTIFY_SEARCH: {
             				notificationExec: {
               							notification: "SPOTIFY_SEARCH",
    								payload: (params) => {
                    						console.log("SPOTIFY_SEARCH @",params)
                    						return {
                            						type: "artist,track,album,playlist",
                            						query: params[1],
                            						random:false,
                            						}
                         								     }
                    									}
            						  },
    	 			SPOTIFY_SEARCH_PLAYLIST: {
             				notificationExec: {
               							notification: "SPOTIFY_SEARCH",
    								payload: (params) => {
                    						console.log("SPOTIFY_SEARCH_PLAYLIST @",params)
                    						return {
                            						type: "playlist",
                            						query: params[1],
                            						random:true,
                            						}
                         					  	  		      }
                    					}
            						},
              			CMD_VOLUME_UP: {
                				notificationExec: {
                  						notification: "VOLUME_UP"
                						  }
              					},
              			CMD_VOLUME_DOWN: {
                				notificationExec: {
                  						notification: "VOLUME_DOWN"
                						   }
              					},
              			CMD_VOLUME_SET: {
                				notificationExec: {
                  						notification: "VOLUME_SET",
                  						payload: (params, key) => {
                    								console.log("@", params);
                    								return params[1];
                  									  }
                						  }					
              					}
            			},
    
    
          			notifications: {
            			ASSISTANT_ACTIVATED: "HOTWORD_PAUSE",
            			ASSISTANT_DEACTIVATED: "HOTWORD_RESUME",
          					},
    			responseVoice: true,
    			screenDuration: 5000,
    			youtubeAutoplay: true, //If set as true, found Youtube video will be played automatically.
        			pauseOnYoutube:true, //If set as true, You cannot activate Assistant during youtube playing. Recommended for the performance (Because permanent hotword detecting might make performance lower)
    
        			youtubePlayerVars: { // You can set youtube playerVars for your purpose, but should be careful.
          			"controls": 0,
          			"loop": 1,
          			"rel": 0,
        					   },
        			youtubePlayQuality: "default", //small, medium, large, hd720, hd1080, highres or default
        			}
      		},
      		{
        			module: "MMM-Hotword",
        			config: {
        			snowboy: [
      					{
        					hotwords: "smartmirror", //this will be sent to other module for distinguishing which hotword is detected.
        					file: "resources/models/smart_mirror.umdl",
        					sensitivity: '0.5',
      					},
      					//{
        					//hotwords: "snowboy",
        					//file: "resources/models/snowboy.umdl",
        					//sensitivity: '0.5',
      					//},
      					{
        					file: 'resources/models/jarvis.umdl',
        					sensitivity: '0.8,0.80',
        					hotwords: ['jarvis','jarvis'] //Kitt.ai changed their Jarvis UMDL, it has 2 models in one file. So weird.
        					//anyway, you can give different name for each. ['jarvis_1', 'jarvis_2']. Even though I think this is useless.
      					}
        				],
        			record: {
          				recordProgram : "arecord",  
          				device        : "plughw:1"
        				},
        			autostart:true,
        			onDetected: {
          					notification: (payload) => {
            								return "ASSISTANT_ACTIVATE"
          								   },
          					payload: (payload) => {
            							return {
              								profile: payload.hotword
            								}
          							      }
        				   },
      			},
    		},
    

    Can you help me please?
    thanks for next answers

    J mumblebajM 2 Replies Last reply Sep 17, 2019, 10:58 PM Reply Quote 0
    • J Offline
      juantata @MisterT
      last edited by Sep 17, 2019, 10:58 PM

      @MisterT said in MMM-AssistantMk2 youtube : start video:

      arrête la video

      Hi. I have the same problem. Did you fix it?

      V 1 Reply Last reply Nov 2, 2019, 7:59 PM Reply Quote 0
      • mumblebajM Online
        mumblebaj Module Developer @MisterT
        last edited by Sep 18, 2019, 3:26 PM

        @MisterT said in MMM-AssistantMk2 youtube : start video:

        MMM-AssistantMk2

        I believe from other issues posted on the forum that in the MM-AssistantMk2.js file the console.log entries should be changed to Log.log. I think there are 8 entries in the file that need changing.

        Check out my modules at: https://github.com/mumblebaj?tab=repositories

        M 1 Reply Last reply Apr 4, 2020, 1:44 PM Reply Quote 0
        • V Offline
          vschinazi @juantata
          last edited by Nov 2, 2019, 7:59 PM

          @juantata Did you ever manage to figure this out. I’m having a similar problem. When I query for a video with Google Assistant it tells me that it found it but it does not play it. In fact, GA freezes.

          1 Reply Last reply Reply Quote 0
          • M Offline
            mattx38 @mumblebaj
            last edited by Apr 4, 2020, 1:44 PM

            @mumblebaj Hello, did you fix it ? I got kind of same issue…

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy