Skip to content

Commit

Permalink
Support opening Winamp skin files with double click
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Dec 9, 2021
1 parent 588b9af commit 83b5ebd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/programs.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,16 @@ function openWinamp(file_path) {
winamp_interface.focus();

if (file_path) {
const track = await filePathToTrack(file_path);
webamp.setTracksToPlay([track]);
if (file_path.match(/(\.wsz|\.zip)$/i)) {
const blob = await filePathToBlob(file_path);
const url = URL.createObjectURL(blob);
webamp.setSkinFromUrl(url);
} else if (file_path.match(/(\.m3u|\.pls)$/i)) {
alert("Sorry, we don't support playlists yet.");
} else {
const track = await filePathToTrack(file_path);
webamp.setTracksToPlay([track]);
}
}

winamp_loading = false;
Expand Down

0 comments on commit 83b5ebd

Please sign in to comment.