Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Removed media playback control
Browse files Browse the repository at this point in the history
Media playback controll has been removed
v0.1.1
  • Loading branch information
CarlHauschke committed Feb 19, 2018
1 parent 379ceb0 commit 3d7c04e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
21 changes: 1 addition & 20 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -31,18 +30,13 @@ app.on('activate', () => {
// dock icon is clicked and there are no other windows open.
if (!mainWindow.isVisible() && !(mainWindow == null)) {
mainWindow.show();
registerShortcut();
};
});

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', createWindow);

app.on('will-quit', function() {
globalShortcut.unregisterAll();
});

function createWindow () {
applicationMenu = new AppMenu();

Expand Down Expand Up @@ -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');
});
}
app.on('before-quit', () => willQuitApp = true);
9 changes: 0 additions & 9 deletions src/renderer/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});

0 comments on commit 3d7c04e

Please sign in to comment.