haepada commited on
Commit
9badaa5
·
verified ·
1 Parent(s): fea98e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -19
app.py CHANGED
@@ -623,15 +623,18 @@ def create_interface():
623
  """
624
 
625
  # HTML5 Audio Player 템플릿
626
- AUDIO_PLAYER_HTML = """
627
- <div class="audio-player-container">
628
- <audio id="mainAudio" preload="auto" style="display:none;">
629
- <source src="/assets/main_music.mp3" type="audio/mp3">
630
- </audio>
631
- <button id="playButton" onclick="toggleAudio()" class="custom-audio-button">
632
- <span id="playButtonText">재생</span>
633
- </button>
634
- </div>
 
 
 
635
  <script>
636
  let audio = document.getElementById('mainAudio');
637
  let playButton = document.getElementById('playButton');
@@ -936,16 +939,7 @@ def create_interface():
936
  온천천 온천장역에서 장전역까지 걸으며 더 깊은 체험이 가능합니다.
937
  """)
938
 
939
- play_music_btn = gr.Button("온천천의 소리 듣기", variant="secondary")
940
- with gr.Row():
941
- audio = gr.Audio(
942
- value="assets/main_music.mp3",
943
- type="filepath",
944
- label="온천천의 소리",
945
- interactive=False,
946
- show_download_button=True,
947
- visible=True
948
- )
949
 
950
  with gr.Column():
951
  reflection_input = gr.Textbox(
 
623
  """
624
 
625
  # HTML5 Audio Player 템플릿
626
+ AUDIO_PLAYER_HTML = """
627
+ <div class="audio-player-container">
628
+ <iframe width="300" height="80" src="https://www.youtube.com/embed/[음악의 비디오 ID]?autoplay=1&loop=1&playlist=[음악의 비디오 ID]"
629
+ title="YouTube music player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
630
+ allowfullscreen></iframe>
631
+ </div>
632
+ <style>
633
+ .audio-player-container {
634
+ text-align: center;
635
+ margin-top: 20px;
636
+ }
637
+ </style>
638
  <script>
639
  let audio = document.getElementById('mainAudio');
640
  let playButton = document.getElementById('playButton');
 
939
  온천천 온천장역에서 장전역까지 걸으며 더 깊은 체험이 가능합니다.
940
  """)
941
 
942
+ gr.HTML(audio_player_html)
 
 
 
 
 
 
 
 
 
943
 
944
  with gr.Column():
945
  reflection_input = gr.Textbox(