AI Video Generator Tool

कहानी से AI वीडियो जनरेट करें

body { font-family: Arial, sans-serif; background-color: #f4f4f9; margin: 0; padding: 0; } .container { width: 80%; margin: 50px auto; text-align: center; background-color: #ffffff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } textarea { width: 100%; padding: 10px; margin: 20px 0; font-size: 16px; border-radius: 5px; border: 1px solid #ccc; } button { padding: 10px 20px; font-size: 16px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #45a049; } #loading { font-size: 18px; color: #333; } #videoOutput { margin-top: 20px; } document.getElementById("generateButton").addEventListener("click", function() { const storyText = document.getElementById("storyInput").value; if (!storyText) { alert("कृपया कहानी लिखें!"); return; } // दिखाएं कि वीडियो बन रहा है document.getElementById("loading").style.display = "block"; document.getElementById("videoOutput").style.display = "none"; // AI API कॉल करने के लिए फंक्शन (उदाहरण के लिए, एक काल्पनिक AI सेवा) generateVideoFromStory(storyText); }); function generateVideoFromStory(storyText) { // यहां हम AI API का कॉल करेंगे, उदाहरण स्वरूप // एक काल्पनिक API का उपयोग कर रहे हैं const apiUrl = "https://api.example.com/generate-video"; // यह वास्तविक API URL से बदलें const apiKey = "YOUR_API_KEY"; // API कुंजी बदलें // API कॉल के लिए डेटा तैयार करें const requestData = { story: storyText }; // Fetch API का उपयोग कर AI से वीडियो प्राप्त करें fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${apiKey}` }, body: JSON.stringify(requestData) }) .then(response => response.json()) .then(data => { document.getElementById("loading").style.display = "none"; if (data.success && data.videoUrl) { // वीडियो URL को सेट करें document.getElementById("generatedVideo").src = data.videoUrl; document.getElementById("videoOutput").style.display = "block"; } else { alert("वीडियो जनरेट करने में कुछ समस्या आई। कृपया फिर से प्रयास करें!"); } }) .catch(error => { console.error("Error generating video:", error); alert("कुछ गड़बड़ हो गई है। कृपया बाद में प्रयास करें!"); }); }

Comments

Popular posts from this blog