Skip to content
Permalink
Browse files

Fix build commands and remove timout from player initializing

  • Loading branch information...
PrestonN committed Aug 12, 2019
1 parent f2440e1 commit a1eb4a00cd9ec935eec1669d7b32c0359f7170a7
Showing with 30 additions and 32 deletions.
  1. +17 −17 package.json
  2. +13 −15 src/js/player.js
@@ -5,25 +5,25 @@
"description": "An Open Source YouTube app for privacy.",
"main": "src/js/init.js",
"scripts": {
"pack": "build --dir",
"pack": "electron-builder build --dir",
"start": "electron .",
"make:all": "npm run make:linux:x64 && npm run make:linux:arm && npm run make:mac:zip && npm run make:win",
"make:win": "build --win",
"make:win:exe": "build --win nsis",
"make:win:zip": "build --win zip",
"make:mac:zip": "build --mac zip",
"make:mac:dmg": "build --mac dmg",
"make:linux:x64": "build --linux --x64",
"make:linux:x64:deb": "build --linux deb --x64",
"make:linux:x64:rpm": "build --linux rpm --x64",
"make:linux:x64:appimage": "build --linux appimage --x64",
"make:linux:x64:zip": "build --linux zip --x64",
"make:linux:x64:tar": "build --linux tar.xz --x64",
"make:linux:arm": "build --linux --arm64",
"make:linux:arm:deb": "build --linux deb --arm64",
"make:linux:arm:rpm": "build --linux rpm --arm64",
"make:linux:arm:zip": "build --linux zip --arm64",
"make:linux:arm:tar.xz": "build --linux tar.xz --arm64",
"make:win": "electron-builder build --win",
"make:win:exe": "electron-builder build --win nsis",
"make:win:zip": "electron-builder build --win zip",
"make:mac:zip": "electron-builder build --mac zip",
"make:mac:dmg": "electron-builder build --mac dmg",
"make:linux:x64": "electron-builder build --linux --x64",
"make:linux:x64:deb": "electron-builder build --linux deb --x64",
"make:linux:x64:rpm": "electron-builder build --linux rpm --x64",
"make:linux:x64:appimage": "electron-builder build --linux appimage --x64",
"make:linux:x64:zip": "electron-builder build --linux zip --x64",
"make:linux:x64:tar": "electron-builder build --linux tar.xz --x64",
"make:linux:arm": "electron-builder build --linux --arm64",
"make:linux:arm:deb": "electron-builder build --linux deb --arm64",
"make:linux:arm:rpm": "electron-builder build --linux rpm --arm64",
"make:linux:arm:zip": "electron-builder build --linux zip --arm64",
"make:linux:arm:tar.xz": "electron-builder build --linux tar.xz --arm64",
"dist": "build"
},
"keywords": [],
@@ -1098,6 +1098,19 @@ function checkDashSettings() {
return;
}

historyDb.findOne({
videoId: playerView.videoId
}, function (err, doc) {
if (doc !== null) {
if (typeof (playerView.currentTime) !== 'undefined') {
instance.currentTime = playerView.currentTime;
playerView.currentTime = undefined;
} else if (doc.watchProgress < instance.duration - 5 && playerView.validLive === false) {
instance.currentTime = doc.watchProgress;
}
}
});

let selectedOption = false;
qualityOptions.forEach((option, index) => {
if (option.value === defaultQuality || option.value === defaultQuality + 'p' || option.value === defaultQuality + 'p60') {
@@ -1113,21 +1126,6 @@ function checkDashSettings() {

$('.mejs__qualities-selector-input').get().reverse()[0].click();
}

window.setTimeout(() => {
historyDb.findOne({
videoId: playerView.videoId
}, function (err, doc) {
if (doc !== null) {
if (typeof (playerView.currentTime) !== 'undefined') {
instance.currentTime = playerView.currentTime;
playerView.currentTime = undefined;
} else if (doc.watchProgress < instance.duration - 5 && playerView.validLive === false) {
instance.currentTime = doc.watchProgress;
}
}
});
}, 200);
};

initializeSettings();

0 comments on commit a1eb4a0

Please sign in to comment.
You can’t perform that action at this time.