Questions tagged [avplayerlayer]

AVPlayerLayer is a subclass of CALayer to which an AVPlayer object can direct its visual output.

During playback, AVPlayer may compensate for temporal drift between its visual output and its audible output to one or more independently-clocked audio output devices by adjusting the timing of its associated player layers. The effects of these adjustments are usually very small; however, clients that wish to remain entirely unaffected by such adjustments may wish to place other layers for which timing is important into independently timed subtrees of their layer trees.

You can create arbitrary numbers of player layers with the same AVPlayer object. Only the most-recently-created player layer will actually display the video content on-screen.

Click Here for Apple documentation of AVPlayerLayer.

248 questions
3
votes
1 answer

AVPlayer is not ready for display after re-enter to a screen on the seventh time

A screen show short video using AVPlayer in my IOS app. I leave and re-enter this screen few times successfully but after seven times and more I get blank screen and AVPlayerLayer's IsReadyForDisplay property is 'NO'. I pause AVPlayer(and set to…
Eli Mal
  • 31
  • 3
3
votes
2 answers

Adding a AVPlayerLayer as a sublayer of the current view does not work on an iPhone 5

I have a login screen that I wanted a video background for. It plays while the user taps the signup or login buttons. Standard thing you see in apps nowdays. Here is what I am doing: - (void)addPlayerLayer { NSString *moviePath = [[NSBundle…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
3
votes
1 answer

how to avoid memory warning with avplayer?

I'm developing an app in swift language to reproduce some live streaming or video on demand and I have 3 view controllers, the first is for live streaming, the second is a collection view with video on demand tuhmbnail and selecting one of this, it…
AlexBerry
  • 103
  • 1
  • 1
  • 6
3
votes
1 answer

Possible to "reuse" AVPlayerLayer? Removing from superview for cell reuse affects my performance

I've created a real simple player class that I've added as a property of a custom uitableviewcell. I was fairly pleased with the scrolling, but figured it could be better. I have a "cleanup" method that I call from within the player class to…
django-d
  • 2,210
  • 3
  • 23
  • 41
3
votes
2 answers

AVSynchronizedLayer animation works fine with local file but not while streaming

I have an animation that works fine with a local video file using an AVSynchronizedLayer. Now, when I replace the local file like with a streaming link(of the same file) the animation totally stops working. I have no clue whats causing this, have…
Faraz Hassan
  • 663
  • 1
  • 6
  • 24
3
votes
2 answers

AVPlayerLayer shrink animation

I am trying to do a "shrink" animation on AVPlayerLayer but as soon as I do it the video content simply disappears off the screen. Animating the UIView holding AVPlayerLayer works but not the AVPlayerLayer. What is the right way to animate it ? …
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
3
votes
1 answer

AVPlayer seekToTime only generates frame every second

how can I make AVPlayerLayer display the exact video's frame in method seekToTime. Now [AVPlayer seekToTime:CMTimeMakeWithSeconds(CMTimeGetSeconds(A, B))], the AVPlayerLayer only displays the frame at every 1-second change for example…
Tung Vo Duc
  • 503
  • 6
  • 16
3
votes
2 answers

AVPlayer is Not Playing From NSCachesDirectory?

Hi I am Trying to Play Video Files From NSCachesDirectory. The Player is not loading the Files from NSCachesDirectory in videoView layer. Is it Possible to play Video from cacheDirectory Memory? Please suggest me... I have tried this.. NSArray…
NextStep
  • 429
  • 5
  • 20
3
votes
0 answers

Send audio to bluetooth device with AVPlayer IOS

Hey I have a video app which uses AVPlayer, I received an email from a user saying he couldn't use his car's bluetooth anymore since I updated the app some time ago. Now, I didn't tried to support bluetooth back then, but apparently this…
Emanuel
  • 1,981
  • 1
  • 20
  • 28
2
votes
1 answer

CATextLayer does not show text (just background color)

I found different posts where people have problems to show CATextLayer like this or that. The solution from the threads unfortunately only partially work for me. My problem is that my CATextLayer sometimes show text and sometimes not. The structure:…
kuzdu
  • 7,124
  • 1
  • 51
  • 69
2
votes
2 answers

Playback buttons do not appear in an AVPlayer after adding a layer - iOS 16

I am using an AVPlayer to present a video. The app has only one .mp4 but for a different use case, the same video needs to get flipped. The buttons are there and completely functional, you can press the play and the 15 seconds forward/backward…
2
votes
0 answers

Merge CAShapeLayer into CVPixelBuffer

I'm capturing the output of a playing video using AVPlayerItemVideoOutput.copyPixelBuffer I'm able to convert the pixel buffer into a CIImage, then render it back into a pixel buffer again, and then an AVAssetWriter writes the buffer stream out to a…
Steve Macdonald
  • 1,745
  • 2
  • 20
  • 34
2
votes
1 answer

Display multiple videos with AVPlayer - swift - programmatically

I have a AVPlayer that displays a video from a url, this is how I set it up: fileprivate func setUpPlayer(cardModel : CardModel){ cardModel.urlStrings?.forEach({ (urlstring) in guard let url = URL(string: urlstring) else { …
StackGU
  • 868
  • 9
  • 22
2
votes
1 answer

Routing AVPlayer audio output to AVAudioEngine

Due to the richness and complexity of my app's audio content, I am using AVAudioEngine to manage all audio across the app. I am converting every audio source to be represented as a node in my AVAudioEngine graph. For example, instead using…
Winston Du
  • 340
  • 2
  • 9
2
votes
1 answer

videoGravity resizeAspectFill doesn't work - Swift - AVFoundation

I'm displaying a video inside a UIView, everything works fine and Video Layer Bounds are the same of the UIView in which it is embedded. The problem is that the video is not displayed correctly inside the view's bounds, I can only see a part of it…
user13370778