2
 @IBAction func buttonPlay(_ sender: Any) {

        guard let path = Bundle.main.path(forResource: "NORWAY", ofType: "m4v") else {
            debugPrint("video.m4v not found")
            print("video playing")
            return
        }

        let player = AVPlayer(url: URL(fileURLWithPath: path))
        let controller = AVPlayerViewController()
        controller.player = player
        present(controller, animated: true) {
            player.play()
            player.volume = 0
            
        }
        
    }

I want a video to be played in a loop where the user cannot forward or rewind the video.

I want a video wallpaper but not a video player.

video bar

videoBar

Community
  • 1
  • 1
Amith156
  • 53
  • 6

1 Answers1

-1

You just have to hide your playback controls: controller.showsPlaybackControls = false

radujlima
  • 12
  • 3
  • thank you so much, I also would like to know how to add text on the video and place it in center? – Amith156 Feb 09 '19 at 19:29
  • @Amith just create an UILabel and add as subview of your AVPlayerController view. Example: `controller.view.addSubview(label)` and set the constraints to center your label. – radujlima Feb 11 '19 at 15:30