Nikita Makarov commited on
Commit
0e191ed
·
1 Parent(s): e035536

Improve podcast iframe detection logic

Browse files
Files changed (1) hide show
  1. src/app.py +3 -1
src/app.py CHANGED
@@ -820,7 +820,9 @@ def play_next_segment():
820
  timer_config = gr.Timer(value=0, active=False)
821
 
822
  # Only delay player if we have both host audio and a music/podcast player
823
- if host_audio_file and os.path.exists(host_audio_file) and music_player_html and ("<iframe" in music_player_html):
 
 
824
  try:
825
  audio = AudioSegment.from_file(host_audio_file)
826
  host_duration_s = len(audio) / 1000.0
 
820
  timer_config = gr.Timer(value=0, active=False)
821
 
822
  # Only delay player if we have both host audio and a music/podcast player
823
+ # Check if music_player_html contains iframe (for YouTube/SoundCloud players)
824
+ has_iframe = music_player_html and ("<iframe" in music_player_html)
825
+ if host_audio_file and os.path.exists(host_audio_file) and music_player_html and has_iframe:
826
  try:
827
  audio = AudioSegment.from_file(host_audio_file)
828
  host_duration_s = len(audio) / 1000.0