diff --git a/package.json b/package.json index 94e9fcd..5fa48a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macflix", - "version": "0.1.0", + "version": "0.1.1", "description": "Macflix is Netflix on your Mac", "productName": "Macflix", "main": "src/main/main.js", diff --git a/src/main/main.js b/src/main/main.js index 98b635b..43a2021 100644 --- a/src/main/main.js +++ b/src/main/main.js @@ -3,7 +3,6 @@ const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; const AppMenu = require('./menu'); -const globalShortcut = electron.globalShortcut; const path = require('path'); const shell = require('electron').shell; @@ -31,7 +30,6 @@ app.on('activate', () => { // dock icon is clicked and there are no other windows open. if (!mainWindow.isVisible() && !(mainWindow == null)) { mainWindow.show(); - registerShortcut(); }; }); @@ -39,10 +37,6 @@ app.on('activate', () => { // initialization and is ready to create browser windows. app.on('ready', createWindow); -app.on('will-quit', function() { - globalShortcut.unregisterAll(); -}); - function createWindow () { applicationMenu = new AppMenu(); @@ -81,26 +75,13 @@ function createWindow () { mainWindow.setFullScreen(false); } else { mainWindow.hide(); - globalShortcut.unregisterAll(); } } }) //mainWindow.openDevTools(); - - registerShortcut(); }; //'before-quit' is emitted when Electron receives // the signal to exit and wants to start closing windows -app.on('before-quit', () => willQuitApp = true); - -// register Shortcuts -function registerShortcut() { - globalShortcut.register('MediaPlayPause', function() { - mainWindow.webContents.send('keypress', 'MediaPlayPause'); - }); - globalShortcut.register('MediaNextTrack', function() { - mainWindow.webContents.send('keypress', 'MediaNextTrack'); - }); -} \ No newline at end of file +app.on('before-quit', () => willQuitApp = true); \ No newline at end of file diff --git a/src/renderer/wrapper.js b/src/renderer/wrapper.js index 4954990..dd21a83 100644 --- a/src/renderer/wrapper.js +++ b/src/renderer/wrapper.js @@ -10,13 +10,4 @@ webview.addEventListener("dom-ready", function() { // TODO: Yes, this is messy - just playing with what styling is needed //webview.openDevTools(); webview.insertCSS("#netflix-player .player-back-to-browsing { top: 35px; } #hdPinTarget { padding-left: 60px; } .akira-header>.logo{left: 50%;position: absolute; margin-left: -58px; top: 8px;"); -}); - -ipcRenderer.on('keypress', function(event, arg) { - switch(arg) { - case 'MediaNextTrack': - return webview.send('nextVideo'); - case 'MediaPlayPause': - return webview.send('playOrPause'); - } }); \ No newline at end of file