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

Is there a way to capture screenshot of the view within AVPlayerLayer?

I am currently making a video collage app. I have one view that contains Avplayerlayer as a sublayer. I need to get a screen shot of the view that contains AvplayerLayer. When I tried to take it it gets the screen shot but for the…
Mehmet Baykar
  • 367
  • 3
  • 11
2
votes
2 answers

iOS - AVPlayer doesn't play mov file

I have the following code which is not working with the mov file, but it works when i use an MP4 file. The important thing about to mov file is because it has an alpha channel. I'm open to find solutions that offers me an alpha channel as mov file…
Ricardo
  • 7,921
  • 14
  • 64
  • 111
2
votes
2 answers

How to Mirror(Flip) Video playing using AVPlayer?

I want to Mirror (Flip) video playing using AVPlayer. Like : MirrorTube :- https://chrome.google.com/webstore/detail/mirrortube/olomckflnlligkboahmaihmeaffjdbfm/related?hl=en i want to achieve same functionality. I have tried to change…
Ravi
  • 93
  • 11
2
votes
0 answers

Displaying a filtered video File with a preferredTransform that is not identity swift

For the app I'm working on, I need to provide a functionality that lets users apply filters to their videos( not real time, applying filters on a saved video and filePath is provided). addFilterToVideo is called when the user taps on a filter, a…
Anirudh Bandi
  • 1,171
  • 10
  • 20
2
votes
1 answer

AVPlayerLayer doesn't appear for a few seconds but sound works perfectly

I am working on an app where feed have videos looping in it (inside table view cells). There can be multiple videos present at the same time, but only one of them may be playing. I'm creating AVPlayers in background, and putting their playerLayers…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
2
votes
1 answer

Rotate video 90 degrees in AVPlayerViewController - possible?

I cannot figure out how to rotate the video 90 degrees in AVPlayerViewController, anyone have any ideas as to how to do this? I'm unsure how to access the AVPlayerLayer as you normally would.
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
2
votes
1 answer

What is wrong with this AVFoundation KVO pattern for a video player [ref: AVPlayerLayer, AVPlayerItem, AVURLAsset]?

I wrote a UIView subclass "VideoPlayerView" to encapsulate AVFoundation video playback. I believed that I had a bulletproof KVO pattern set up to handle observation of the AVPlayer, AVPlayerItems and AVURLAssets for the purpose of loading, playback…
2
votes
3 answers

Table view plays videos in other cells while scrolling down

Following is the code where I am trying to play videos by creating custom controls . On click of the play button, the video in the table view plays but it also plays on the third cell from the current cell where the video is playing . On moving to…
A.S
  • 798
  • 1
  • 10
  • 32
2
votes
1 answer

AVPlayer Content Modes

I have a AVPlayer, and am using it as a background in my UIView as an aesthetic. To initialize and instantiate it, I do override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) guard let path =…
dovedevic
  • 673
  • 2
  • 14
  • 33
2
votes
1 answer

Make AVPlayer full screen without letterboxing

I'm trying to display a video on a login screen as seen on apps like Spotify. What I'm doing To do this I'm using AVPlayer: self.videoPlayer = AVPlayer(playerItem: item) self.videoView.player = self.videoPlayer self.videoPlayer.play() The…
cbbcloud
  • 479
  • 5
  • 15
2
votes
0 answers

Possible to check if AVPlayerLayer is visible?

Is it possible to check if an AVPlayerLayer which is added as a sublayer to a ViewController's subview's layer is visible or not? Basically if at any point of time, another view be laid over the said subview, I require to pause the AVPlayer, even if…
batman
  • 1,937
  • 2
  • 22
  • 41
2
votes
1 answer

AVPlayer not playing and layer not showing

I'm using an Objective-C project for reference for a very similar Swift app. Basically, videos are uploaded to Firebase and the download URL is saved to a "Post" object and played in a UITableViewCell upon retrieval. In the Objective-C project (also…
Echizzle
  • 3,359
  • 5
  • 17
  • 28
2
votes
1 answer

Play video in the collection view cell like the videos playing in the Facebook app Timeline

I want to play video in the collection view cell,the requirement is like the instagram timeline and playing video is like playing videos in the facebook time line, for this I used UICollectionViewCell in witch I have some images no videos now I am…
2
votes
3 answers

UICollectionView & AVPlayer Performance

I have a UICollectionView whose cells each have an AVPlayerLayer, all playing a video at the same time. About 9 cells fit on the screen at a time and it's pretty laggy so I need ways to boost the performance to achieve smooth scroll. There's a few…
barndog
  • 6,975
  • 8
  • 53
  • 105
2
votes
1 answer

Saving Video to Parse & Playback

So i'm using this custom class to record my video -- https://github.com/piemonte/PBJVision. I am attempting to record video in my iOS app and I can't seem to get the code correct to upload the file to my parse server. A few things: In the PBJVision…