I changed muteButton method in the sample to the following.
@IBAction func didTapMuteButton(_ sender:AnyObject?) {
let url = URL(string: “https://postman-echo.com/get?foo1=bar1&foo2=bar2”);
var request = URLRequest(url: url!)
request.httpMethod = “GET”
let configuration = URLSessionConfiguration.ephemeral
let session = URLSession(configuration: configuration, delegate: nil, delegateQueue: OperationQueue.main)
let task = session.dataTask(with: request, completionHandler: { [weak self] (data: Data?, response: URLResponse?, error: Error?) -> Void in
if let data = data {
print(“data = (data)” );
let str = String(data: data, encoding: String.Encoding.utf8) ?? “Data could not be printed”
print(str)
}
print(“data = (data)” );
print(“error = (error)” );
// Parse the data in the response and use it
})
task.resume()
//self.player.muted = !self.player.muted
//let muteButtonImage = UIImage.init(named: self.player.muted ? “volume_mute” :“volume_unmute”)
//self.muteButton.setImage(muteButtonImage, for: UIControlState.normal)
//self.volumeSlider.isEnabled = !self.player.muted
}