2

I have built a Laravel app as follow,

Controller -> Retrieves few audio files path and sends it to view.

View -> Renders audio element with src attribute with files path obtained from controller.

I am able to play, pause. But unable to seek in chrome. Seek works fine in Firefox. I got a hint from another stackoverflow response (HTML5 video will not loop) it is because that chrome get the content as partial content. How to resolve this in chrome ?

// Controller
public function showSamples(){
    $samples = Sample::where('artist_id', '=', Auth::user()->id));      
    return View::make('artist.samples', $samples);
}

// View [artists.sample]
@foreach($samples as $sample)
    <audio src="/uploads/samples/{{ $sample->file_path }}" controls>
    </audio>
@endforeach
Community
  • 1
  • 1
Kiran
  • 41
  • 1
  • 3
  • Where is your code? do you get any error in the logs? what was the SO question that you referred to in your question?........ – Alvaro Montoro Jan 29 '15 at 16:07
  • 1
    @AlvaroMontoro edited question. There is no error. The audio player is perfectly rendered in the view. The problem is with seek bar. If I click at any place in seek bar the audio starts from beginning. – Kiran Jan 30 '15 at 18:47
  • Your server needs to support byte-range requests when serving audio/video. – idbehold Jan 30 '15 at 19:15
  • @idbehold Is there a way to manually enable/disable this support ? If yes, could you detail ? Like by editing some apache/http config files. – Kiran Jan 31 '15 at 09:07
  • were you able to solve the issue? – StealthTrails Jan 27 '18 at 01:56
  • I'm also facing the same issue with react/s3.. Audio seek works fine in firefox but not in chrome. – Shreehari Aug 26 '22 at 08:05

0 Answers0