Q:

Playing Audio with playback slider in tableView Cell

How can i play audio with playback slider with play and pause function inside of a tableView cell? 
kinda having so much hard time to do it.  Can anyone help me in this problem? 
like this one
so i've come up with a solution with the help of @JacobCavin
and come up with this code but still getting nil error report.  dont know why. 
var playerItem:AVPlayerItem? 
var player:AVPlayer? 
var slider: UISlider? 

override func viewDidLoad() {
    super.viewDidLoad()

   startPlayer()
}

func startPlayer() {

    let url = URL(string: "https://s3.amazonaws.com/kargopolov/kukushka.mp3")
    let playerItem:AVPlayerItem = AVPlayerItem(url: url!) 
    player = AVPlayer(playerItem: playerItem)

    slider!.minimumValue = 0

    let duration : CMTime = playerItem.asset.duration
    let seconds : Float64 = CMTimeGetSeconds(duration)

    slider!.maximumValue = Float(seconds)
    slider!.isContinuous = false

    slider?.addTarget(self, action: #selector(cChatViewController.sliderChanged(sender:)), for: .valueChanged)

    player!.addPeriodicTimeObserver(forInterval: CMTimeMakeWithSeconds(1, 1), queue: DispatchQueue.main) { (CMTime) -> Void in
        if self.player!.currentItem?.status == .readyToPlay {
            let time : Float64 = CMTimeGetSeconds(self.player!.currentTime());
            self.slider!.value = Float ( time );
        }

    }

}

//MARK: Private Functions

// Create function for your button
@objc func playPauseTapped(sender: UIButton) {

    if player?.rate == 0
    {
        player!.play()
        //playButton!.setImage(UIImage(named: "player_control_pause_50px.png"), forState: UIControlState. Normal)
        //            playButton!.setTitle("Pause", for: UIControlState.normal)
    } else {
        player!.pause()
        //playButton!.setImage(UIImage(named: "player_control_play_50px.png"), forState: UIControlState. Normal)
        //            playButton!.setTitle("Play", for: UIControlState.normal)
    }
}

func sliderChanged(sender: UISlider) {

    let seconds : Int64 = Int64(sender.value)
    let targetTime:CMTime = CMTimeMake(seconds, 1)

    player!.seek(to: targetTime)

    if player!.rate == 0
    {
        player?.play()
    }
}

}

extension PopOverViewController: UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 1
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as!  MessagesTableViewCell

        cell.outgoingPlayPauseButton.addTarget(self, action: #selector(playPauseTapped(sender:)), for: .touchUpInside)
        cell.outgoingAudioSlider.addTarget(self, action: #selector(sliderChanged(sender:)), for: .valueChanged)

        return cell
    }

}

extension PopOverViewController: UITableViewDelegate {

}

A:

So i found out the solution for my question and here it is :) thank you so much for the help gals. 
here is the full code of my problem
for the view controller..
import UIKit
import AVFoundation

class PopOverViewController: UIViewController {

    var playerItem:AVPlayerItem? 
    var player:AVPlayer? 
    var slider: UISlider? 

    override func viewDidLoad() {
        super.viewDidLoad()

       startPlayer()
    }

    func startPlayer() {

        let url = URL(string: "https://s3.amazonaws.com/kargopolov/kukushka.mp3")
        let playerItem:AVPlayerItem = AVPlayerItem(url: url!) 
        player = AVPlayer(playerItem: playerItem)

    }

    //MARK: Private Functions

    // Create function for your button
    @objc func playPauseTapped(sender: UIButton) {

        if player?.rate == 0
        {
            player!.play()
            //playButton!.setImage(UIImage(named: "player_control_pause_50px.png"), forState: UIControlState. Normal)
            //            playButton!.setTitle("Pause", for: UIControlState.normal)
        } else {
            player!.pause()
            //playButton!.setImage(UIImage(named: "player_control_play_50px.png"), forState: UIControlState. Normal)
            //            playButton!.setTitle("Play", for: UIControlState.normal)
        }
    }

    func sliderChanged(sender: UISlider) {

        let seconds : Int64 = Int64(sender.value)
        let targetTime:CMTime = CMTimeMake(seconds, 1)

        player!.seek(to: targetTime)

        player!.addPeriodicTimeObserver(forInterval: CMTimeMakeWithSeconds(1, 1), queue: DispatchQueue.main) { (CMTime) -> Void in
            if self.player!.currentItem?.status == .readyToPlay {
                let time : Float64 = CMTimeGetSeconds(self.player!.currentTime());
                sender.value = Float ( time );
            }
        }
        if player?.rate == 0 {
            player?.play()
        }
    }

}
extension PopOverViewController: UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 1
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as!  MessagesTableViewCell

        let url = URL(string: "https://s3.amazonaws.com/kargopolov/kukushka.mp3")
        let playerItem:AVPlayerItem = AVPlayerItem(url: url!) 
        player = AVPlayer(playerItem: playerItem)

        cell.outgoingAudioSlider.minimumValue = 0
        cell.ingoingAudioSlider.minimumValue = 0

        let duration : CMTime = playerItem.asset.duration
        let seconds : Float64 = CMTimeGetSeconds(duration)

        cell.outgoingAudioSlider.maximumValue = Float(seconds)
        cell.outgoingAudioSlider.isContinuous = false

        cell.outgoingAudioSlider.addTarget(self, action: #selector(cChatViewController.sliderChanged(sender:)), for: .valueChanged)

        cell.outgoingPlayPauseButton.addTarget(self, action: #selector(playPauseTapped(sender:)), for: .touchUpInside)

        cell.outgoingPlayPauseButton.addTarget(self, action: #selector(playPauseTapped(sender:)), for: .touchUpInside)
        cell.outgoingAudioSlider.addTarget(self, action: #selector(sliderChanged(sender:)), for: .valueChanged)

        return cell
    }

}

extension PopOverViewController: UITableViewDelegate {

}

and for the Table View Cell:
import UIKit

class MessagesTableViewCell: UITableViewCell {

    @IBOutlet weak var outgoingAudioContainer: UIView! 
    @IBOutlet weak var outgoingPlayPauseButton: UIButton! 
    @IBOutlet weak var outgoingAudioSlider: UISlider! 

}

