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
6
votes
1 answer

Swift AVPlayer Won't Player MP4: Play Button With Line Through It

I am trying to player an mp4 video from the local file system on an ios app. The video is about an hour long and can be played on quicktime. I am able to play an mp4 if it is from the web (NSURL(string: "http:domain.com/vid.mp4")). I am playing the…
Alex Pelletier
  • 4,933
  • 6
  • 34
  • 58
6
votes
0 answers

How to show subtitles using srt files if videos are played using AVPlayerViewController?

I am using AVPlayerViewController of AVKit framework for playing videos directly in landscape mode. I want to know how to show subtitles. I searched but dint find any solution about. I was using MPMoviePlayerViewController for playing Videos but as…
IOS Dev
  • 286
  • 2
  • 14
5
votes
0 answers

How to get control over AVPictureInPictureController Play/Pause button?

I'm using the Picture in Picture feature in my application using AVPictureInPictureController and its delegate methods. I followed the APPLE documentation to implement this feature. And I'm glad that it's working fine. But now I want to restrict the…
5
votes
1 answer

How to fix view controller hierarchy for AVPlayer?

I have an iOS app with a single player and login. It should work like this: 1) Run app 2) login 3) after login video directly starts playing 4) if you exit the video it should ask for whether you want to logout 5) if no should continue to playing…
C.Aglar
  • 1,290
  • 2
  • 14
  • 30
5
votes
1 answer

Swift AV Player Video Should be AspectFill OR Full Screen

At Sign In Screen I've to display background video with full resolution. I'm able to do this by double tapping on below image at black area. Here is my required result. but this isn't done by coding. I just did this by double tapping on black…
Arsal
  • 343
  • 2
  • 8
  • 21
5
votes
1 answer

What is PGHostedWindow in window hierarcy on iPad and how to prevent their creating?

Ok. Here is the question. I have tabBar controller, in tab at index 0 I have a TableView with cells showing video by AVPlayerViewController. For iPhone, when i print content of UIApplication.shared.windows - it has only 2 window - UIWindow and…
5
votes
4 answers

AVPlayerViewController crashing when tapping media selection button in landscape on iPhone plus device

The title is nearly describing everything, but here in detail... To play videos in my app I am using an AVPlayerViewController which I am presenting modally let player = AVPlayer.init(url: url) let playerViewController =…
Kai
  • 1,277
  • 2
  • 15
  • 25
5
votes
0 answers

AVAudioEngine, AVPlayer, AVPlayerViewController - Control Center controls becomes disabled when AVPlayerViewController plays video

I am using AVAudioEngine to play audio files and AVPlayer and AVPlayerViewController to play videos. and Control Center notification are enabled UIApplication.shared.beginReceivingRemoteControlEvents() Control Center works perfectly for audio files…
PGill
  • 3,373
  • 18
  • 21
5
votes
4 answers

Place AVPlayerViewController inside UIView

Currently I am having a dialogue view with four controls at the bottom. Each control is loading a different view inside the dialogue. One of these controls is setting an AVPlayer inside the dialogue view and is playing it. Unfortunately the AVPlayer…
Mulgard
  • 9,877
  • 34
  • 129
  • 232
5
votes
4 answers

AVPlayerLayer shows black screen but sound is working

Im trying to display a local recorded video in a AVPlayerLayer which works sometimes. I can hear the audio from the recorded video but can't see the video. Sometimes both video and audio is working, sometimes only audio. I've tried both with a…
5
votes
1 answer

detect AVPlayerViewController Done button click?

I'm writing Plugin for AVPlayer in ios. I need to know when user click on Done button in AVPlayerViewController ( I want to know when user close video) and I don't access to AVPlayerViewController object. I checked event and found only rate property…
vahid
  • 446
  • 6
  • 21
5
votes
0 answers

AVPlayerViewController Playback Control Rewind/Forward Not Working

I'm able to get the AVPlayerViewController to display properly via presentViewController. The Play and Pause buttons work as expected, but the Fast Forward/Backward buttons don't do anything... I've looked over the documentation but haven't seen…
DranoMax
  • 474
  • 4
  • 18
5
votes
2 answers

Detect if AVPlayerViewController is playing video or buffering and add overlay to the player

I have to detect whether the video is in playing or buffering mode.I am loading the video from a URL. I have tried the below code and I am able to track after once the video has started playing, but not when it is in buffering state. Also, I want…
Prashant Ghimire
  • 518
  • 4
  • 20
5
votes
3 answers

How to user Basic Authentication with AVPlayer to play video file from server?

I have to play a video file in AVPlayer from server but i also have to use basic authentication to play this file.here is my code NSMutableDictionary * headers = [NSMutableDictionary dictionary]; NSData *basicAuthCredentials = [[NSString…
5
votes
1 answer

Change AVPlayerViewController background to album artwork objective-c iOS

Is it possible to change the background of an AVPlayerViewController instance when playing audio ? When I lock my device, I can see the music controls with album artwork correctly shown but when the AVPlayerViewController is shown in my app, I can…
Synny
  • 542
  • 1
  • 4
  • 18