Compare commits

...

17 Commits

Author SHA1 Message Date
Anirudh Sevugan
a26e1448ab
Update renderer.js
Some checks failed
Build Linux / build_x64 (push) Has been cancelled
Build Linux / build_arm64 (push) Has been cancelled
Build macOS / build (push) Has been cancelled
Build Windows / build-x64 (push) Has been cancelled
Build Windows / build-arm64 (push) Has been cancelled
2025-09-15 18:19:03 -05:00
Anirudh Sevugan
59a8d5c577
v2.1.4 2025-09-15 18:17:27 -05:00
Anirudh Sevugan
ef5e34331e
Update main.js
Some checks are pending
Build Linux / build_x64 (push) Waiting to run
Build Linux / build_arm64 (push) Waiting to run
Build macOS / build (push) Waiting to run
Build Windows / build-x64 (push) Waiting to run
Build Windows / build-arm64 (push) Waiting to run
2025-09-14 22:35:14 -05:00
Anirudh Sevugan
cc5da53f23
Update package-arm64-linux.json 2025-09-14 22:35:06 -05:00
Anirudh Sevugan
5d0128e2af
Update package.json 2025-09-14 22:34:56 -05:00
Anirudh Sevugan
101f14c4d6
Update package.json 2025-09-14 22:34:49 -05:00
Anirudh Sevugan
49939dd963
Update package-arm64-linux.json 2025-09-14 22:34:30 -05:00
Anirudh Sevugan
257218c5a1
prep for 2.1.4
Some checks failed
Build Windows / build-x64 (push) Has been cancelled
Build Windows / build-arm64 (push) Has been cancelled
Build macOS / build (push) Has been cancelled
Build Linux / build_x64 (push) Has been cancelled
Build Linux / build_arm64 (push) Has been cancelled
2025-09-10 21:38:47 -05:00
Anirudh Sevugan
808c275167
prep for 2.1.4 2025-09-10 21:37:38 -05:00
Anirudh Sevugan
5d49c97662
v2.1.3 2025-09-10 21:09:15 -05:00
Anirudh Sevugan
16311d2eff
Update package-arm64-linux.json 2025-09-10 21:08:53 -05:00
Anirudh Sevugan
4a23d31b03
Update package.json 2025-09-10 21:08:39 -05:00
Anirudh Sevugan
97088fb943
Update main.js 2025-09-10 21:08:18 -05:00
Anirudh Sevugan
b987f539f8
Update player.js 2025-09-10 21:08:09 -05:00
Anirudh Sevugan
117d2950ea
Update renderer.js 2025-09-10 21:07:48 -05:00
Anirudh Sevugan
0aa0e06194
Update package.json 2025-09-10 21:07:33 -05:00
Anirudh Sevugan
2ddce17442
Update package-arm64-linux.json 2025-09-10 21:07:23 -05:00
6 changed files with 124 additions and 6 deletions

View File

@ -6,7 +6,7 @@ const { pathToFileURL } = require("url");
const { checkForUpdate } = require('./updateChecker');
let gpuAccel = "";
let didRegisterShortcuts = false;
let version = "2.1.2.0"
let version = "2.1.3.0"
if (process.platform === 'darwin') {
if (process.argv.includes('--use-gl')) {

View File

@ -6,7 +6,7 @@ const { pathToFileURL } = require("url");
const { checkForUpdate } = require('./updateChecker');
let gpuAccel = "";
let didRegisterShortcuts = false;
let version = "2.1.2.0"
let version = "2.1.4.0"
if (process.platform === 'darwin') {
if (process.argv.includes('--use-gl')) {

View File

@ -1,6 +1,6 @@
{
"name": "SimpliPlay",
"version": "2.1.2",
"version": "2.1.4",
"description": "SimpliPlay - The mission to make media playback accessible on every device, anywhere, anytime.",
"main": "./main.js",
"scripts": {
@ -92,6 +92,11 @@
"name": "FLAC Audio",
"role": "Viewer"
},
{
"ext": "opus",
"name": "Opus Audio",
"role": "Viewer"
},
{
"ext": "mkv",
"name": "MKV Video",
@ -113,7 +118,7 @@
"allowToChangeInstallationDirectory": true
},
"devDependencies": {
"electron": "^38.0.0",
"electron": "^38.1.0",
"electron-builder": "^26.0.12"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "SimpliPlay",
"version": "2.1.2",
"version": "2.1.4",
"description": "The mission to make media playback accessible on every platform, anywhere, anytime.",
"main": "./main.js",
"scripts": {
@ -105,6 +105,11 @@
"name": "FLAC Audio",
"role": "Viewer"
},
{
"ext": "opus",
"name": "Opus Audio",
"role": "Viewer"
},
{
"ext": "mkv",
"name": "MKV Video",
@ -118,7 +123,7 @@
]
},
"devDependencies": {
"electron": "^38.0.0",
"electron": "^38.1.0",
"electron-builder": "^26.0.12"
}
}

View File

@ -272,6 +272,7 @@ const { isHLS, isDASH } = await detectStreamType(url);
let previousObjectURL = null; // Store the last Object URL
window.objectURL = previousObjectURL
fileInput.addEventListener('change', (event) => {
if (hls !== null) {
@ -292,7 +293,13 @@ const { isHLS, isDASH } = await detectStreamType(url);
// Revoke the previous Object URL if it exists
if (previousObjectURL) {
URL.revokeObjectURL(previousObjectURL);
window.objectURL = previousObjectURL
}
// Revoke previous file picker Object URL
if (window.previousDropURL) {
URL.revokeObjectURL(window.previousDropURL);
}
// Create a new Object URL for the selected file
const fileURL = URL.createObjectURL(file);

View File

@ -16,6 +16,103 @@ function loadMedia(fileURL) {
}
}
window.addEventListener('DOMContentLoaded', () => {
const dropArea = document.createElement('div');
dropArea.style.position = 'fixed';
dropArea.style.top = '0';
dropArea.style.left = '0';
dropArea.style.width = '100vw';
dropArea.style.height = '100vh';
dropArea.style.display = 'none'; // hidden by default
dropArea.style.zIndex = '0'; // behind everything
dropArea.style.opacity = '0'; // invisible
document.body.appendChild(dropArea);
let dragCounter = 0; // track nested dragenter/dragleave events
window.addEventListener('dragenter', (e) => {
if (e.dataTransfer.types.includes('Files')) {
dragCounter++;
e.preventDefault();
e.stopPropagation();
}
});
window.addEventListener('dragleave', (e) => {
if (e.dataTransfer.types.includes('Files')) {
dragCounter--;
if (dragCounter <= 0) dragCounter = 0;
e.preventDefault();
e.stopPropagation();
}
});
window.addEventListener('dragover', (e) => {
if (e.dataTransfer.types.includes('Files')) {
e.preventDefault(); // allow drop
e.stopPropagation();
}
});
let previousDropURL = null; // Store last Object URL
window.previousDropURL = previousDropURL
window.addEventListener('drop', e => {
e.preventDefault();
e.stopPropagation();
const file = e.dataTransfer.files[0];
if (!file) return;
// Destroy existing HLS/DASH instances if they exist
if (window.hls) {
window.hls.destroy();
window.hls = null;
}
if (window.dash) {
window.dash.reset();
window.dash = null;
}
// Clear previously loaded subtitles
const tracks = mediaElement.getElementsByTagName('track');
for (let i = tracks.length - 1; i >= 0; i--) {
tracks[i].remove();
}
// Revoke previous Object URL
if (previousDropURL) {
URL.revokeObjectURL(previousDropURL);
window.previousDropURL = previousDropURL;
}
// Revoke previous file picker Object URL
if (window.objectURL) {
URL.revokeObjectURL(window.objectURL);
}
// Create a new Object URL
const fileURL = URL.createObjectURL(file);
mediaElement.src = fileURL;
mediaElement.load();
// Autoplay if checkbox is checked
if (autoplayCheckbox.checked) {
mediaElement.play().catch(err => console.warn(err));
}
// Store for future cleanup
previousDropURL = fileURL;
// Hide file dialog if applicable
if (dialogOverlay) dialogOverlay.style.display = 'none';
});
});
// Handle submit subtitle URL
function clearSubtitles() {
const tracks = mediaElement.getElementsByTagName('track');
@ -97,3 +194,7 @@ window.electron.receive("unload-addon", (fileURL) => {
unloadAddon(fileURL);
});