ciyidogan commited on
Commit
e6b7d56
·
verified ·
1 Parent(s): 58a6f07

Update flare-ui/src/app/services/conversation-manager.service.ts

Browse files
flare-ui/src/app/services/conversation-manager.service.ts CHANGED
@@ -331,11 +331,24 @@ export class ConversationManagerService implements OnDestroy {
331
 
332
  private async playAudio(audioUrl: string): Promise<void> {
333
  try {
334
- if (!this.audioPlayer) {
335
- this.audioPlayer = new Audio();
336
- this.setupAudioPlayerHandlers();
 
 
 
 
 
 
 
 
 
337
  }
338
 
 
 
 
 
339
  this.audioPlayer.src = audioUrl;
340
 
341
  // Store the play promise to handle interruptions properly
 
331
 
332
  private async playAudio(audioUrl: string): Promise<void> {
333
  try {
334
+ console.log('🎵 [ConversationManager] playAudio called', {
335
+ hasAudioPlayer: !!this.audioPlayer,
336
+ audioUrl: audioUrl,
337
+ timestamp: new Date().toISOString()
338
+ });
339
+
340
+ // Her seferinde yeni audio player oluştur ve handler'ları set et
341
+ if (this.audioPlayer) {
342
+ // Eski player'ı temizle
343
+ this.audioPlayer.pause();
344
+ this.audioPlayer.src = '';
345
+ this.audioPlayer = null;
346
  }
347
 
348
+ // Yeni player oluştur
349
+ this.audioPlayer = new Audio();
350
+ this.setupAudioPlayerHandlers(); // HER SEFERINDE handler'ları set et
351
+
352
  this.audioPlayer.src = audioUrl;
353
 
354
  // Store the play promise to handle interruptions properly