Update index.html
Browse files- index.html +33 -19
index.html
CHANGED
@@ -1430,30 +1430,44 @@ document.getElementById('sw-register-btn').addEventListener('click', registerSer
|
|
1430 |
updateVolumeIcon();
|
1431 |
}
|
1432 |
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1436 |
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
|
|
1440 |
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
} else if ('mozPreservesPitch' in combinedAudioSource) {
|
1449 |
-
combinedAudioSource.mozPreservesPitch = true;
|
1450 |
-
}
|
1451 |
}
|
1452 |
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
|
|
|
|
|
|
|
|
1456 |
}
|
|
|
|
|
|
|
|
|
|
|
1457 |
document.addEventListener('visibilitychange', function() {
|
1458 |
if (document.hidden) {
|
1459 |
// タブが非アクティブになったら同期チェックを停止
|
|
|
1430 |
updateVolumeIcon();
|
1431 |
}
|
1432 |
|
1433 |
+
function applyPlaybackRate() {
|
1434 |
+
if (!isAudioCombined) return;
|
1435 |
+
|
1436 |
+
const speed = parseFloat(playbackSpeedSlider.value);
|
1437 |
+
currentPlaybackRate = speed;
|
1438 |
+
video.playbackRate = speed;
|
1439 |
+
|
1440 |
+
if (combinedAudioSource) {
|
1441 |
+
// 既存のオーディオソースを停止
|
1442 |
+
combinedAudioSource.stop();
|
1443 |
|
1444 |
+
// 新しいオーディオソースを作成
|
1445 |
+
combinedAudioSource = audioContext.createBufferSource();
|
1446 |
+
combinedAudioSource.buffer = combinedAudioBuffer;
|
1447 |
+
combinedAudioSource.connect(audioContext.destination);
|
1448 |
|
1449 |
+
// ピッチ維持設定を一度だけ行う
|
1450 |
+
if ('preservesPitch' in combinedAudioSource) {
|
1451 |
+
combinedAudioSource.preservesPitch = true;
|
1452 |
+
} else if ('webkitPreservesPitch' in combinedAudioSource) {
|
1453 |
+
combinedAudioSource.webkitPreservesPitch = true;
|
1454 |
+
} else if ('mozPreservesPitch' in combinedAudioSource) {
|
1455 |
+
combinedAudioSource.mozPreservesPitch = true;
|
|
|
|
|
|
|
1456 |
}
|
1457 |
|
1458 |
+
// 再生速度を設定
|
1459 |
+
combinedAudioSource.playbackRate.value = speed;
|
1460 |
+
|
1461 |
+
// 再生中なら新しいソースで再生を続ける
|
1462 |
+
if (isPlaying) {
|
1463 |
+
combinedAudioSource.start(0, video.currentTime);
|
1464 |
+
}
|
1465 |
}
|
1466 |
+
|
1467 |
+
speedValue.textContent = speed.toFixed(2) + 'x';
|
1468 |
+
playbackSpeedValue.textContent = speed.toFixed(2) + 'x';
|
1469 |
+
speedSlider.value = speed;
|
1470 |
+
}
|
1471 |
document.addEventListener('visibilitychange', function() {
|
1472 |
if (document.hidden) {
|
1473 |
// タブが非アクティブになったら同期チェックを停止
|