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
10
votes
8 answers

AVPlayer UITapGestureRecognizer not working

I have this code for my AVPlayerViewController. UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAvPlayer)]; [self.avPlayerViewController.view addGestureRecognizer:tap]; but this is not working..…
10
votes
1 answer

tvos AVPlayerViewController how to display subtitles tab on swipedown menu

In tvOS, in the menu that is being displayed when a user swipes down on the remote, that shows "subtitles, audio & info" on other movie apps, how to create another tab with buttons? Below is my code: AVMutableMetadataItem *titleMetadataItem =…
Jenel Ejercito Myers
  • 2,553
  • 2
  • 16
  • 24
9
votes
1 answer

Video playback issues only on iOS 13 with AVPlayerViewController and AVPlayer when using HLS video

I have an app that plays back videos. It's compatible with iOS 11, 12 and iOS 13. On iOS 11 and 12, video playback works properly as expected using either AVPlayerViewController or even just AVPlayerLayer. However, on iOS 13 I started getting…
9
votes
1 answer

How to detect the toggle on the display of playback controls with AVPlayerViewController?

I'd like to know if it is possible to detect when the playback controls appear or disappear from the AVPlayerViewController view. I'm trying to add a UI element on my player that must follow the playback controls display. Appearing only when the…
Martin
  • 843
  • 8
  • 17
9
votes
4 answers

How to detect user selection of subtitles when using AVPlayerViewController

When using the AVPlayerViewController, the user is allowed to select whether the subtitles are on a specific language, off, or set to auto. Setting the requiresFullSubtitles property I can force the display of subtitles, but that is not what I…
picciano
  • 22,341
  • 9
  • 69
  • 82
9
votes
4 answers

AVPlayerViewController stops after returning from full screen

I have an AVPlayerViewController which I initialize with an AVPlayer and some AVPlayerItem (iOS 10, Xcode 8, Objective C). The AVPlayerViewController is presented "inline" inside some subview, and everything works perfectly with the native playback…
mllm
  • 17,068
  • 15
  • 53
  • 64
9
votes
2 answers

Make AVPlayer to full screen view in AVPlayerViewController, Swift

I am new to swift and getting problem in making AVPlayerViewController.player go to full screen in ViewController: AVPlayerViewController here is code I am using in viewDidAppear to play the video let path =…
Sulman Malik
  • 135
  • 1
  • 1
  • 7
9
votes
2 answers

Remove buffering activity indicator from AVPlayerViewController

I'm implementing an iOS video player using AVPlayerViewController with custom playback controls (i.e., the showsPlaybackControls property is defined as NO). This seems to work properly in most cases, the only issue I'm seeing is that I would like to…
9
votes
1 answer

Play a video from Youtube in a AVPlayerViewController in Swift

Okay so I'm looking to play film trailers in my app. The user will press a button, and then it plays the video. I have added the import AVKit and import AVFoundation lines to my file. This is the code I have so far for making the video…
Nick89
  • 2,948
  • 10
  • 31
  • 50
9
votes
2 answers

AVPlayer not playing audio - iOS 9, Objective - C

I am trying to play audio from a URL in my app. Everything happens as expected in iOS 8 (simulator and physical devices). For iOS 9, it works in simulator but on device, the audio simply does not play. The streaming appears, if I click on play, the…
Rohan Sanap
  • 2,773
  • 2
  • 21
  • 39
8
votes
1 answer

Avplayer showing black screen sometimes but sound is fine

I am using AVPlayer with AVPlayerViewController. I am playing video after adding watermark in the video. Sometimes it is working fine, but sometimes it shows only a black screen, and audio is fine in both cases. vPlayer = [AVPlayer…
Deepak Chaudhary
  • 1,723
  • 1
  • 15
  • 29
8
votes
0 answers

detect when playback controls are on the screen

I want to display a banner in the lower third an AVPlayer. I am trying to detect when an AVPlayerViewController's playback controls appear and disappear from the screen so I can hide the banner accordingly.
8
votes
0 answers

How to exit full screen mode in AVPlayerViewController in iOS9

I am woking on iOS app. I need to play video in Portrait and Landscape mode. I have implemented AVPlayerViewController to play video. I have implemented video is finish then pop to previous screen. Every things is working fine but When user play…
Vipulk617
  • 799
  • 1
  • 7
  • 23
7
votes
0 answers

AVPlayerViewController Airplay in the presence of external UIScene

I have a UISceneConfiguration for external screen which is triggered when external display is connected to iOS device. // MARK: UISceneSession Lifecycle @available(iOS 13.0, *) func application(_ application: UIApplication,…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
7
votes
1 answer

Prevent AVPlayerController from hijacking MPRemoteCommandCenter

I have a view controller with two separate players, an audio player with AVAudioPlayer and a video player with AVPlayerViewController. When the view is loaded both players are initialized as well with their sources but stay paused until the user…
1
2
3
36 37