Questions tagged [avplayerviewcontroller]

Using AVPlayerViewController makes it easy for you to add media playback capabilities to your application matching the styling and features of the native system players. Since AVPlayerViewController is a system framework class, your playback applications automatically adopt the new aesthetics and features of future operating system updates without any additional work from you.

SDKs

  • iOS 8.0+
  • tvOS 9.0+

Framework

  • AVKit

To find more information :

544 questions
189
votes
15 answers

How to play video with AVPlayerViewController (AVKit) in Swift

How do you play a video with AV Kit Player View Controller in Swift? override func viewDidLoad() { super.viewDidLoad() let videoURLWithPath = "http://****/5.m3u8" let videoURL = NSURL(string: videoURLWithPath) …
orazz
  • 2,178
  • 2
  • 15
  • 16
168
votes
9 answers

How to play a local video with Swift?

I have a short mp4 video file that I've added to my current Xcode6 Beta project. I want to play the video in my app. After hours searching, I can't find anything remotely helpful. Is there a way to accomplish this with Swift or do you have to use…
36 By Design
  • 3,203
  • 3
  • 18
  • 18
90
votes
5 answers

No AVPlayer Delegate? How to track when song finished playing? Objective C iPhone development

I've looked around but I can't find a delegate protocol for the AVPlayer class. What gives? I'm using its subclass, AVQueuePlayer, to play an array of AVPlayerItems, each loaded from a URL. Is there any way I can call a method when a song finishes…
Tyler
  • 911
  • 1
  • 6
  • 3
37
votes
3 answers

Swift: AVPlayer playing video is showing this error: [AVOutputContext] WARNING: AVF context unavailable for sharedAudioPresentationContext

I'm trying to play a video from bundle directory but I'm getting this error: video[29054:2968406] [MediaRemote] [AVOutputContext] WARNING: AVF context unavailable for sharedAudioPresentationContex This is my implementation: import UIKit import…
user2924482
  • 8,380
  • 23
  • 89
  • 173
35
votes
6 answers

Unable to simultaneously satisfy constraints Warnings with AVPlayerViewController embedded in storyboard

I'm trying to set up an AVPlayerViewController completely through storyboards by embedding in a separate View Controller. Steps: Create Single View Application in Xcode. Embed VC in navigation Controller. Add toolbar at the bottom.(pinned to…
Ishan Handa
  • 2,271
  • 20
  • 25
18
votes
9 answers

Done button click event in AVPlayerViewController

I want to play local video in AVPlayerViewController but did not find click event of Done button. My video is able to play in AVPlayerViewController but I did not find next button , previous button and done button click event.
Yogendra Patel
  • 813
  • 2
  • 8
  • 24
17
votes
2 answers

Using an AVPlayer returns a "non-Multipath connection" error

I'm using AVKit to play a youtube URL. I have this code inside a button action: @IBAction func trailerButtonAction(_ sender: Any) { guard let youtubeUrl = youtubeURL else { return } let player = AVPlayer(url: youtubeUrl) let…
Alex Giatrakis
  • 365
  • 3
  • 16
17
votes
3 answers

SwiftUI: How to properly present AVPlayerViewController modally?

Proper UIKit Approach: According to Apple's WWDC 2019 talk on the subject, AVPlayerViewController should be presented modally to take advantage of all the latest full-screen features of the API. This is the recommended sample code to be called from…
17
votes
3 answers

AVPlayer with playback controls of avplayerviewcontroller

I am putting n avplayer inside of a view controller to customize some other elements of the view controller but I still want the playback and scrubbing controls used in AVPlayerViewController. Is there a way to enable these controls for the Avplayer…
tnek316
  • 630
  • 1
  • 5
  • 16
14
votes
1 answer

Swift 3. AVPlayerViewController issue when exit from fullscreen

I am getting an error in Console when app exits from fullscreen and screen UI slides to top. Error: -[AVPlayerViewController exitFullScreenAnimated:completionHandler:] failed with error View needs to be loaded before you can call…
14
votes
3 answers

iOS: AVPlayerViewController enable fullscreen rotation in portrait oriented application

I have a UIViewcontroller, which contains a AVPlayerViewController with AVPlayer. I want to enable rotation for AVPlayerViewController(when video is on fullscreen) and disable any rotation for UIViewController. How can I enable rotation only for…
12
votes
3 answers

AVPlayer crash when resizing window during fullscreen while hotspotting

I'm coding on an app where uses can watch a wide array of videos. I open the video in fullscreen on button tap and the user is able to use the playback controls to resize the window. The issue I'm having is that when the user is sharing his internet…
ClockWise
  • 1,509
  • 15
  • 32
11
votes
5 answers

Draw button on top of AVPlayer

I have to draw a label or button on top of video relay next previous , leave comment . List of video have it, once user select one item from the table,it need to play, Once player play finished, those buttons or label should come on top of…
Piraba
  • 6,974
  • 17
  • 85
  • 135
11
votes
3 answers

AVPlayerItemDidPlayToEndTimeNotification not firing

I am playing video from the url using AVPlayer. AVPlayerItemDidPlayToEndTimeNotification is not firing. I have put the breakpoints to check. Below is my code snippet:- @IBAction func playButtonClicked(sender: UIButton) { let url:NSURL =…
Keshav Raj
  • 199
  • 3
  • 11
11
votes
5 answers

tvOS AVPlayerViewController Video Info

In the built in apps for tvOS when you watch a video it shows information about that video when you swipe down. I can't find any information on how a developer can do this same thing. I'm sure it is designed to be possible as it says "Swipe down for…
Brian F Leighty
  • 922
  • 11
  • 22
1
2 3
36 37