Skip to content

Commit

Permalink
• Move lyrics window to right
Browse files Browse the repository at this point in the history
 • Drag and drop subtitles
 • Beautify lyrics view
 • solved issue: When using openwith no js is executed
 • On drag and drop multiple videos , old subtitles show on newly opened videos with no subtitles [MP&YT]
 • Making translation only work on subtitles and lyrics views [youtube and MP]
 • Opening saved words media at the pause time
* Adding polish language (as polish users are 2th in app views according to google analytics statistics)
  • Loading branch information
Ahmed committed Jun 19, 2019
1 parent a52a48e commit 95fa703
Show file tree
Hide file tree
Showing 82 changed files with 43,550 additions and 280 deletions.
42 changes: 34 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ if (process.platform == "win32" && process.mainModule.filename.indexOf('app.asar
__dirname,
"./node_modules/wcjs-prebuilt/bin/plugins"
);

if (process.argv.length >= 2) {
global.filePath = process.argv[1];

}
const electron = require("electron");
const {
Expand Down Expand Up @@ -119,6 +121,7 @@ var mediaPlayerMenu = [{
label: "Saved Words",
click() {
mainWindow.setMenu(menuSavedExp);
mainWindow.setSize(1000, 800);
mainWindow.loadURL("file://" + __dirname + "/newExp.html");
mainWindow.webContents.send("newwords", "newwords");
}
Expand Down Expand Up @@ -158,6 +161,13 @@ var mediaPlayerMenu = [{
lang: "de"
};
}
}, {
label: "Polish",
click() {
global.lang = {
lang: "pl"
};
}
},
{
label: "Dutch",
Expand Down Expand Up @@ -698,6 +708,7 @@ var savedExpMenu = [{
]
}
];

const menuMP = Menu.buildFromTemplate(mediaPlayerMenu);
const menuSavedExp = Menu.buildFromTemplate(savedExpMenu);
const menuExtYoutube = Menu.buildFromTemplate(ExtWebsiteMenu_youtube);
Expand All @@ -712,7 +723,6 @@ app.on("ready", function () {
height: 600
});
mainWindow.loadURL("file://" + __dirname + "/MediaPl.html");
//Menu.setApplicationMenu(menu);
mainWindow.webContents.on('new-window', (event, url, frameName, disposition, options, additionalFeatures) => {
mainWindow.webContents.send("newwindow", {
event: event,
Expand All @@ -724,20 +734,36 @@ app.on("ready", function () {
})
})
mainWindow.setMenu(menuMP);
mainWindow.openDevTools({
detach: true
});
if (process.platform == "win32" && process.mainModule.filename.indexOf('app.asar') === -1)
mainWindow.openDevTools({
detach: true
});
ipc.on("download", (event, info) => {
console.log(info)
download(mainWindow, info.url, info.properties).then(function (dl) {
console.log(dl.getSavePath());
}).catch(console.error)
download(mainWindow, info.url, info.properties).then(function (dl) {}).catch(console.error)

download(BrowserWindow.getFocusedWindow(), info.url, info.properties).then(
dl => mainWindow.webContents.send("download complete", dl.getSavePath())
);
});


ipc.on("newWindowOpen", (event, info) => {
if (info.type == "youtube") {
mainWindow.setMenu(menuExtYoutube);
mainWindow.loadURL(
"file://" + __dirname + "/embeddedYoutube.html"
);
mainWindow.webContents.executeJavaScript(" document.getElementById('player').src='" + info.path + "';" + `
;setTimeout(function(){document.getElementById("player").contentWindow.document.getElementsByTagName('video')[0].addEventListener('loadedmetadata', function() {
this.currentTime = ` + (parseFloat(info.time) - 4).toString() + `;
}, false);},1000);
`);
} else if (info.type == "local") {
mainWindow.loadURL("file://" + __dirname + "/MediaPl.html");
mainWindow.webContents.executeJavaScript(`player.vlc.play("file:///" + "` + info.path + `");loadSubtitles("` + info.path + `");player.vlc.time=` + (parseFloat(info.time) - 10))
}
});

mainWindow.webContents.session.webRequest.onHeadersReceived({}, (d, c) => {
if (
d.responseHeaders["x-frame-options"] ||
Expand Down
Binary file added dist/LLG-MP_v0.1.2_windows_64bit.Installer.rar
Binary file not shown.
8 changes: 8 additions & 0 deletions dist/latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 0.1.2
files:
- url: llg-mp-setup-0.1.2.exe
sha512: 6jgXf7dBxUzGfnh18Suq/+lt1+Byy4vHCFZDUWo5saO06NrwenP3WrbXEIbWO1DAzQhpRYOx0W1GkEpE15oTNg==
size: 68506892
path: llg-mp-setup-0.1.2.exe
sha512: 6jgXf7dBxUzGfnh18Suq/+lt1+Byy4vHCFZDUWo5saO06NrwenP3WrbXEIbWO1DAzQhpRYOx0W1GkEpE15oTNg==
releaseDate: '2019-05-23T02:31:15.842Z'
Binary file added dist/llg-mp Setup 0.1.2.exe.blockmap
Binary file not shown.
20 changes: 20 additions & 0 deletions dist/win-unpacked/LICENSE.electron.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2016 GitHub Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 95fa703

Please sign in to comment.