메타 수정

This commit is contained in:
2025-07-03 18:33:33 +09:00
parent 0bcc6dab3d
commit 88389a5487
2 changed files with 11 additions and 39 deletions
+11 -35
View File
@@ -3,7 +3,14 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>레인보우 - 볼링공 속도 계산기</title>
<link rel="icon" href="/favicon.ico">
<meta name="description" content="볼링 구속 계산기 - 스톱워치, 영상으로 볼링 구속을 측정해보세요.">
<meta property="og:title" content="레인보우 - 볼링 구속 계산기">
<meta property="og:description" content="볼링 구속 계산기 - 스톱워치, 영상으로 볼링 구속을 측정해보세요.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://lanebow.com/bowlspeed">
<meta property="og:image" content="/LaneBowLogo.png">
<title>레인보우 - 볼링 구속 계산기</title>
<style>
body {
font-family: 'Nanum Gothic', Arial, sans-serif;
@@ -315,7 +322,6 @@
page_location: window.location.href
});
</script>
<script src="mp4box.all.min.js"></script>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
@@ -416,7 +422,7 @@
</div>
<footer>
<p> 2025 볼링공 속도 계산기 &copy; <a href="https://lanebow.com" target="_blank">레인보우 - 볼링클럽 매니저</a></p>
<p> 2025 볼링 구속 계산기 &copy; <a href="https://lanebow.com" target="_blank">레인보우 - 볼링클럽 매니저</a></p>
</footer>
</div>
@@ -743,37 +749,8 @@
const resetFrameBtn = document.getElementById('reset-frame-btn');
let mediaRecorder, stream = null;
let videoFile = null;
let fps = 30;
let duration = 0;
// mp4box.js를 이용한 FPS 추출 함수 (Promise 반환)
function getFPSfromMP4(file) {
return new Promise((resolve) => {
if (!file || !file.type.includes('mp4')) {
resolve(30);
return;
}
const fileReader = new FileReader();
fileReader.onload = function(e) {
const arrayBuffer = e.target.result;
// mp4box.js는 appendBuffer의 인자로 fileStart 속성이 반드시 필요함
const mp4boxFile = MP4Box.createFile();
mp4boxFile.onReady = function(info) {
let fps = 30;
try {
const videoTrack = info.tracks.find(t => t.video);
if (videoTrack && videoTrack.video && videoTrack.video.frame_rate) {
fps = videoTrack.video.frame_rate;
}
} catch (e) { fps = 30; }
resolve(fps || 30);
};
arrayBuffer.fileStart = 0;
mp4boxFile.appendBuffer(arrayBuffer, 0);
mp4boxFile.flush();
};
fileReader.readAsArrayBuffer(file);
});
}
// startTime, endTime은 오직 여기서만 선언
let startTime = null;
let endTime = null;
@@ -787,9 +764,8 @@ function getFPSfromMP4(file) {
videoFile = e.target.files[0];
videoPreview.src = URL.createObjectURL(videoFile);
videoPreview.classList.add('active');
videoPreview.onloadedmetadata = async function() {
videoPreview.onloadedmetadata = function() {
duration = videoPreview.duration;
fps = await getFPSfromMP4(videoFile);
startTime = null;
endTime = null;
};
File diff suppressed because one or more lines are too long