MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Milk
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Groups 0

    Milk

    @Milk

    0
    Reputation
    386
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Milk Unfollow Follow

    Latest posts made by Milk

    • RE: Simple Music Player Module
      			'use strict';
      			var playingnow = false;
      			document.addEventListener('keypress', (event) => {
      				const keyName = event.key;
      				
      				if(keyName == " " && playingnow == false){
      					$(audioElement).trigger('play');
      					$(currentlyPlaying).html(songs[current]).fadeIn(fadeDuriation);
      					playingnow = true;
      				
      				}else if(keyName == " " && playingnow == true){
      					$(audioElement).trigger('pause');
      					$(currentlyPlaying).fadeOut(fadeDuriation);
      					playingnow = false;
      				
      				}
      				if(keyName == "."){
      					next();
      				}
      				if(keyName == ","){
      					back();
      				}
      			});
      

      I have added this code to the mm-music player.js and it now accepts key presses

      posted in Entertainment
      M
      Milk
    • RE: Simple Music Player Module

      would it be possible to make it so I could use a keyboard to control the music?

      posted in Entertainment
      M
      Milk