anzorq commited on
Commit
bb9bb81
1 Parent(s): 3c77b11

Update share_btn.py

Browse files
Files changed (1) hide show
  1. share_btn.py +11 -7
share_btn.py CHANGED
@@ -29,9 +29,15 @@ share_js = """async () => {
29
  const blob = await res.blob();
30
  const videoId = Date.now() % 200;
31
  const fileName = `video-${{ videoId }}.mp4`;
32
- const file = new File([blob], fileName, { type: 'video/mp4' });
33
- console.log(file);
34
- return file;
 
 
 
 
 
 
35
  }
36
 
37
 
@@ -66,11 +72,9 @@ Feel: ${feel}
66
  Seed: ${seed}
67
 
68
  #### Video:
69
-
70
- <video controls>
71
- <source src="${dataVideoFile}" type="video/mp4">
72
  Your browser does not support the video element.
73
- </video>
74
  `;
75
 
76
  const params = new URLSearchParams({
 
29
  const blob = await res.blob();
30
  const videoId = Date.now() % 200;
31
  const fileName = `video-${{ videoId }}.mp4`;
32
+ return new File([blob], fileName, { type: 'video/mp4' });
33
+ }
34
+
35
+ async function getAudioFile(videoEl) {
36
+ const res = await fetch(videoEl.src);
37
+ const blob = await res.blob();
38
+ const videoId = Date.now() % 200;
39
+ const fileName = `audio-${{ videoId }}.wav`;
40
+ return new File([blob], fileName, { type: 'audio/wav' });
41
  }
42
 
43
 
 
72
  Seed: ${seed}
73
 
74
  #### Video:
75
+ <audio src="${dataVideoFile}" controls>
 
 
76
  Your browser does not support the video element.
77
+ </audio>
78
  `;
79
 
80
  const params = new URLSearchParams({