DGSpitzer commited on
Commit
2a2ef9d
1 Parent(s): 78fc45a

Update share_btn.py

Browse files
Files changed (1) hide show
  1. share_btn.py +14 -9
share_btn.py CHANGED
@@ -65,8 +65,9 @@ share_js = """async () => {
65
  // const gradioEl = document.querySelector("gradio-app").shadowRoot;
66
  const inputPromptEl = gradioEl.querySelector('#input-prompt input').value;
67
  const outputVideoEl = gradioEl.querySelector('#output-video video');
68
- //const outputMusic = gradioEl.querySelector('#music-out audio');
69
- //const outputMusic_src = gradioEl.querySelector('#music-out audio').src;
 
70
 
71
  let titleTxt = inputPromptEl;
72
  //if(titleTxt.length > 100){
@@ -83,14 +84,18 @@ share_js = """async () => {
83
  loadingIconEl.style.removeProperty('display');
84
  const outputVideo = await getInputVideoFile(outputVideoEl);
85
  const urlOutputVideo = await uploadFile(outputVideo);
86
- //const outputImg = await getInputImgFile(outputvideoEl);
87
- //const urlOutputImg = await uploadFile(outputImg);
88
- //const musicFile = await getOutputMusicFile(outputMusic);
89
- //const dataOutputMusic = await uploadFile(musicFile);
90
 
91
- const descriptionMd = `#### Here is my AI generated video:
92
-
93
- <video src='${urlOutputVideo}' style='max-height: 704px;'>
 
 
 
 
94
  `;
95
  const params = new URLSearchParams({
96
  title: titleTxt,
 
65
  // const gradioEl = document.querySelector("gradio-app").shadowRoot;
66
  const inputPromptEl = gradioEl.querySelector('#input-prompt input').value;
67
  const outputVideoEl = gradioEl.querySelector('#output-video video');
68
+ const outputImgEl = gradioEl.querySelector('#output-img img');
69
+ const outputMusic = gradioEl.querySelector('#output-music audio');
70
+ const outputMusic_src = gradioEl.querySelector('#output-music audio').src;
71
 
72
  let titleTxt = inputPromptEl;
73
  //if(titleTxt.length > 100){
 
84
  loadingIconEl.style.removeProperty('display');
85
  const outputVideo = await getInputVideoFile(outputVideoEl);
86
  const urlOutputVideo = await uploadFile(outputVideo);
87
+ const outputImg = await getInputImgFile(outputImgEl);
88
+ const urlOutputImg = await uploadFile(outputImg);
89
+ const musicFile = await getOutputMusicFile(outputMusic);
90
+ const dataOutputMusic = await uploadFile(musicFile);
91
 
92
+ const descriptionMd = `#### Here is my AI generated art & music:
93
+ <img src='${urlOutputImg}' style='max-height: 512px;'>
94
+
95
+ <audio controls>
96
+ <source src="${dataOutputMusic}" type="audio/wav">
97
+ Your browser does not support the audio element.
98
+ </audio>
99
  `;
100
  const params = new URLSearchParams({
101
  title: titleTxt,