P
P
Petr Ponomarev2019-03-20 21:29:55
go
Petr Ponomarev, 2019-03-20 21:29:55

Golang streaming server + howlerjs not working?

Plz tell me i'm stuck. There is an audio file, and th application. The request for the go service throws howlerjs. The essence of the problem is that the current implementation does not work correctly, the service returns the entire file, but you need something like a stream and for this howlerjs to understand this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Petr Ponomarev, 2019-03-21
@Petrdis

I decided that I just needed to write the necessary headers
w.Header().Set("Connection", "keep-alive")
w.Header().Set("Accept-Ranges","bytes")
w.Header(). Set("Content-Type", "audio/mpeg")
w.Header().Set("Content-Length", strconv.Itoa(len(fi)))
w.Header().Set("Content-Range ", "bytes 0-33937193/33937194")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question