Compare commits

...

157 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
Anirudh Sevugan
ae127fb837
v2.1.2
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-04 17:22:32 -05:00
Anirudh Sevugan
f7fa4bf081
Update package-arm64-linux.json
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-03 22:45:33 -05:00
Anirudh Sevugan
9cdbc5e328
Update package-arm64-linux.json 2025-09-03 22:45:23 -05:00
Anirudh Sevugan
778cc0ec74
Update package.json 2025-09-03 22:45:11 -05:00
Anirudh Sevugan
451313f414
Update package.json 2025-09-03 22:45:02 -05:00
Anirudh Sevugan
2c6b048721
Update main-es.js 2025-09-03 22:44:50 -05:00
Anirudh Sevugan
adb0647fdc
Update main.js 2025-09-03 22:42:17 -05:00
Anirudh Sevugan
f06f2cc9fc
Update README.md 2025-09-01 19:33:25 -05:00
Anirudh Sevugan
8fd5de8b75
Update package.json 2025-08-31 14:53:48 -05:00
Anirudh Sevugan
20f5d7e250
Update package.json 2025-08-31 14:49:57 -05:00
Anirudh Sevugan
6125553e40
Update player.js 2025-08-29 19:43:45 -05:00
Anirudh Sevugan
ec3332a248
Update README.txt 2025-08-28 20:47:05 -05:00
Anirudh Sevugan
7a7cb4d8fd
use executableName
use executableName only when it is available in electron-builder stable
2025-08-28 17:55:49 -05:00
Anirudh Sevugan
a815b4c431
use executableName when in stable
use executableName only when it is available in electron-builder stable
2025-08-28 17:55:30 -05:00
Anirudh Sevugan
f20c520123
2.1.1
changes: fixed `Exec` field missing from .desktop file in Snap, and upgraded Electron to 37.4.0 (only upgraded because of fixing `Exec` field missing from .desktop file in Snap)
2025-08-28 17:48:52 -05:00
Anirudh Sevugan
4675073530
Update main.js 2025-08-28 17:47:54 -05:00
Anirudh Sevugan
ad979d6b86
Update package.json 2025-08-28 17:47:46 -05:00
Anirudh Sevugan
1abe50b40a
Update package-arm64-linux.json 2025-08-28 17:47:32 -05:00
Anirudh Sevugan
d03513ea3d
Update package-arm64-linux.json 2025-08-28 17:44:13 -05:00
Anirudh Sevugan
2560bd4315
Update package.json 2025-08-28 17:43:58 -05:00
Anirudh Sevugan
99303f82e7
2.1.0
fixes memory leak issues and unnecessary Blob URL usage for subtitles along with improving the versioning system
2025-08-24 16:42:54 -05:00
Anirudh Sevugan
1d38e90b2b
Update package-arm64-linux.json 2025-08-24 16:41:56 -05:00
Anirudh Sevugan
0513fa7b23
Update package.json 2025-08-24 16:41:46 -05:00
Anirudh Sevugan
fde5bc7fe2
Update main.js 2025-08-24 16:41:36 -05:00
Anirudh Sevugan
6e4f9d0459
Update player.js 2025-08-24 16:40:21 -05:00
Anirudh Sevugan
2176853993
add support for SRT subtitles 2025-08-22 15:44:23 -05:00
Anirudh Sevugan
32645bb3cf
Update main-es.js 2025-08-22 15:43:18 -05:00
Anirudh Sevugan
47f7753b99
Update main.js 2025-08-22 15:43:09 -05:00
Anirudh Sevugan
6a0d9cb53a
Update package.json 2025-08-22 15:42:57 -05:00
Anirudh Sevugan
97c7b4d4dd
Update package-arm64-linux.json 2025-08-22 15:42:46 -05:00
Anirudh Sevugan
095d9fcfc2
Update main-es.js 2025-08-19 17:43:57 -05:00
Anirudh Sevugan
f2e43a55f9
Update main.js 2025-08-19 17:42:44 -05:00
Anirudh Sevugan
1c628866b6
Update main-es.js 2025-08-19 17:37:17 -05:00
Anirudh Sevugan
4995ea430c
Update main.js 2025-08-19 17:37:08 -05:00
Anirudh Sevugan
6df2e71cdb
Update package-arm64-linux.json 2025-08-19 17:36:54 -05:00
Anirudh Sevugan
b3409c56ab
Update package.json 2025-08-19 17:36:41 -05:00
Anirudh Sevugan
e617596a9b
Update README.md 2025-08-18 18:43:09 -05:00
Anirudh Sevugan
b903283b76
Update README.md 2025-08-18 18:42:54 -05:00
Anirudh Sevugan
4b167af46f
Update README.md 2025-08-18 18:42:18 -05:00
Anirudh Sevugan
d396ceefed
Update README.md 2025-08-18 18:36:48 -05:00
Anirudh Sevugan
db55349be9
Update README.md 2025-08-18 18:36:28 -05:00
Anirudh Sevugan
32563f1491
Update README.md 2025-08-18 18:36:10 -05:00
Anirudh Sevugan
1a6ba2ebad
Update main-es.js 2025-08-17 18:00:36 -05:00
Anirudh Sevugan
f7151dc9dd
Update main.js 2025-08-17 18:00:09 -05:00
Anirudh Sevugan
abcc95654c
Delete simpliplay/src directory 2025-08-17 17:59:35 -05:00
Anirudh Sevugan
2fa7daac19
Add files via upload 2025-08-17 17:58:49 -05:00
Anirudh Sevugan
9b1d81d28c
Update main.js 2025-08-17 17:58:34 -05:00
Anirudh Sevugan
f1f3a8ce24 fix bugs
Fix update system bug (2.0.4.3 instead of 2.0.4.4 as internal version number) and use Electron 37.3.0 for ARM64 Linux builds as well
2025-08-16 11:36:04 -05:00
Anirudh Sevugan
ddb5bf24d7
Update package.json 2025-08-15 15:32:30 -05:00
Anirudh Sevugan
32d090e514
Update build-macos.yml 2025-08-08 16:53:04 -05:00
Anirudh Sevugan
56e22ad4ab
Update build-macos.yml 2025-08-08 16:50:01 -05:00
Anirudh Sevugan
c97b1fa174
Update build-macos.yml 2025-08-08 16:47:51 -05:00
Anirudh Sevugan
9e73bffd51
Update build-macos.yml 2025-08-08 16:44:57 -05:00
Anirudh Sevugan
18f25c5ef4
Update build-macos.yml 2025-08-08 16:36:21 -05:00
Anirudh Sevugan
05bb059b41
Attempt to make file sizes smaller 2025-08-08 16:33:17 -05:00
Anirudh Sevugan
791761fd8f
Switch to APFS for DMGs 2025-08-08 16:26:39 -05:00
Anirudh Sevugan
515033fc88
rerun to see if builds are still huge macOS 2025-08-08 16:23:32 -05:00
Anirudh Sevugan
676efb060e
clear caches so builds aren't huge 2025-08-07 21:15:28 -05:00
Anirudh Sevugan
df9557786d
add Applications symlink this time 2025-08-07 21:03:04 -05:00
Anirudh Sevugan
fdfa95790c
Update build-macos.yml 2025-08-07 20:58:08 -05:00
Anirudh Sevugan
26a04b8988
Update build-macos.yml 2025-08-07 20:55:42 -05:00
Anirudh Sevugan
3eb2a7c7fd
Update build-macos.yml 2025-08-07 20:53:39 -05:00
Anirudh Sevugan
4759073cc4
test macOS workflow 2025-08-07 20:52:13 -05:00
Anirudh Sevugan
a2693a2978
test new macOS workflow 2025-08-07 20:51:21 -05:00
Anirudh Sevugan
ecc5cf1d37
Update build-macos.yml 2025-08-07 20:50:02 -05:00
Anirudh Sevugan
be0180a415
Add files via upload 2025-08-07 20:49:18 -05:00
Anirudh Sevugan
331f8e3c9f
Update build-macos.yml 2025-08-07 20:45:49 -05:00
Anirudh Sevugan
fe769d84b3
Update build-macos.yml 2025-08-07 20:39:42 -05:00
Anirudh Sevugan
c512923a8e
Update package.json 2025-08-07 20:37:18 -05:00
Anirudh Sevugan
1b4d4598e1
Update build-macos.yml 2025-08-07 20:36:27 -05:00
Anirudh Sevugan
3c5ebd4ec4
Update build-macos.yml 2025-08-07 20:30:23 -05:00
Anirudh Sevugan
22fe95d424
final codesigning 2025-08-07 20:27:45 -05:00
Anirudh Sevugan
256239dda9
Update build-macos.yml 2025-08-07 20:25:21 -05:00
Anirudh Sevugan
04ed04e863
attempt to codesign 1 2025-08-07 20:23:22 -05:00
Anirudh Sevugan
765832a307
Update build-macos.yml 2025-08-07 20:22:23 -05:00
Anirudh Sevugan
9cc9fb95eb
Update build-macos.yml 2025-08-07 20:20:27 -05:00
Anirudh Sevugan
b5007ad65e
Improve code signing to work 2025-08-07 20:17:31 -05:00
Anirudh Sevugan
5b82845458
Update build-macos.yml 2025-08-07 20:14:49 -05:00
Anirudh Sevugan
8087296918
Update build-macos.yml 2025-08-07 20:11:59 -05:00
Anirudh Sevugan
a7a5ffe633
Update build-macos.yml 2025-08-07 20:07:13 -05:00
Anirudh Sevugan
ef6fdfb4a4
Update build-macos.yml 2025-08-07 20:03:50 -05:00
Anirudh Sevugan
282081dfe7
Update build-macos.yml 2025-08-07 19:57:50 -05:00
Anirudh Sevugan
25c9044261
Update build-macos.yml 2025-08-07 19:54:47 -05:00
Anirudh Sevugan
c473720d35
Update build-macos.yml 2025-08-07 19:50:30 -05:00
Anirudh Sevugan
df6906ecc9
Update build-macos.yml 2025-08-07 19:49:13 -05:00
Anirudh Sevugan
e3412a7f92
Update build-macos.yml 2025-08-07 19:38:38 -05:00
Anirudh Sevugan
dbd91eeebf
Update build-macos.yml 2025-08-07 19:35:36 -05:00
Anirudh Sevugan
cf5b61fb88
Update README.md 2025-08-06 21:27:32 -05:00
Anirudh Sevugan
6157ac2b68
Update package.json 2025-08-06 20:30:06 -05:00
Anirudh Sevugan
9894d89a0c
Update package-arm64-linux.json 2025-08-06 20:29:31 -05:00
Anirudh Sevugan
17ad99cd5d
Update package.json 2025-08-06 20:29:21 -05:00
Anirudh Sevugan
62445407ea
Update package.json 2025-08-06 20:27:53 -05:00
Anirudh Sevugan
2aa07629c5
Update package-arm64-linux.json 2025-08-06 20:27:27 -05:00
Anirudh Sevugan
92f76eeebe
Update package.json 2025-08-06 20:26:59 -05:00
Anirudh Sevugan
c429e03f42
Update main-es.js 2025-08-06 20:24:17 -05:00
Anirudh Sevugan
ec6494b13f
Update package.json 2025-08-06 20:23:47 -05:00
Anirudh Sevugan
737b6e6379
Update package-arm64-linux.json 2025-08-06 20:22:39 -05:00
Anirudh Sevugan
e6fee04fde
Update package-arm64-linux.json 2025-08-06 20:22:12 -05:00
Anirudh Sevugan
cc715afb90
Update draft-release.yml 2025-08-06 18:35:32 -05:00
Anirudh Sevugan
8e63507dbd
Update draft-release.yml 2025-08-06 18:34:58 -05:00
Anirudh Sevugan
5f8cb2d794
Update package.json 2025-08-06 18:34:05 -05:00
Anirudh Sevugan
66352b99d5
Update draft-release.yml 2025-08-06 18:21:15 -05:00
Anirudh Sevugan
e181fb7950
Update draft-release.yml 2025-08-06 18:17:14 -05:00
Anirudh Sevugan
379fa1e9e3
Update draft-release.yml 2025-08-06 18:13:59 -05:00
Anirudh Sevugan
5366657a3f
Update draft-release.yml 2025-08-06 18:12:01 -05:00
Anirudh Sevugan
1a048d61c3
Update draft-release.yml 2025-08-06 18:05:05 -05:00
Anirudh Sevugan
30be5c41ec
Update draft-release.yml 2025-08-06 17:58:59 -05:00
Anirudh Sevugan
ef99b5a525
Update draft-release.yml 2025-08-06 17:55:41 -05:00
Anirudh Sevugan
74d7589809
Update draft-release.yml 2025-08-06 17:50:52 -05:00
Anirudh Sevugan
c59b9c47ab
Update draft-release.yml 2025-08-06 17:48:59 -05:00
Anirudh Sevugan
9d0887cb92
Update draft-release.yml 2025-08-06 17:46:02 -05:00
Anirudh Sevugan
9865aecb70
Update draft-release.yml 2025-08-06 17:41:03 -05:00
Anirudh Sevugan
40b25415d8
Rename draft-release.yaml to draft-release.yml 2025-08-06 17:36:10 -05:00
Anirudh Sevugan
b0f3deccba
Create draft-release.yaml 2025-08-06 17:34:55 -05:00
Anirudh Sevugan
6286139a81
Update main.js 2025-08-06 17:24:32 -05:00
Anirudh Sevugan
61961cc157
Update package.json 2025-08-06 17:24:05 -05:00
Anirudh Sevugan
71d86f752e
Update build-linux.yml 2025-08-04 15:41:29 -05:00
Anirudh Sevugan
6db391d6e3
Update build-linux.yml 2025-08-04 15:38:33 -05:00
Anirudh Sevugan
34fbe67c53
Update build-linux.yml 2025-08-04 15:37:50 -05:00
Anirudh Sevugan
387d4c98bd
Update build-linux.yml 2025-08-04 15:33:17 -05:00
Anirudh Sevugan
fce24322f7
Update build-linux.yml 2025-08-04 15:30:31 -05:00
Anirudh Sevugan
f80ded4304
Update build-linux.yml 2025-08-04 15:29:51 -05:00
Anirudh Sevugan
1cbdd5f6aa
Create package-arm64-linux.json 2025-08-04 15:27:39 -05:00
Anirudh Sevugan
25cb540499
Update package.json 2025-08-04 15:27:26 -05:00
Anirudh Sevugan
fbd5081bbe
Update package.json 2025-08-04 15:24:51 -05:00
Anirudh Sevugan
0e7b221d03
Update build-linux.yml 2025-08-04 15:24:09 -05:00
Anirudh Sevugan
fbef9a1ae8
Update build-linux.yml 2025-08-04 15:21:52 -05:00
Anirudh Sevugan
642ffb90f9
Update build-linux.yml 2025-08-04 15:18:01 -05:00
Anirudh Sevugan
eaab177667
Update build-linux.yml 2025-08-04 15:13:42 -05:00
Anirudh Sevugan
aa4a464498
Update build-linux.yml 2025-08-04 14:16:14 -05:00
Anirudh Sevugan
07687789a6
Update build-linux.yml 2025-08-04 14:11:18 -05:00
Anirudh Sevugan
7670e87dc2
Update build-linux.yml 2025-08-04 14:09:42 -05:00
Anirudh Sevugan
a8157cd805
Update build-linux.yml 2025-08-04 14:08:31 -05:00
Anirudh Sevugan
820c0776e4
Update build-linux.yml 2025-08-04 14:07:16 -05:00
Anirudh Sevugan
25f86b5dba
Update build-linux.yml 2025-08-04 14:06:09 -05:00
Anirudh Sevugan
e313b6fa6e
Update index-es.html 2025-08-02 23:41:59 -05:00
Anirudh Sevugan
72c3d62724
Create player-es.js 2025-08-02 23:41:48 -05:00
Anirudh Sevugan
b2256919ee
Create main-es.js 2025-08-02 23:41:26 -05:00
Anirudh Sevugan
50ea2181da
Update index-es.html 2025-08-02 23:26:32 -05:00
Anirudh Sevugan
e5d2afa352
Create index-es.html 2025-08-02 23:23:40 -05:00
13 changed files with 1514 additions and 39 deletions

View File

@ -33,7 +33,7 @@ jobs:
path: simpliplay/dist/*.AppImage path: simpliplay/dist/*.AppImage
build_arm64: build_arm64:
runs-on: ubuntu-24.04-arm runs-on: ubuntu-22.04-arm
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -41,14 +41,36 @@ jobs:
with: with:
node-version: 22 node-version: 22
- name: Use ARM64 package.json
run: |
mv simpliplay/package.json simpliplay/package-unused.json
mv simpliplay/package-arm64-linux.json simpliplay/package.json
- run: npm install - run: npm install
working-directory: simpliplay working-directory: simpliplay
- run: npx electron-builder --linux AppImage --arm64 - run: npx electron-builder --linux AppImage --arm64
working-directory: simpliplay working-directory: simpliplay
- run: sudo apt-get update && sudo apt-get install --only-upgrade libgdk-pixbuf-2.0-0
- run: sudo snap install snapcraft --classic
- run: sudo snap install gnome-3-28-1804
- run: sudo snap install gtk-common-themes
- run: sudo snap install core22
- run: SNAPCRAFT_BUILD_ENVIRONMENT=host USE_SYSTEM_FPM=true npx electron-builder --linux snap --arm64
working-directory: simpliplay
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: linux-arm64-appimage name: linux-arm64-appimage
path: simpliplay/dist/*.AppImage path: simpliplay/dist/*.AppImage
- uses: actions/upload-artifact@v4
with:
name: linux-arm64-snap
path: simpliplay/dist/*.snap

View File

@ -19,13 +19,17 @@ jobs:
with: with:
node-version: 22 node-version: 22
- name: Clean up caches
run: |
npm cache clean --force
rm -rf ~/Library/Caches/electron-builder
working-directory: simpliplay
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install
working-directory: simpliplay working-directory: simpliplay
- name: Build macOS - name: Create DMGs
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
run: npx electron-builder --mac --x64 --arm64 --universal run: npx electron-builder --mac --x64 --arm64 --universal
working-directory: simpliplay working-directory: simpliplay
@ -33,4 +37,5 @@ jobs:
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: builds name: builds
# Upload only the final signed DMGs
path: simpliplay/dist/*.dmg path: simpliplay/dist/*.dmg

129
.github/workflows/draft-release.yml vendored Normal file
View File

@ -0,0 +1,129 @@
name: Draft Release
on:
workflow_dispatch:
jobs:
create-draft-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare folder
run: mkdir -p all-artifacts
- name: Poll for expected artifacts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Polling (every 15 seconds) until all required artifacts are available..."
REQUIRED=("linux-x64-appimage" "linux-x64-snap" "linux-arm64-snap" "builds" "builds-x64" "builds-arm64")
while true; do
echo "⏳ Checking artifacts..."
rm -rf all-artifacts
mkdir -p all-artifacts
gh run download --dir all-artifacts || true
missing=0
for ARTIFACT in "${REQUIRED[@]}"; do
if [ ! -d "all-artifacts/$ARTIFACT" ]; then
echo "❌ Missing: $ARTIFACT"
missing=1
fi
done
if [ "$missing" -eq 0 ]; then
echo "✅ All required artifacts found."
break
fi
echo "🔁 Not all artifacts were found. Retrying in 15 seconds..."
sleep 15
done
- name: Extract ZIP files and prepare list of files to upload
run: |
set -e
echo "🔍 Extracting ZIP files and collecting allowed SimpliPlay files..."
find all-artifacts -type f -name '*.zip' | while read -r zipfile; do
extract_dir="${zipfile%.zip}"
echo "📦 Extracting $zipfile to $extract_dir"
unzip -o "$zipfile" -d "$extract_dir"
done
rm -f upload-files.txt
find all-artifacts -type f \( -iname '*.exe' -o -iname '*.dmg' -o -iname '*.AppImage' \) | grep 'SimpliPlay' > upload-files.txt
echo "Filtered files to upload:"
cat upload-files.txt
- name: Create empty draft release
uses: softprops/action-gh-release@v2
with:
tag_name: "draft-${{ github.run_number }}"
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rename files if duplicates exist on release
id: rename
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
sanitize_filename() {
echo "$1" | tr ' ' '-'
}
release_tag="draft-${{ github.run_number }}"
existing_assets=$(gh release view "$release_tag" --json assets --jq '.assets[].name' || echo "")
echo "Existing assets on release $release_tag:"
echo "$existing_assets"
rm -f upload-files-renamed.txt
touch upload-files-renamed.txt
while IFS= read -r filepath; do
filename=$(basename "$filepath")
dirname=$(basename "$(dirname "$filepath")")
safe_filename=$(sanitize_filename "$filename")
if echo "$existing_assets" | grep -qx "$safe_filename"; then
extension="${filename##*.}"
name="${filename%.*}"
safe_name=$(sanitize_filename "$name")
newname="${safe_name}-${dirname}.${extension}"
echo "Renaming $filename to $newname because it exists in release"
cp "$filepath" "all-artifacts/$newname"
echo "all-artifacts/$newname" >> upload-files-renamed.txt
else
if [[ "$filename" != "$safe_filename" ]]; then
cp "$filepath" "all-artifacts/$safe_filename"
echo "all-artifacts/$safe_filename" >> upload-files-renamed.txt
else
echo "$filepath" >> upload-files-renamed.txt
fi
fi
done < upload-files.txt
echo "Final list of files to upload:"
cat upload-files-renamed.txt
- name: Upload assets to draft release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
release_tag="draft-${{ github.run_number }}"
while IFS= read -r filepath; do
echo "Uploading $filepath"
gh release upload "$release_tag" "$filepath" --clobber
done < upload-files-renamed.txt

View File

@ -1,27 +1,30 @@
# simpliplay-desktop # simpliplay-desktop
The desktop version of SimpliPlay. The desktop version of SimpliPlay, a simple, cross-platform media player.
## simpliplay ## simpliplay
[Electron](https://electronjs.org) version of SimpliPlay for Windows, macOS, and Linux (x64 and ARM64). [Electron](https://electronjs.org) version of SimpliPlay for Windows, macOS, and Linux (x64 and ARM64).
## [simpliplay-lite](https://github.com/A-Star100/simpliplay-desktop/tree/lite) ## [simpliplay-lite](https://github.com/A-Star100/simpliplay-desktop/tree/lite)
[Neutralinojs](https://neutralino.js.org) version of SimpliPlay (significantly smaller filesize) for Windows (x64 only), macOS, and Linux (both x64 and ARM64). [Neutralinojs](https://neutralino.js.org) version of SimpliPlay (significantly smaller filesize) for Windows (x64 only), macOS, and Linux (both x64 and ARM64).
> [!WARNING]
> This version of SimpliPlay has been [officially discontinued](https://simpliplay.netlify.app/docs/blog/lite-ver-end) and **will not** receive any more security updates.
> It is still stable and secure, but has not received a few patches (e.g, the infamous **[memory leak issue](https://github.com/A-Star100/simpliplay-desktop/issues/4)**) that the web version, Chrome extension, and main desktop version all have.
## [simpliplay-nwjs](https://github.com/A-Star100/simpliplay-desktop/tree/nwjs) ## [simpliplay-nwjs](https://github.com/A-Star100/simpliplay-desktop/tree/nwjs)
[NW.js](https://nwjs.io) version of SimpliPlay for Windows, macOS, and Linux (x64 and ARM64). [NW.js](https://nwjs.io) version of SimpliPlay for Windows, macOS, and Linux (x64 and ARM64).
> [!WARNING] > [!IMPORTANT]
> This version is an example NW.js configuration, it won't be used in production, but you can use it if you would like. Files in this version won't be updated, so refer to files from the Electron release for production usage. > This version is an example NW.js configuration, it won't be used in production, but you can use it if you would like. Files in this version won't be updated, so refer to files from the Electron release for production usage.
## [simpliplay-legacy](https://github.com/A-Star100/simpliplay-desktop/tree/legacy) ## [simpliplay-legacy](https://github.com/A-Star100/simpliplay-desktop/tree/legacy)
[Legacy](https://simpliplay.netlify.app/legacy) version of SimpliPlay for Windows, macOS, and Linux (x64 and x86). [Legacy](https://simpliplay.netlify.app/legacy) version of SimpliPlay for Windows, macOS, and Linux (x64 and x86).
> [!WARNING] > [!CAUTION]
> This version uses a very old, legacy version of NW.js that supports Windows XP and macOS 10.6 or later. Unless the main desktop version isn't supported on your operating system, **don't** > This version uses a very old, legacy version of NW.js that supports Windows XP and macOS 10.6 or later.
> use the legacy version, it will open you up to security issues on newer devices! > Unless the main desktop version isn't supported on your operating system, **please don't use the legacy version**, it will open you up to **security issues** on newer devices!
___ ___
## Setup ## Setup
Read the docs ([Electron - Tutorial](https://www.electronjs.org/docs/latest/tutorial/tutorial-prerequisites), [Neutralinojs - Your First App](https://neutralino.js.org/docs/getting-started/your-first-neutralinojs-app), [NW.js - Getting Started (For Users)](https://nwjs.readthedocs.io/en/latest/For%20Users/Getting%20Started/#write-nwjs-app)) Read the docs ([Electron - Tutorial](https://www.electronjs.org/docs/latest/tutorial/tutorial-prerequisites), [Neutralinojs - Your First App](https://neutralino.js.org/docs/getting-started/your-first-neutralinojs-app), [NW.js - Getting Started (For Users)](https://nwjs.readthedocs.io/en/latest/For%20Users/Getting%20Started/#write-nwjs-app))
## Mirrors ## Mirrors
Self-hosted mirror available [here](https://git.anirudhsevugan.me/simpliplay/simpliplay-desktop-mirror). Self-hosted mirror available [here](https://new-git.anirudhsevugan.me/anirudh/simpliplay-desktop/src/branch/main/).
**The server may not always be up. You'll see a screen saying "Git is down" if the server is down, with a link to contact me (the webmaster)**. **The server may not always be up. If it isn't, you can contact me at: (personal at anirudhsevugan dot me)**.

View File

@ -1 +1,11 @@
Source code for SimpliPlay.
--BUILD STUFF--
SimpliPlay uses Electron Builder for desktop builds, but includes an example Electron Forge config that will work as expected but does not support native actions such as file picking from the explorer; the package.json uses electron-builder specific actions for that.
--CI/CD--
We now use CI/CD (specifically GitHub Actions, at one point CircleCI) for builds, but Linux ARM64 snaps in particular were annoying to get started with. After multiple attempts, it finally worked as expected (with a few really stupid workarounds required that shouldn't even be needed).
--DEPENDENCIES--
Other than Electron and Electron Builder, there is one more dependency called "Nothing".
Its name is very self explanatory, isn't it?

105
simpliplay/index-es.html Normal file
View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="es">
<head>
<!-- this is the Spanish version of SimpliPlay, you can find the translation status at https://crowdin.com/project/simpliplay -->
<script src="player-es.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="
default-src 'self';
script-src 'self';
style-src 'self';
img-src 'self' data:;
media-src * blob: file:;
connect-src *;
font-src 'self';
object-src 'none';
child-src 'none';
form-action 'self';
worker-src 'self' blob:;
">
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<link rel="stylesheet" href="styles.css">
<script src="lib/dash.js"></script>
<script src="lib/hls.js"></script>
<!--<script src="lib/midi.js"></script>-->
<title>SimpliJuega</title>
</head>
<body>
<h1>SimpliJuega</h1>
<div class="dialog-overlay" id="dialogOverlay">
<div class="dialog">
<p>Seleccione cómo desea cargar los medios:</p>
<button id="chooseFileBtn">Seleccionar un archivo</button>
<button id="enterUrlBtn">Introduzca una URL</button>
<button id="hideDialogBtn">Volver atrás</button>
<input type="file" id="fileInput" accept="video/*,audio/*">
</div>
</div>
<div class="dialog-overlay" id="urlDialogOverlay">
<div class="dialog">
<p>Introduzca la URL del medio:</p>
<input type="url" id="urlInput" placeholder="Introduzca aquí la URL del medio">
<button id="submitUrlBtn">Enviar</button>
<button id="cancelUrlBtn">Cancelar</button>
</div>
</div>
<div class="subtitles-overlay" id="subtitlesOverlay">
<div class="subtitles-dialog">
<p>Introduzca la URL de los subtítulos:</p>
<input type="url" id="subtitlesInput" placeholder="Introduzca aquí la URL de los subtítulos">
<button id="submitSubtitlesBtn">Enviar</button>
<button id="cancelSubtitlesBtn">Cancelar</button>
</div>
</div>
<video id="mediaPlayer" autoplay controls></video>
<midi-player
src=""
sound-font visualizer="#myVisualizer"
id="midiplayer"
>
</midi-player>
<midi-visualizer type="piano-roll" id="myVisualizer"></midi-visualizer>
<div id="customControls">
<button id="playPauseBtn">Pausa</button>
<input type="range" id="seekBar" min="0" value="0" step="0.1">
<span id="timeDisplay">00:00 / 00:00</span>
<button id="volumeBtn">🔊</button>
<input type="range" id="volumeBar" min="0" max="1" step="0.1" value="1">
<button id="fullscreenBtn"></button>
<button id="ccBtn">Añadir subtítulos</button> <!-- CC button -->
</div>
<div class="gap-box"></div>
<button id="showDialogBtn">Reproduce más contenido multimedia</button>
<!-- Settings gear button -->
<button id="settingsBtn">⚙️</button>
<!-- Settings panel -->
<div class="dialog-overlay" id="settingsDialogOverlay">
<div id="settingsPanel">
<label for="autoplayCheckbox">Reproducción automática:</label>
<input type="checkbox" id="autoplayCheckbox" checked><br>
<label for="loopCheckbox">Bucle:</label>
<input type="checkbox" id="loopCheckbox"><br>
<label for="controlsCheckbox">Controles:</label>
<input type="checkbox" id="controlsCheckbox" checked><br>
<label for="controlsCheckbox">Colores vivos:</label>
<input type="checkbox" id="colorsCheckbox"><br>
<p class="settings-info"><em>La configuración solo se aplica a esta sesión.</em></p>
<button id="saveSettingsBtn">Guardar configuración</button>
</div>
</div>
<script src="./renderer.js"></script>
</body>
</html>

462
simpliplay/main-es.js Normal file
View File

@ -0,0 +1,462 @@
const { app, BrowserWindow, Menu, MenuItem, shell, dialog, globalShortcut } = require('electron');
const path = require('path');
const fs = require('fs');
const os = require('os');
const { pathToFileURL } = require("url");
const { checkForUpdate } = require('./updateChecker');
let gpuAccel = "";
let didRegisterShortcuts = false;
let version = "2.1.3.0"
if (process.platform === 'darwin') {
if (process.argv.includes('--use-gl')) {
app.commandLine.appendSwitch('disable-features', 'Metal');
app.commandLine.appendSwitch('use-gl', 'desktop');
}
}
// random change just to make sure that snapcraft releases fixed version on new channel to delete arm64 versions
let mainWindow;
if (process.argv.includes('--disable-gpu')) {
app.disableHardwareAcceleration();
gpuAccel = "disabled";
}
// Handle file opening from Finder or File Explorer
app.on('open-file', (event, filePath) => {
event.preventDefault();
openFile(filePath);
});
const openFile = (filePath) => {
app.whenReady().then(() => {
const fileURL = pathToFileURL(filePath).href;
if (mainWindow) {
if (mainWindow.webContents.isLoading()) {
mainWindow.webContents.once("did-finish-load", () => {
mainWindow.webContents.send("play-media", fileURL);
});
} else {
mainWindow.webContents.send("play-media", fileURL);
}
} else {
createWindow(() => {
mainWindow.webContents.send("play-media", fileURL);
});
}
});
};
const takeSnapshot = async () => {
if (!mainWindow) return;
try {
const image = await mainWindow.webContents.capturePage();
const png = image.toPNG();
const snapshotsDir = path.join(os.homedir(), 'simpliplay-snapshots');
fs.mkdirSync(snapshotsDir, { recursive: true });
const filePath = path.join(snapshotsDir, `snapshot-${Date.now()}.png`);
fs.writeFileSync(filePath, png);
const { response } = await dialog.showMessageBox(mainWindow, {
type: 'info',
title: 'Instantánea guardada',
message: `Instantánea guardada en:\n${filePath}`,
buttons: ['Vale', 'Abrir archivo'],
defaultId: 0,
});
if (response === 1) shell.openPath(filePath);
} catch (error) {
dialog.showErrorBox("Error de instantánea", `No se pudo capturar la instantánea: ${error.message}`);
}
};
const createWindow = (onReadyCallback) => {
if (!app.isReady()) {
app.whenReady().then(() => createWindow(onReadyCallback));
return;
}
if (mainWindow) mainWindow.close();
mainWindow = new BrowserWindow({
width: 1920,
height: 1080,
webPreferences: {
preload: path.join(__dirname, "preload.js"),
contextIsolation: true,
enableRemoteModule: false,
nodeIntegration: false, // Keep this false for security
sandbox: true,
},
});
mainWindow.loadFile("index.html");
if (process.platform === 'darwin') {
if (process.argv.includes('--use-gl')) {
mainWindow.webContents.on('did-finish-load', () => {
mainWindow.webContents.executeJavaScript("navigator.userAgent").then(ua => {
console.log("User Agent:", ua);
});
mainWindow.webContents.executeJavaScript("chrome.loadTimes ? chrome.loadTimes() : {}").then(loadTimes => {
console.log("GPU Info (legacy):", loadTimes);
});
});
}
}
mainWindow.once("ready-to-show", () => {
if (gpuAccel === "disabled") {
dialog.showMessageBox(mainWindow, {
type: 'warning',
buttons: ['Vale'],
defaultId: 0,
title: '¡Atención!',
message: "Desactivar la aceleración de la GPU reduce considerablemente el rendimiento y no es recomendable, pero si tienes curiosidad, no voy a impedírtelo.",
});
}
if (onReadyCallback) onReadyCallback();
});
setupContextMenu();
};
// Set up context menu (prevents errors if `mainWindow` is undefined)
const setupContextMenu = () => {
if (!mainWindow) return;
const contextMenu = new Menu();
contextMenu.append(new MenuItem({ label: 'Toma una instantánea', click: takeSnapshot }));
contextMenu.append(new MenuItem({ type: 'separator' }));
contextMenu.append(new MenuItem({ label: 'Inspeccionar', click: () => mainWindow.webContents.openDevTools() }));
mainWindow.webContents.on('context-menu', (event) => {
event.preventDefault();
contextMenu.popup({ window: mainWindow });
});
};
// Set up application menu
const setupMenu = () => {
const menu = Menu.getApplicationMenu();
if (!menu) return;
const fileMenu = menu.items.find(item => item.label === 'File');
if (fileMenu && !fileMenu.submenu.items.some(item => item.label === 'Toma una instantánea')) {
fileMenu.submenu.append(new MenuItem({ label: 'Toma una instantánea', accelerator: 'CommandOrControl+Shift+S', click: takeSnapshot }));
}
const appMenu = menu.items.find(item => item.label === 'SimpliPlay');
if (appMenu && !appMenu.submenu.items.some(item => item.label === 'Buscar actualizaciones')) {
const submenu = appMenu.submenu;
const separatorIndex = submenu.items.findIndex(item => item.type === 'separator');
const updateMenuItem = new MenuItem({
label: 'Buscar actualizaciones',
accelerator: 'CommandOrControl+Shift+U',
click: () => checkForUpdate(version)
});
if (separatorIndex === -1) {
// No separator found — just append
submenu.append(updateMenuItem);
} else {
// Insert right before the separator
submenu.insert(separatorIndex, updateMenuItem);
}
}
const helpMenu = menu.items.find(item => item.label === 'Help');
if (helpMenu) {
const addMenuItem = (label, url) => {
if (!helpMenu.submenu.items.some(item => item.label === label)) {
helpMenu.submenu.append(new MenuItem({ label, click: () => shell.openExternal(url) }));
}
};
addMenuItem('Código fuente', 'https://github.com/A-Star100/simpliplay-desktop');
addMenuItem('Sitio web', 'https://simpliplay.netlify.app');
addMenuItem('Centro de ayuda', 'https://simpliplay.netlify.app/help');
// Check for Updates
if (!helpMenu.submenu.items.some(item => item.label === 'Buscar actualizaciones')) {
helpMenu.submenu.append(
new MenuItem({
label: 'Buscar actualizaciones',
accelerator: 'CommandOrControl+Shift+U',
click: () => checkForUpdate(version)
})
);
}
if (!helpMenu.submenu.items.some(item => item.label === 'Salir')) {
helpMenu.submenu.append(new MenuItem({ type: 'separator' }));
helpMenu.submenu.append(new MenuItem({ label: 'Salir', click: () => app.quit() }));
}
}
const loadedAddons = new Map(); // key: addon filepath, value: MenuItem
const newMenuItems = menu ? [...menu.items] : [];
let addonsMenu;
// Check if Add-ons menu already exists
const existingAddonsMenuItem = newMenuItems.find(item => item.label === 'Add-ons');
if (existingAddonsMenuItem) {
addonsMenu = existingAddonsMenuItem.submenu;
} else {
addonsMenu = new Menu();
// "Load Add-on" menu item
addonsMenu.append(new MenuItem({
label: 'Cargar complemento',
accelerator: 'CommandOrControl+Shift+A',
click: async () => {
const result = await dialog.showOpenDialog(mainWindow, {
title: 'Cargar complemento',
filters: [{ name: 'JavaScript Files', extensions: ['simpliplay'] }],
properties: ['openFile'],
});
if (!result.canceled && result.filePaths.length > 0) {
const filePath = result.filePaths[0];
const fileName = path.basename(filePath);
const fileURL = pathToFileURL(filePath).href;
// Check if an addon with the same filename is already loaded
const alreadyLoaded = [...loadedAddons.keys()].some(
loadedPath => path.basename(loadedPath) === fileName
);
if (alreadyLoaded) {
await dialog.showMessageBox(mainWindow, {
type: 'error',
title: 'No se pudo cargar el complemento',
message: `Un complemento llamado "${fileName}" ya se ha cargado anteriormente.`,
buttons: ['Vale']
});
return;
}
if (!loadedAddons.has(filePath)) {
mainWindow.webContents.send('load-addon', fileURL);
const addonMenuItem = new MenuItem({
label: fileName,
type: 'checkbox',
checked: true,
click: (menuItem) => {
if (menuItem.checked) {
fs.access(filePath, (err) => {
if (!err) {
mainWindow.webContents.send('load-addon', fileURL);
} else {
dialog.showMessageBox(mainWindow, {
type: 'error',
title: 'No se pudo cargar el complemento',
message: `El complemento "${fileName}" no se ha encontrado o ya no existe.`,
buttons: ['Vale']
}).then(() => {
// Delay unchecking to ensure dialog closes first
setTimeout(() => {
menuItem.checked = false;
}, 100);
});
}
});
} else {
mainWindow.webContents.send('unload-addon', fileURL);
}
}
});
if (!addonsMenu.items.some(item => item.type === 'separator')) {
addonsMenu.append(new MenuItem({ type: 'separator' }));
}
addonsMenu.append(addonMenuItem);
loadedAddons.set(filePath, addonMenuItem);
// Rebuild the menu after adding the new addon item
Menu.setApplicationMenu(Menu.buildFromTemplate(newMenuItems));
}
}
}
}));
// "About Addons" menu item (info dialog version)
addonsMenu.append(new MenuItem({
label: 'Acerca de los complementos',
click: async () => {
const result = await dialog.showMessageBox(mainWindow, {
type: 'info',
buttons: ['De acuerdo'],
defaultId: 0,
title: 'Acerca de los complementos',
message: 'Los complementos pueden hacer casi cualquier cosa, desde añadir funciones al reproductor multimedia hasta añadir un juego completo dentro de la aplicación.',
detail: 'Los complementos son archivos JavaScript normales del lado del cliente con la extensión [.simpliplay].'
});
if (result.response === 0) {
console.log('El usuario hizo clic en Aceptar.');
// no need for dialog.closeDialog()
}
}
}));
// Add the Add-ons menu only once here:
newMenuItems.push(new MenuItem({ label: 'Add-ons', submenu: addonsMenu }));
// Set the application menu after adding Add-ons menu
Menu.setApplicationMenu(Menu.buildFromTemplate(newMenuItems));
}
// Re-apply the full menu if you add newMenuItems outside of the if above
//Menu.setApplicationMenu(Menu.buildFromTemplate(newMenuItems));
//Menu.setApplicationMenu(menu);
};
const setupShortcuts = () => {
if (didRegisterShortcuts === false) {
globalShortcut.register('CommandOrControl+Q', () => {
const focusedWindow = BrowserWindow.getFocusedWindow(); // Get the currently focused window
if (!focusedWindow) return; // Do nothing if no window is focused
dialog.showMessageBox(focusedWindow, {
type: 'question',
buttons: ['Cancelar', 'Salir'],
defaultId: 1,
title: '¿Renunciar?',
message: '¿Estás seguro de que quieres salir de SimpliJuega?',
}).then(({ response }) => {
if (response === 1) app.quit();
});
});
globalShortcut.register('CommandOrControl+Shift+S', () => {
const focusedWindow = BrowserWindow.getFocusedWindow(); // Get the currently focused window
if (!focusedWindow) return; // Do nothing if no window is focused
takeSnapshot();
});
globalShortcut.register('CommandOrControl+S', () => {
const focusedWindow = BrowserWindow.getFocusedWindow(); // Get the currently focused window
if (!focusedWindow) return; // Do nothing if no window is focused
takeSnapshot();
});
// globalShortcut.register('CommandOrControl+Shift+S', takeSnapshot);
didRegisterShortcuts = true;
}
};
function unregisterShortcuts() {
didRegisterShortcuts = false;
globalShortcut.unregisterAll();
console.log("Shortcuts unregistered");
}
app.whenReady().then(() => {
createWindow();
setupMenu();
mainWindow?.on("focus", () => {
if (!didRegisterShortcuts) setupShortcuts();
});
mainWindow?.on("blur", unregisterShortcuts);
// Store but delay opening
const args = process.argv.slice(2);
const fileArg = args.find(isValidFileArg);
if (fileArg) {
app.whenReady().then(() => {
if (mainWindow) openFileSafely(fileArg);
});
}
app.on("open-file", (event, filePath) => {
event.preventDefault();
openFileSafely(filePath);
});
if (["win32", "linux"].includes(process.platform)) {
if (!app.requestSingleInstanceLock()) {
app.quit();
} else {
app.on("second-instance", (event, argv) => {
const fileArg = argv.find(isValidFileArg);
if (fileArg) openFileSafely(fileArg);
});
}
}
});
let hasOpenedFile = false;
function openFileSafely(filePath) {
if (!hasOpenedFile) {
hasOpenedFile = true;
const absPath = path.resolve(filePath); // ensure absolute path
if (mainWindow?.webContents) {
const winFileURL = pathToFileURL(filePath).href; // ✅ Convert and encode file path
mainWindow.webContents.send("play-media", winFileURL);
}
setTimeout(() => (hasOpenedFile = false), 1000);
}
}
function isValidFileArg(arg) {
if (!arg || arg.startsWith('-') || arg.includes('electron')) return false;
const resolvedPath = path.resolve(arg);
if (!fs.existsSync(resolvedPath)) return false;
// Reject known executable/script extensions
const badExtensions = ['.exe', '.bat', '.cmd', '.sh', '.msi', '.com', '.vbs', '.ps1', '.jar', '.scr'];
const ext = path.extname(resolvedPath).toLowerCase();
return !badExtensions.includes(ext);
}
app.on("window-all-closed", () => {
globalShortcut.unregisterAll();
app.quit();
/* once bug fixed replace above with:
if (process.platform !== 'darwin') app.quit() */
});
app.on("will-quit", () => {
globalShortcut.unregisterAll();
});

View File

@ -6,7 +6,7 @@ const { pathToFileURL } = require("url");
const { checkForUpdate } = require('./updateChecker'); const { checkForUpdate } = require('./updateChecker');
let gpuAccel = ""; let gpuAccel = "";
let didRegisterShortcuts = false; let didRegisterShortcuts = false;
let version = "2.0.4.2" let version = "2.1.4.0"
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
if (process.argv.includes('--use-gl')) { if (process.argv.includes('--use-gl')) {
@ -285,6 +285,8 @@ if (existingAddonsMenuItem) {
} }
}); });
if (!addonsMenu.items.some(item => item.type === 'separator')) { if (!addonsMenu.items.some(item => item.type === 'separator')) {
addonsMenu.append(new MenuItem({ type: 'separator' })); addonsMenu.append(new MenuItem({ type: 'separator' }));
} }
@ -299,6 +301,34 @@ if (existingAddonsMenuItem) {
} }
})); }));
// "About Addons" menu item (info dialog version)
addonsMenu.append(new MenuItem({
label: 'About Addons',
click: async () => {
const result = await dialog.showMessageBox(mainWindow, {
type: 'info',
buttons: ['OK'],
defaultId: 0,
title: 'About Addons',
message: 'Addons can do almost anything from adding features to the media player to adding an entire game within the app!',
detail: 'Addons are regular, client-side JavaScript files with the [.simpliplay] extension.'
});
if (result.response === 0) {
console.log('User clicked OK');
// no need for dialog.closeDialog()
}
}
}));
// "Store" menu item (info dialog version)
addonsMenu.append(new MenuItem({
label: 'Store',
click: () => {
shell.openExternal("https://simpliplay.netlify.app/addons/")
}
}));
// Add the Add-ons menu only once here: // Add the Add-ons menu only once here:
newMenuItems.push(new MenuItem({ label: 'Add-ons', submenu: addonsMenu })); newMenuItems.push(new MenuItem({ label: 'Add-ons', submenu: addonsMenu }));

View File

@ -0,0 +1,124 @@
{
"name": "SimpliPlay",
"version": "2.1.4",
"description": "SimpliPlay - The mission to make media playback accessible on every device, anywhere, anytime.",
"main": "./main.js",
"scripts": {
"test": "echo Hello World from SimpliPlay!!!",
"start": "electron-forge start",
"package": "electron-builder --dir",
"make": "electron-builder"
},
"author": "Anirudh Sevugan",
"build": {
"npmRebuild": false,
"appId": "com.anirudhsevugan.simpliPlay",
"productName": "SimpliPlay",
"directories": {
"output": "dist"
},
"snap": {
"confinement": "strict",
"grade": "stable",
"summary": "A cross-platform, simple media player.",
"description": "The mission to make media playback accessible on every platform, anywhere, anytime.",
"base": "core22"
},
"mac": {
"target": [
"dmg"
],
"icon": "icon.icns"
},
"win": {
"target": "nsis",
"icon": "icon.ico"
},
"linux": {
"target": ["snap", "AppImage"],
"icon": "icon.png",
"executableName": "SimpliPlay",
"synopsis": "The mission to make media playback accessible anywhere, anytime.",
"artifactName": "SimpliPlay-${arch}-linux.${ext}"
},
"fileAssociations": [
{
"ext": "mp4",
"name": "MP4 Video",
"role": "Viewer"
},
{
"ext": "webm",
"name": "WebM Video",
"role": "Viewer"
},
{
"ext": "m4v",
"name": "M4V Video",
"role": "Viewer"
},
{
"ext": "m4a",
"name": "M4A Audio",
"role": "Viewer"
},
{
"ext": "ogv",
"name": "OGV Video",
"role": "Viewer"
},
{
"ext": "mp3",
"name": "MP3 Audio",
"role": "Viewer"
},
{
"ext": "aac",
"name": "AAC Audio",
"role": "Viewer"
},
{
"ext": "wav",
"name": "WAV Audio",
"role": "Viewer"
},
{
"ext": "ogg",
"name": "OGG Audio",
"role": "Viewer"
},
{
"ext": "flac",
"name": "FLAC Audio",
"role": "Viewer"
},
{
"ext": "opus",
"name": "Opus Audio",
"role": "Viewer"
},
{
"ext": "mkv",
"name": "MKV Video",
"role": "Viewer"
},
{
"ext": "mov",
"name": "QuickTime Movie",
"role": "Viewer"
}
]
},
"nsis": {
"oneClick": false,
"installerIcon": "icon.ico",
"uninstallerIcon": "icon.ico",
"uninstallDisplayName": "simpliplay-uninstaller",
"license": "LICENSE.md",
"allowToChangeInstallationDirectory": true
},
"devDependencies": {
"electron": "^38.1.0",
"electron-builder": "^26.0.12"
}
}

View File

@ -1,7 +1,7 @@
{ {
"name": "SimpliPlay", "name": "SimpliPlay",
"version": "2.0.4", "version": "2.1.4",
"description": "SimpliPlay - The mission to make media playback accessible on every device, anywhere, anytime.", "description": "The mission to make media playback accessible on every platform, anywhere, anytime.",
"main": "./main.js", "main": "./main.js",
"scripts": { "scripts": {
"test": "echo Hello World from SimpliPlay!!!", "test": "echo Hello World from SimpliPlay!!!",
@ -17,21 +17,42 @@
"directories": { "directories": {
"output": "dist" "output": "dist"
}, },
"snap": {
"confinement": "strict",
"grade": "stable",
"summary": "A cross-platform, simple media player.",
"description": "The mission to make media playback accessible on every platform, anywhere, anytime."
},
"nsis": {
"oneClick": false,
"installerIcon": "icon.ico",
"uninstallerIcon": "icon.ico",
"uninstallDisplayName": "simpliplay-uninstaller",
"allowToChangeInstallationDirectory": true
},
"mac": { "mac": {
"target": [ "target": [
"dmg" "dmg"
], ],
"icon": "icon.icns" "icon": "icon.icns",
"artifactName": "SimpliPlay-${arch}-darwin.${ext}",
"identity": "-"
}, },
"win": { "win": {
"target": "nsis", "target": [
"icon": "icon.ico" {
"target": "nsis",
"arch": ["x64", "arm64"]
}
],
"artifactName": "SimpliPlay-${arch}-win-setup.${ext}"
}, },
"linux": { "linux": {
"target": ["snap", "AppImage"], "target": ["snap", "AppImage"],
"icon": "icon.png", "icon": "icon.png",
"executableName": "SimpliPlay", "executableName": "SimpliPlay",
"synopsis": "The mission to make media playback accessible anywhere, anytime." "synopsis": "The mission to make media playback accessible anywhere, anytime.",
"artifactName": "SimpliPlay-${arch}-linux.${ext}"
}, },
"fileAssociations": [ "fileAssociations": [
{ {
@ -84,6 +105,11 @@
"name": "FLAC Audio", "name": "FLAC Audio",
"role": "Viewer" "role": "Viewer"
}, },
{
"ext": "opus",
"name": "Opus Audio",
"role": "Viewer"
},
{ {
"ext": "mkv", "ext": "mkv",
"name": "MKV Video", "name": "MKV Video",
@ -96,16 +122,8 @@
} }
] ]
}, },
"nsis": {
"oneClick": false,
"installerIcon": "icon.ico",
"uninstallerIcon": "icon.ico",
"uninstallDisplayName": "simpliplay-uninstaller",
"license": "LICENSE.md",
"allowToChangeInstallationDirectory": true
},
"devDependencies": { "devDependencies": {
"electron": "^37.2.5", "electron": "^38.1.0",
"electron-builder": "^26.0.12" "electron-builder": "^26.0.12"
} }
} }

411
simpliplay/player-es.js Normal file
View File

@ -0,0 +1,411 @@
document.addEventListener('DOMContentLoaded', () => {
const dialogOverlay = document.getElementById('dialogOverlay');
const chooseFileBtn = document.getElementById('chooseFileBtn');
const enterUrlBtn = document.getElementById('enterUrlBtn');
const fileInput = document.getElementById('fileInput');
const mediaPlayer = document.getElementById('mediaPlayer');
const playPauseBtn = document.getElementById('playPauseBtn');
const seekBar = document.getElementById('seekBar');
const timeDisplay = document.getElementById('timeDisplay');
const volumeBar = document.getElementById('volumeBar');
const settingsBtn = document.getElementById('settingsBtn');
const settingsPanel = document.getElementById('settingsPanel');
const autoplayCheckbox = document.getElementById('autoplayCheckbox');
const loopCheckbox = document.getElementById('loopCheckbox');
const saveSettingsBtn = document.getElementById('saveSettingsBtn');
const urlDialogOverlay = document.getElementById('urlDialogOverlay');
const settingsDialogOverlay = document.getElementById('settingsDialogOverlay');
const urlInput = document.getElementById('urlInput');
const submitUrlBtn = document.getElementById('submitUrlBtn');
const cancelUrlBtn = document.getElementById('cancelUrlBtn');
const ccBtn = document.getElementById('ccBtn'); // CC button
const volumeBtn = document.getElementById("volumeBtn")
const subtitlesOverlay = document.getElementById('subtitlesOverlay');
const subtitlesInput = document.getElementById('subtitlesInput');
const submitSubtitlesBtn = document.getElementById('submitSubtitlesBtn');
const cancelSubtitlesBtn = document.getElementById('cancelSubtitlesBtn');
const customControls = document.getElementById('customControls');
let hls = null
let player = null
window.hls = hls;
window.dash = player;
async function detectStreamType(url) {
try {
const response = await fetch(url, { method: 'HEAD' });
const contentType = response.headers.get('Content-Type') || '';
const isHLS = url.toLowerCase().endsWith('.m3u8') ||
contentType.includes('application/vnd.apple.mpegurl') ||
contentType.includes('application/x-mpegURL');
const isDASH = url.toLowerCase().endsWith('.mpd') ||
contentType.includes('application/dash+xml');
return { isHLS, isDASH, contentType };
} catch (err) {
console.error("Failed to detect stream type:", err);
return { isHLS: false, isDASH: false, contentType: null };
}
}
// Update media volume when the slider is moved
volumeBar.addEventListener("input", function () {
mediaPlayer.volume = volumeBar.value;
});
// Sync slider with media volume (in case it's changed programmatically)
mediaPlayer.addEventListener("volumechange", function () {
volumeBar.value = mediaPlayer.volume;
if (mediaPlayer.muted || mediaPlayer.volume === 0) {
volumeBtn.textContent = "🔇";
} else {
volumeBtn.textContent = "🔊";
}
});
// Function to add subtitles dynamically (e.g., after URL input)
function addSubtitles(url) {
// Remove any existing subtitle tracks
const existingTracks = mediaPlayer.getElementsByTagName('track');
for (let track of existingTracks) {
track.remove();
}
// Create a new track for subtitles
const track = document.createElement('track');
track.kind = 'subtitles';
track.label = 'Español';
track.srclang = 'es';
track.src = url;
// Append the new track
mediaPlayer.appendChild(track);
// Optionally, enable subtitles by default
track.track.mode = 'showing'; // Enable subtitles by default
}
// Handle submit subtitle URL
function clearSubtitles() {
const tracks = mediaPlayer.getElementsByTagName('track');
for (let i = tracks.length - 1; i >= 0; i--) {
tracks[i].remove();
}
}
// Use this function when a new video is loaded
submitSubtitlesBtn.addEventListener('click', () => {
const subtitleUrl = subtitlesInput.value;
if (subtitleUrl) {
addSubtitles(subtitleUrl);
subtitlesOverlay.style.display = 'none';
subtitlesInput.value = '';
}
});
let autoplayEnabled = true;
let loopEnabled = false;
// Handle submit URL button in custom dialog
submitUrlBtn.addEventListener('click', async () => {
let url = urlInput.value;
// Check if URL is a valid URL and doesn't contain "http" or "https"
if (url && !url.startsWith('http') && !url.startsWith('https')) {
// Assuming it's a URL and needs the protocol added
url = 'http://' + url; // You can also choose 'https://' if preferred
}
const { isHLS, isDASH } = await detectStreamType(url);
if (url) {
clearSubtitles();
if (hls !== null) {
hls.destroy()
hls = null
window.hls = hls
}
if (player !== null) {
player.reset()
player = null
window.dash = player
}
if (url.toLowerCase().endsWith('.m3u8') || url.toLowerCase().endsWith('.m3u') || isHLS) {
// HLS stream
if (Hls.isSupported()) {
mediaPlayer.style.display = 'flex'; // Hide the native video player
hls = new Hls();
window.hls = hls
mediaPlayer.pause();
hls.loadSource(url);
hls.attachMedia(mediaPlayer);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
if (autoplayCheckbox.checked) {
mediaPlayer.play();
}
urlInput.value = "";
customControls.style.display = 'flex';
});
window.hls = hls
} else {
alert("Your device doesn't support HLS.");
customControls.style.display = 'flex';
urlInput.value = "";
}
} else if (url.toLowerCase().endsWith('.mpd') || isDASH) {
mediaPlayer.style.display = 'flex'; // Hide the native video player
mediaPlayer.pause();
player = dashjs.MediaPlayer().create();
window.dash = player
// MPEG-DASH stream
player.initialize(mediaPlayer, url, true);
customControls.style.display = 'flex';
urlInput.value = "";
if (autoplayCheckbox.checked) {
mediaPlayer.play();
}
window.dash = player
} else {
mediaPlayer.style.display = 'flex'; // Hide the native video player
mediaPlayer.pause();
mediaPlayer.src = url;
customControls.style.display = 'flex';
urlInput.value = "";
if (autoplayCheckbox.checked) {
mediaPlayer.play();
}
}
urlDialogOverlay.style.display = 'none';
dialogOverlay.style.display = 'none';
}
});
// Handle CC button to show subtitle modal
ccBtn.addEventListener('click', () => {
subtitlesOverlay.style.display = 'block';
});
// Handle cancel subtitle modal
cancelSubtitlesBtn.addEventListener('click', () => {
subtitlesOverlay.style.display = 'none';
});
// Show the dialog on page load
window.onload = function () {
dialogOverlay.style.display = 'block';
};
// Handle "Choose a File" button
chooseFileBtn.addEventListener('click', () => {
fileInput.click();
});
mediaPlayer.addEventListener("volumechange", function () {
if (mediaPlayer.muted) {
volumeBtn.textContent = "🔇"
} else if (mediaPlayer.volume === 0) {
volumeBtn.textContent = "🔊"
}
});
let previousObjectURL = null; // Store the last Object URL
fileInput.addEventListener('change', (event) => {
if (hls !== null) {
hls.destroy()
hls = null
window.hls = hls
}
if (player !== null) {
player.reset()
player = null
window.dash = player
}
const file = event.target.files[0];
if (!file) return;
clearSubtitles(); // Remove any previously loaded subtitles
// Revoke the previous Object URL if it exists
if (previousObjectURL) {
URL.revokeObjectURL(previousObjectURL);
}
// Create a new Object URL for the selected file
const fileURL = URL.createObjectURL(file);
mediaPlayer.src = fileURL;
mediaPlayer.load();
if (autoplayCheckbox.checked) {
mediaPlayer.play();
}
// Store the new Object URL for future cleanup
previousObjectURL = fileURL;
// Hide dialog after selecting a file
dialogOverlay.style.display = 'none';
});
// Handle "Enter a URL" button
enterUrlBtn.addEventListener('click', () => {
urlDialogOverlay.style.display = 'block';
});
// Handle cancel button in URL dialog
cancelUrlBtn.addEventListener('click', () => {
urlDialogOverlay.style.display = 'none';
});
// Handle custom play/pause button
playPauseBtn.addEventListener('click', () => {
if (mediaPlayer.paused) {
mediaPlayer.play();
playPauseBtn.textContent = 'Pausa';
} else {
mediaPlayer.pause();
playPauseBtn.textContent = 'Jugar';
}
});
// Sync button with the video player when it is paused manually
mediaPlayer.addEventListener('pause', () => {
playPauseBtn.textContent = 'Jugar';
});
// Sync button with the video player when it is played
mediaPlayer.addEventListener('play', () => {
playPauseBtn.textContent = 'Pausa';
});
// Volume button toggling mute/unmute
volumeBtn.addEventListener('click', () => {
if (mediaPlayer.muted || mediaPlayer.volume == 0) {
mediaPlayer.muted = false;
volumeBtn.textContent = '🔊'; // Unmute icon
} else {
mediaPlayer.muted = true;
volumeBtn.textContent = '🔇'; // Mute icon
}
});
// Handle URL input on Enter key
urlInput.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
submitUrlBtn.click();
}
});
// Handle Subtitles input on Enter key
subtitlesInput.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
submitSubtitlesBtn.click();
}
});
// Handle URL submission
// Update seek bar and time display
mediaPlayer.addEventListener('timeupdate', () => {
seekBar.max = mediaPlayer.duration || 0;
seekBar.value = mediaPlayer.currentTime;
const current = formatTime(mediaPlayer.currentTime);
const total = formatTime(mediaPlayer.duration);
timeDisplay.textContent = `${current} / ${total}`;
});
// Seek media
seekBar.addEventListener('input', () => {
mediaPlayer.currentTime = seekBar.value;
});
// Handle volume
volumeBar.addEventListener('input', () => {
mediaPlayer.volume = volumeBar.value;
if (volumeBar.value == 0 || mediaPlayer.volume == 0) {
volumeBtn.textContent = "🔇";
} else {
volumeBtn.textContent = "🔊";
}
});
// Show settings panel
settingsBtn.addEventListener('click', () => {
settingsDialogOverlay.style.display = 'block';
settingsPanel.style.display = 'block';
});
saveSettingsBtn.addEventListener('click', () => {
autoplayEnabled = autoplayCheckbox.checked;
loopEnabled = loopCheckbox.checked;
mediaPlayer.autoplay = autoplayEnabled;
mediaPlayer.loop = loopEnabled;
const controlsEnabled = document.getElementById('controlsCheckbox').checked;
const colorsEnabled = document.getElementById('colorsCheckbox').checked;
mediaPlayer.controls = controlsEnabled;
if (colorsEnabled) {
mediaPlayer.style.filter = "contrast(1.1) saturate(1.15) brightness(1.03)";
} else {
mediaPlayer.style.filter = "";
}
settingsPanel.style.display = 'none';
settingsDialogOverlay.style.display = 'none';
});
// End of first event listener for DOM content loaded
// Format time
function formatTime(time) {
const minutes = Math.floor(time / 60) || 0;
const seconds = Math.floor(time % 60) || 0;
return `${minutes}:${seconds.toString().padStart(2, '0')}`;
}
const showDialogBtn = document.getElementById('showDialogBtn');
const hideDialogBtn = document.getElementById('hideDialogBtn');
const fullscreenBtn = document.getElementById('fullscreenBtn');
// Show dialog
showDialogBtn.addEventListener('click', () => {
dialogOverlay.style.display = 'block';
});
// Hide dialog
hideDialogBtn.addEventListener('click', () => {
dialogOverlay.style.display = 'none';
});
// Fullscreen functionality
fullscreenBtn.addEventListener('click', () => {
if (!document.fullscreenElement) {
mediaPlayer.requestFullscreen();
} else {
document.exitFullscreen();
}
});
// End of code and second event listener for DOM content loaded
});

View File

@ -65,36 +65,83 @@ document.addEventListener('DOMContentLoaded', () => {
} }
}); });
// Function to add subtitles dynamically (e.g., after URL input) async function addSubtitles(url) {
function addSubtitles(url) { // Remove existing tracks and revoke any previous blob URLs
// Remove any existing subtitle tracks
const existingTracks = mediaPlayer.getElementsByTagName('track'); const existingTracks = mediaPlayer.getElementsByTagName('track');
for (let track of existingTracks) { for (let i = existingTracks.length - 1; i >= 0; i--) {
const track = existingTracks[i];
if (track.src.startsWith('blob:')) URL.revokeObjectURL(track.src);
track.remove(); track.remove();
} }
// Create a new track for subtitles // Fetch subtitle content
let text = '';
try {
const res = await fetch(url);
text = await res.text();
} catch (err) {
console.error('Failed to fetch subtitles:', err);
return;
}
// Detect format
const firstLine = text.split(/\r?\n/)[0].trim();
const format = firstLine.startsWith('WEBVTT') || url.toLowerCase().endsWith('.vtt') ? 'vtt' : 'srt';
// Determine track source
let trackSrc = url;
if (format === 'srt') {
// Convert SRT → VTT
text = 'WEBVTT\n\n' + text
.replace(/\r+/g, '')
.replace(/^\s+|\s+$/g, '')
.split('\n')
.map(line => line.replace(/(\d+):(\d+):(\d+),(\d+)/g, '$1:$2:$3.$4'))
.join('\n');
// Create Blob URL for converted subtitles
const blob = new Blob([text], { type: 'text/vtt' });
trackSrc = URL.createObjectURL(blob);
}
// Create and append track
const track = document.createElement('track'); const track = document.createElement('track');
track.kind = 'subtitles'; track.kind = 'subtitles';
track.label = 'English'; track.label = 'English';
track.srclang = 'en'; track.srclang = 'en';
track.src = url; track.src = trackSrc;
track.default = true;
// Append the new track
mediaPlayer.appendChild(track); mediaPlayer.appendChild(track);
// Optionally, enable subtitles by default // Force enable immediately
track.track.mode = 'showing'; // Enable subtitles by default setTimeout(() => {
for (let t of mediaPlayer.textTracks) t.mode = 'disabled';
track.track.mode = 'showing';
}, 50);
} }
// Handle submit subtitle URL
/*// Handle submit subtitle URL
function clearSubtitles() { function clearSubtitles() {
const tracks = mediaPlayer.getElementsByTagName('track'); const tracks = mediaPlayer.getElementsByTagName('track');
for (let i = tracks.length - 1; i >= 0; i--) { for (let i = tracks.length - 1; i >= 0; i--) {
tracks[i].remove(); tracks[i].remove();
} }
}*/
function clearSubtitles() {
const tracks = mediaPlayer.getElementsByTagName('track');
for (let i = tracks.length - 1; i >= 0; i--) {
const track = tracks[i];
if (track.src.startsWith('blob:')) {
URL.revokeObjectURL(track.src); // free memory leaks from SRT to VTT converted subtitles
}
track.remove();
}
} }
// Use this function when a new video is loaded // Use this function when a new video is loaded
submitSubtitlesBtn.addEventListener('click', () => { submitSubtitlesBtn.addEventListener('click', () => {
@ -225,6 +272,7 @@ const { isHLS, isDASH } = await detectStreamType(url);
let previousObjectURL = null; // Store the last Object URL let previousObjectURL = null; // Store the last Object URL
window.objectURL = previousObjectURL
fileInput.addEventListener('change', (event) => { fileInput.addEventListener('change', (event) => {
if (hls !== null) { if (hls !== null) {
@ -245,7 +293,13 @@ const { isHLS, isDASH } = await detectStreamType(url);
// Revoke the previous Object URL if it exists // Revoke the previous Object URL if it exists
if (previousObjectURL) { if (previousObjectURL) {
URL.revokeObjectURL(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 // Create a new Object URL for the selected file
const fileURL = URL.createObjectURL(file); const fileURL = URL.createObjectURL(file);
@ -257,6 +311,7 @@ const { isHLS, isDASH } = await detectStreamType(url);
// Store the new Object URL for future cleanup // Store the new Object URL for future cleanup
previousObjectURL = fileURL; previousObjectURL = fileURL;
fileInput.value = "";
// Hide dialog after selecting a file // Hide dialog after selecting a file
dialogOverlay.style.display = 'none'; dialogOverlay.style.display = 'none';

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 // Handle submit subtitle URL
function clearSubtitles() { function clearSubtitles() {
const tracks = mediaElement.getElementsByTagName('track'); const tracks = mediaElement.getElementsByTagName('track');
@ -97,3 +194,7 @@ window.electron.receive("unload-addon", (fileURL) => {
unloadAddon(fileURL); unloadAddon(fileURL);
}); });