Questions tagged [avkit]

AVKit is an API developed by Apple Inc.

That comes with OS X Mavericks 10.9+ and can be used with Xcode 5.0+ for developing audio and movie software for Mac .

The AVKit software framework is going to eventually replace QuickTime which is now deprecated.

344 questions
4
votes
2 answers

IOS app crashes with "required condition is false: IsFormatSampleRateAndChannelCountValid(format)'" when the mic is selected

I am getting an application crash of my app when I am using mic in my case Microsoft Teams on the background and trying to record an audio inside of my app. Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required…
4
votes
1 answer

Where are the controls in SwiftUI VideoPlayer() when running on tvOS?

In iOS, this code plays a video perfectly, using default controls, but running the same code in tvOS only allows the video to be played, but there are no default controls and the player is not shown on the screen. I'm using Xcode 14. import…
atoss
  • 73
  • 5
4
votes
2 answers

Picture-in-picture in iOS fails with saying that the activationState is something other than foregroundActive but it is actually foregroundActive

I am implemeting Picture-in-picture on iOS. I added the background mode capability. When I call isPictureInPicturePossible, it returns false with error: pictureInPictureController failedToStartPictureInPictureWithError Error Domain=AVKitErrorDomain…
Taha Selim Bebek
  • 45
  • 1
  • 8
  • 16
4
votes
1 answer

SwiftUI: Allowing user to enable Picture-in-Picture with the press of a button (iOS)

I'm designing an app that allows the user to view a certain video in a SwiftUI view. I want to support PiP, and AVPictureInPictureController.isPictureInPictureSupported() always returns true, while pipController.isPictureInPicturePossible sometimes…
4
votes
1 answer

Remove black space from top and bottom of SwiftUI VideoPlayer

When the SwiftUI VideoPlayer is used, black space appears above and below the video. How can this black space be removed so that only the video with no extra space is shown. I haven't found any way to do this within SwiftUI. import SwiftUI import…
Ryan
  • 630
  • 8
  • 20
4
votes
1 answer

AVRoutePickerView doesn't pick up change to route made by overrideOutputAudioPort(.speaker)

I start a VoIP call using CallKit, use AVAudioSession.sharedInstance.overrideOutputAudioPort(.speaker) to force the audio to speaker, and then open an AVRoutePickerView. The selected output in the view is iPhone-- the ear speaker on the iPhone. I…
kumail
  • 41
  • 1
4
votes
0 answers

Fade out downloaded songs from Apple Music

How can I make downloaded Apple Music songs fade out (volume decrease steadily over a few seconds)? Recently I've been getting into trying to get Apple Music songs to play in my app. I've gotten them to play through the system/application music…
4
votes
0 answers

Supressing AVPlayerViewController layout errors

I am using AVPlayerViewController like this: func play(url:URL, parent:UIViewController) { let player = AVPlayer(url: url) NotificationCenter.default.addObserver(self, selector: #selector(AVPlayerManager.didfinishplaying(note:)),…
4
votes
2 answers

AVPlayer not playing m3u8 from local file

I am trying to get AVPlayer to play a m3u8 playlist that is a local file. I have narrowed this down to a simple test case using one of Apple's sample playlists: https://tungsten.aaplimg.com/VOD/bipbop_adv_fmp4_example/master.m3u8 If i play this…
Reneli
  • 1,756
  • 2
  • 16
  • 26
4
votes
0 answers

Custom Menu Items in AVPlayerViewController

On tvOS, is it possible to add custom items to the AVPlayerViewController Info/Subtitles/Audio menu? Not just adding metadata items, but a whole new section. I'd like to provide an additional menu item after Subtitles for playback speed selection…
Isaac Overacker
  • 1,385
  • 10
  • 22
4
votes
1 answer

Picture in picture button disabled

I'm developing a live video player and I want to use the new Picture in Picture option. I based the player on an AVPlayerViewController and this is my code. class PlayerViewController: AVPlayerViewController { var link = NSURL () override…
Corrado
  • 41
  • 8
4
votes
1 answer

AVPlayer / AVPlayerLayer not appearing in subview using auto layout

I'm trying to display a video inside of a subview which contains the video and some text. I used the recommended UIView subclass from Apple to create a UIView to contain my AVPlayer: import Foundation import AVFoundation class JSAVPlayerView :…
Matt
  • 6,993
  • 4
  • 29
  • 50
4
votes
1 answer

Playing a video in the background with AVPlayer giving problems with AspectFill and looping

Here's what I have and I want this video to fill the whole screen (aspectFill) playerLayer.videoGravity = kCAGravityResizeAspectFill is supposed to do the Aspect Fill but I still get black bars at the top and bottom of the screen. The last line is…
Harout360
  • 899
  • 1
  • 9
  • 14
4
votes
2 answers

How to disable Picture in Picture mode for default video player

How can I disable Picture in Picture button/mode using Swift in iOS9 on iPad when user tries to play a video in my app?
Daniil Harik
  • 4,619
  • 10
  • 55
  • 60
4
votes
2 answers

Embedded AVPlayerControllerView adds AVTouchIgnoringView blocking default player's interface

UPDATE: The issue has nothing to do with AVPlayerControllerView, please see my answer below. Name of the class AVTouchIgnoringView confused me in the beginning, but that was also a wrong path of thinking about the problem. === As we all know, Media…
mikejd
  • 1,540
  • 13
  • 18
1 2
3
22 23