File size: 2,145 Bytes
a3e4b35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Video Dubbing App</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <style>
      .container {
        margin-top: 50px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <h1 class="text-center">Video Dubbing App</h1>
      <form action="{{ url_for('dub') }}" method="post">
        <div class="form-group">
          <label for="source">Select Video Source:</label>
          <select class="form-control" id="source" name="source" required>
            <option value="">--- Select ---</option>
            <option value="url">URL</option>
            <option value="file">File</option>
          </select>
        </div>
        <div class="form-group" id="url-group" style="display: none;">
          <label for="url">Enter Video URL:</label>
          <input type="text" class="form-control" id="url" name="url" placeholder="Enter Video URL">
        </div>
        <div class="form-group" id="file-group" style="display: none;">
          <label for="file">Upload Video File:</label>
          <input type="file" class="form-control-file" id="file" name="file">
        </div>
        <button type="submit" class="btn btn-primary">Dub Video</button>
      </form>
    </div>
    <script>
      document.getElementById("source").addEventListener("change", function() {
        var source = this.value;
        if (source === "url") {
          document.getElementById("url-group").style.display = "block";
          document.getElementById("file-group").style.display = "none";
        } else if (source === "file") {
          document.getElementById("url-group").style.display = "none";
          document.getElementById("file-group").style.display = "block";
        } else {
          document.getElementById("url-group").style.display = "none";
          document.getElementById("file-group").style.display = "none";
        }
      });
    </script>
  </body>
</html>