Skip to content

Commit

Permalink
audio component seeking
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Oct 27, 2024
1 parent bad18db commit c263401
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 13 deletions.
9 changes: 8 additions & 1 deletion application/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ div.nickname {
}

.audio-player .audio-info {
padding: 20px;
padding: 10px;
background: white;
color: black;
width: fit-content;
Expand Down Expand Up @@ -898,4 +898,11 @@ video {
margin: 10px 0 0 0;
padding: 10px 10px 40px 10px;
}

.audio-player .audio-info {
padding: 10px;
background: white;
color: black;
width: fit-content;
}
}
27 changes: 22 additions & 5 deletions application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,14 @@ const AudioPlayerView = {
.addEventListener("click", function (event) {
AudioPlayerView.togglePlayPause();
});

document.addEventListener("swiped-left", () => {
AudioPlayerView.seek("left");
});

document.addEventListener("swiped-right", () => {
AudioPlayerView.seek("right");
});
},

onremove: () => {
Expand Down Expand Up @@ -1515,11 +1523,20 @@ const AudioPlayerView = {
"background-image": `url(${current_article.cover})`,
},
}),
m("div", { class: "audio-info" }, [
`${formatTime(AudioPlayerView.currentTime)} / ${formatTime(
AudioPlayerView.audioDuration
)}`,
]),
m(
"div",
{
class: "audio-info",
style: {
background: `linear-gradient(to right, #3498db ${progressPercent}%, white ${progressPercent}%)`,
},
},
[
`${formatTime(AudioPlayerView.currentTime)} / ${formatTime(
AudioPlayerView.audioDuration
)}`,
]
),

// Progress bar container
m("div", { class: "progress-bar-container" }, [
Expand Down
2 changes: 1 addition & 1 deletion application/manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],

"b2g_features": {
"version": "1.8.65",
"version": "1.8.66",
"id": "feedolin",
"subtitle": "RSS Reader and Mastodon Reader",
"core": true,
Expand Down
2 changes: 1 addition & 1 deletion application/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ self.onsystemmessage = (evt) => {
} catch (e) {}
};
if (!userAgent.includes("KaiOS")) {
const CACHE_NAME = "pwa-cache-v0.1088";
const CACHE_NAME = "pwa-cache-v0.1092";
const FILE_LIST_URL = "/file-list.json"; // URL of the JSON file containing the array of files

self.addEventListener("install", (event) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.339e55c4.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.63982eba.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.f0337e49.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],

"b2g_features": {
"version": "1.8.65",
"version": "1.8.66",
"id": "feedolin",
"subtitle": "RSS Reader and Mastodon Reader",
"core": true,
Expand Down
2 changes: 1 addition & 1 deletion docs/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c263401

Please sign in to comment.