Check out example codes for "swift play video from url". It will help you in understanding the concepts better.

Code Example 1

import AVKit
import AVFoundation

class VideoController: UIViewController

override func viewDidLoad(){
  	guard let videoURL = URL(string: "VideoURL") else {
      	return
    }
    let player = AVPlayer(url: videoURL)
    let playerViewController = AVPlayerViewController()
    playerViewController.player = player
    self.present(playerViewController, animated: true) {
      playerViewController.player?.play()
    }


}

Learn ReactJs, React Native from akashmittal.com