Spaces:
Sleeping
Sleeping
Brunwo
commited on
Commit
·
f4ce0ef
1
Parent(s):
b5eef9f
unnecessary player changes but ok
Browse files- index.html +9 -3
- script.js +8 -2
index.html
CHANGED
|
@@ -11,10 +11,16 @@
|
|
| 11 |
</head>
|
| 12 |
<body>
|
| 13 |
<h1>web to podcast player</h1>
|
| 14 |
-
<audio id="player" controls></audio>
|
| 15 |
|
| 16 |
-
<!-- Add
|
| 17 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
<!-- Add settings button -->
|
| 20 |
<button id="settingsBtn">Settings</button>
|
|
|
|
| 11 |
</head>
|
| 12 |
<body>
|
| 13 |
<h1>web to podcast player</h1>
|
|
|
|
| 14 |
|
| 15 |
+
<!-- Add audio controls container -->
|
| 16 |
+
<div id="audioControls">
|
| 17 |
+
<audio id="player" controls></audio>
|
| 18 |
+
<div id="controlButtons">
|
| 19 |
+
<button id="skipBackward">-10s</button>
|
| 20 |
+
<button id="playButton" style="display: none;">Play</button>
|
| 21 |
+
<button id="skipForward">+10s</button>
|
| 22 |
+
</div>
|
| 23 |
+
</div>
|
| 24 |
|
| 25 |
<!-- Add settings button -->
|
| 26 |
<button id="settingsBtn">Settings</button>
|
script.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
|
| 4 |
document.addEventListener("DOMContentLoaded", function() {
|
| 5 |
const audioPlayer = document.getElementById('player');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
const settingsBtn = document.getElementById('settingsBtn');
|
| 7 |
const settingsModal = document.getElementById('settingsModal');
|
| 8 |
const closeBtn = document.querySelector('.close');
|
|
@@ -11,6 +14,7 @@ document.addEventListener("DOMContentLoaded", function() {
|
|
| 11 |
const toggleApiKeyBtn = document.getElementById('toggleApiKey');
|
| 12 |
const apiServerInput = document.getElementById('apiServer');
|
| 13 |
|
|
|
|
| 14 |
let originalApiKey = '';
|
| 15 |
let originalApiServer = '';
|
| 16 |
|
|
@@ -232,10 +236,12 @@ if ('mediaSession' in navigator) {
|
|
| 232 |
|
| 233 |
navigator.mediaSession.setActionHandler('play', function() {
|
| 234 |
audioPlayer.play();
|
|
|
|
| 235 |
});
|
| 236 |
|
| 237 |
navigator.mediaSession.setActionHandler('pause', function() {
|
| 238 |
audioPlayer.pause();
|
|
|
|
| 239 |
});
|
| 240 |
|
| 241 |
navigator.mediaSession.setActionHandler('seekbackward', function() {
|
|
|
|
| 1 |
+
import { Client } from "@gradio/client";
|
|
|
|
| 2 |
|
| 3 |
document.addEventListener("DOMContentLoaded", function() {
|
| 4 |
const audioPlayer = document.getElementById('player');
|
| 5 |
+
const playButton = document.getElementById('playButton');
|
| 6 |
+
const skipBackwardButton = document.getElementById('skipBackward');
|
| 7 |
+
const skipForwardButton = document.getElementById('skipForward');
|
| 8 |
+
|
| 9 |
const settingsBtn = document.getElementById('settingsBtn');
|
| 10 |
const settingsModal = document.getElementById('settingsModal');
|
| 11 |
const closeBtn = document.querySelector('.close');
|
|
|
|
| 14 |
const toggleApiKeyBtn = document.getElementById('toggleApiKey');
|
| 15 |
const apiServerInput = document.getElementById('apiServer');
|
| 16 |
|
| 17 |
+
|
| 18 |
let originalApiKey = '';
|
| 19 |
let originalApiServer = '';
|
| 20 |
|
|
|
|
| 236 |
|
| 237 |
navigator.mediaSession.setActionHandler('play', function() {
|
| 238 |
audioPlayer.play();
|
| 239 |
+
playButton.textContent = 'Pause';
|
| 240 |
});
|
| 241 |
|
| 242 |
navigator.mediaSession.setActionHandler('pause', function() {
|
| 243 |
audioPlayer.pause();
|
| 244 |
+
playButton.textContent = 'Play';
|
| 245 |
});
|
| 246 |
|
| 247 |
navigator.mediaSession.setActionHandler('seekbackward', function() {
|