@@ -25,6 +25,8 @@ public class RemoteAudioSource: AudioStreamSource {
2525 }
2626
2727 private let url : URL
28+ private let httpMethod : String ?
29+ private let httpBody : Data ?
2830 private let networkingClient : NetworkingClient
2931 private var streamRequest : NetworkDataStream ?
3032
@@ -61,12 +63,16 @@ public class RemoteAudioSource: AudioStreamSource {
6163 netStatusProvider: NetStatusProvider ,
6264 retrier: Retrier ,
6365 url: URL ,
66+ httpMethod: String ? ,
67+ httpBody: Data ? ,
6468 underlyingQueue: DispatchQueue ,
6569 httpHeaders: [ String : String ] )
6670 {
6771 networkingClient = networking
6872 metadataStreamProcessor = metadataStreamSource
6973 self . url = url
74+ self . httpMethod = httpMethod
75+ self . httpBody = httpBody
7076 additionalRequestHeaders = httpHeaders
7177 relativePosition = 0
7278 seekOffset = 0
@@ -83,9 +89,11 @@ public class RemoteAudioSource: AudioStreamSource {
8389 mp4Restructure = RemoteMp4Restructure ( url: url, networking: networkingClient)
8490 startNetworkService ( )
8591 }
86-
92+
8793 convenience init ( networking: NetworkingClient ,
8894 url: URL ,
95+ httpMethod: String ? ,
96+ httpBody: Data ? ,
8997 underlyingQueue: DispatchQueue ,
9098 httpHeaders: [ String : String ] )
9199 {
@@ -100,6 +108,21 @@ public class RemoteAudioSource: AudioStreamSource {
100108 netStatusProvider: netStatusProvider,
101109 retrier: retrierTimeout,
102110 url: url,
111+ httpMethod: httpMethod,
112+ httpBody: httpBody,
113+ underlyingQueue: underlyingQueue,
114+ httpHeaders: httpHeaders)
115+ }
116+
117+ convenience init ( networking: NetworkingClient ,
118+ url: URL ,
119+ underlyingQueue: DispatchQueue ,
120+ httpHeaders: [ String : String ] )
121+ {
122+ self . init ( networking: networking,
123+ url: url,
124+ httpMethod: nil ,
125+ httpBody: nil ,
103126 underlyingQueue: underlyingQueue,
104127 httpHeaders: httpHeaders)
105128 }
@@ -347,6 +370,8 @@ public class RemoteAudioSource: AudioStreamSource {
347370 urlRequest. networkServiceType = . avStreaming
348371 urlRequest. cachePolicy = . reloadIgnoringLocalCacheData
349372 urlRequest. timeoutInterval = 60
373+ urlRequest. httpMethod = httpMethod
374+ urlRequest. httpBody = httpBody
350375
351376 for header in additionalRequestHeaders {
352377 urlRequest. addValue ( header. value, forHTTPHeaderField: header. key)
@@ -366,6 +391,8 @@ public class RemoteAudioSource: AudioStreamSource {
366391 urlRequest. networkServiceType = . avStreaming
367392 urlRequest. cachePolicy = . reloadIgnoringLocalCacheData
368393 urlRequest. timeoutInterval = 60
394+ urlRequest. httpMethod = httpMethod
395+ urlRequest. httpBody = httpBody
369396
370397 for header in additionalRequestHeaders {
371398 urlRequest. addValue ( header. value, forHTTPHeaderField: header. key)
0 commit comments