Changed around line 1
+ const videoUpload = document.getElementById('video-upload');
+ const videoPlayer = document.getElementById('video-player');
+ const fileInfo = document.querySelector('.file-info');
+ const uploadSection = document.getElementById('upload-section');
+ const videoSection = document.getElementById('video-section');
+ const downloadSection = document.getElementById('download-section');
+ const subtitleInput = document.getElementById('subtitle-input');
+ const addSubtitleBtn = document.getElementById('add-subtitle');
+ const downloadBtn = document.getElementById('download-btn');
+
+ let videoFile = null;
+
+ videoUpload.addEventListener('change', (e) => {
+ videoFile = e.target.files[0];
+ if (videoFile) {
+ fileInfo.textContent = `Selected file: ${videoFile.name}`;
+ videoPlayer.src = URL.createObjectURL(videoFile);
+ uploadSection.classList.add('hidden');
+ videoSection.classList.remove('hidden');
+ downloadSection.classList.remove('hidden');
+ }
+ });
+
+ addSubtitleBtn.addEventListener('click', () => {
+ const subtitles = subtitleInput.value.trim();
+ if (subtitles) {
+ // Here you would add the logic to add subtitles to the video
+ alert('Subtitles added successfully!');
+ } else {
+ alert('Please enter some subtitles.');
+ }
+ });
+
+ downloadBtn.addEventListener('click', () => {
+ if (videoFile) {
+ // Here you would add the logic to download the subtitled video
+ alert('Your video with subtitles is ready for download!');
+ } else {
+ alert('Please upload a video first.');
+ }
+ });