iphone - iOS stream song from url with http header -
i have server has songs on it. stream server iphone , realize can avplayer
, initwithurl
. however, catch url requires authentication header. there way send http header song stream it?
if not, know of workarounds?
thanks.
do danh said - use nsmutableurlrequest pass auth data, , nsurlconnection write audio data file. can check how data you've downloaded in didreceivedata:. once file "big enough" (you'll have decide means), can play using avaudioplayer's initwithcontentsofurl (pass file url there). i've got app on store using technique , works fine. 1 piece of advice, files cause avaudioplayer return bizarre error ([error code] == 2003334207). if that, wait until file downloads completely, play.
Comments
Post a Comment