         return pair
     }
 }
+
+import AVFoundation
+import AVKit
+private class Player {
+    var player: AVPlayer!
+    var item: AVPlayerItem!
+    init(stream: String) {
+        guard let streamUrl = URL(string: stream) else { return }
+        let asset = AVURLAsset(url: streamUrl)
+        item = AVPlayerItem(asset: asset)
+        player = AVPlayer(playerItem: item)
+    }
+
+    func play() {
+        player.play()
+    }
+
+    func pause() {
+        player.pause()
+    }
+}

    //MARK: Variables
    @IBOutlet weak var tableView: UITableView!

    var albumId: String!

    fileprivate var album: Album? {

        let height = KeyValueTableViewCell.height
        return height
    }

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        guard indexPath.section == 3, let track = track(for: indexPath.row) else { return }
        player?.pause()
        player = Player(stream: track.streamUrl)
        player?.play()
    }
}

//MARK: Private Methods
