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
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
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…
11
votes
2 answers

AVPlayerViewController using audio-only AVPlayer

Just starting out with AVKit, and I'm trying to play some audio. It would be nice to use the new AVPlayerViewController detailed in Mastering Modern Media Playback so that I have a ready-made play/pause/seek UI. I basically have a storyboard with…
davidfmatheson
  • 3,539
  • 19
  • 27
10
votes
2 answers

AVPictureInPictureController doesn't automatically start picture-in-picture when backgrounding the app

When creating a custom video player using the AVPlayer + AVPlayerLayer + AVPictureInPictureController for a iPhone running iOS 14 (beta 7) the video does not automatically enter picture-in-picture-mode when the app enters the background after…
Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
10
votes
1 answer

Storing depth data (with 16-bit depth) as auxiliary data in a JPEG file

I want to be able to store the depth data of a captured ARframe in iOS in a non-lossy compressed image file. According to this WWDC talk: "In iOS 11 we support two kinds of images with depth. The first is HEIF HEVC, the new format, also called…
Dhruv Pargai
  • 121
  • 5
10
votes
2 answers

How to add external WebVTT subtitles into HTTP Live Stream on iOS client

We have videos encoded via bitmovin.com and provided as HTTP Live Streams (Fairplay HLS), but subtitles although in WebVTT format are exposed separately as direct URLs for the whole file, not individual segments and are not part of the HLS m3u8…
Martin Koles
  • 5,177
  • 8
  • 39
  • 59
10
votes
6 answers

Close AVPlayer when movie is complete

I am making a simple iPad app to play a movie when a button is pressed. The movie plays and when the movie is finished I want to close AVPlayerView so it goes back to the main screen. Currently when the video finishes it stays on the last frame.…
RoryM
  • 125
  • 1
  • 1
  • 6
9
votes
1 answer

Playing Streaming Video With AVPlayer

How do you play a streaming video with AVPlayer? import Cocoa import AVKit class StreamViewController: NSViewController { var videoPlayer: AVPlayer! @IBOutlet weak var moviePlayerView: AVPlayerView! override func viewDidLoad() { …
El Tomato
  • 6,479
  • 6
  • 46
  • 75
8
votes
1 answer

Embedding videos in a SwiftUI view

My main goal is to embed a GIF/MP4 file in a view in a HStack/VStack using SwiftUI. I understand the code needs to conform to the 'Representable' protocols. My first attempt at doing this is below: import SwiftUI import AVKit struct GIF :…
Vedant
  • 339
  • 4
  • 10
8
votes
1 answer

What's the best way to play video in SceneKit?

I've tried a number of different techniques to play videos in SceneKit, but none of them seem to work correctly. I've tried assigning an AVPlayerLayer to an SCNMaterial.diffuse.contents and that simply fails to display any video frames at all,…
LenK
  • 2,944
  • 2
  • 20
  • 26
7
votes
3 answers

AVPlayerViewController Play Icon Removed in iOS 16

In previous versions of iOS, loading AVPlayerViewController (as well as SwiftUI VideoPlayer) with a video would display the first frame and include a play icon in the center but this has gone away in iOS 16. I've been relying on that UI element as…
toemat
  • 150
  • 1
  • 9
7
votes
2 answers

VideoPlayer view prevents SwiftUI Navigation Bar from hiding

The problem occurs when I put VideoPlayer view inside NavigationView's parent view or child view. In this example the child view will show navigation bar: struct ParentView: View { var body: some View { NavigationView { VStack { …
7
votes
0 answers

TrueDepth camera foreground segmentation, improving mask result

I'm checking out an Apple project that demonstrates how to separate a person from the background using the TrueDepth front camera. You can see that…
user339946
  • 5,961
  • 9
  • 52
  • 97
7
votes
2 answers

Can't able to get Video Tracks from AVURLAsset for HLS videos(.m3u8 format) for AVPlayer?

I am developing a custom video player to stream HLS videos from server. I can successfully play HLS videos using AVPlayerItem and AVPlayer. After that I want to add subtitle track and audio tracks for my video player. So I used AVMutableComposition…
Uma Sankar Buddi
  • 277
  • 2
  • 14
1
2 3
22 23