title: Background video move under NavagationBar with swift
body: <p>Trying to fit the video below the NavBar. for both portrait and landscape. Is it possible?</p>
  
  <p><a href="https://i.stack.imgur.com/Me07w.png" rel="nofollow noreferrer">Background video move to under navigation</a></p>
  
  <p>Here is the following code l'm using</p>
  
  <pre><code>override func viewDidLoad()
  {
      super.viewDidLoad()
      addNavBarImage()
  
      let URL = Bundle.main.url(forResource: "homedocapp", withExtension: "mp4")
  
      Player = AVPlayer.init(url: URL!)
  
      PlayerLayer = AVPlayerLayer(player: Player)
      PlayerLayer.videoGravity = AVLayerVideoGravityResizeAspect
      PlayerLayer.frame = view.layer.bounds
  
      Player.actionAtItemEnd = AVPlayerActionAtItemEnd.none
  
  
      Player.play()
  
      view.layer.insertSublayer(PlayerLayer, at: 0)
  
      NotificationCenter.default.addObserver(self, selector: #selector(playerItemReachEnd(notification:)), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: Player.currentItem)
  </code></pre>
  
  <p>Thank you in advance</p>