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
9
votes
3 answers

Saving video with overlay of GIF image

I am working on an application in which I record a video. When recording finished I put a GIF image on it with use of Library. My code for playing video and putting gif image as an overlay self.avPlayer = [AVPlayer…
Jitendra Modi
  • 2,344
  • 12
  • 34
9
votes
5 answers

how to add AVPlayer to UIView in ViewController

I my UIViewController I have an outlet to UIView, where I would like to display video using external links. In this case I try to create AVPlayerLayer and add it to my UIView outlet. My code looks like that: class VievController:…
PiterPan
  • 1,760
  • 2
  • 22
  • 43
9
votes
1 answer

Reuse same AVPlayer and AVPlayerLayer or create new ones each time?

If you need to play multiple videos in the same view, there are seemingly two approaches: (1) create new AVPlayerLayers and AVPlayers each time; or (2) reuse the same ones. Assume your class is designed to play multiple videos, and the following…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
9
votes
2 answers

AVPlayer Slider seeking Backwards issue

I am using AVplayer to play videos in my app. I am using seekToTime:toleranceBefore:toleranceAfter: to seek through the video using a slider so the problem is when you slide in forward direction, video seeks perfectly (looks like video is moving…
iparag
  • 101
  • 3
8
votes
1 answer

AVPlayer layer not showing video content

I am using multiple AVPlayers to display content on my screen and they are all playing video simultaneously. The issue is that sometimes the avplayer is playing but the avplayerlayer isn't showing anything- all you get is a blank screen. This…
Iain Usiri
  • 93
  • 1
  • 4
8
votes
3 answers

Swift: Resize an AVPlayerLayer to match the bounds of its parent container

I have a local video playing using AVPlayer and AVPlayerLayer (Swift, iOS 8.2), and i need to resize the AVPlayerLayer (introPlayerLayer) when its parent view (introView) is resized, including on orientation change. So far nothing I have tried seems…
Connor Laurel
  • 81
  • 1
  • 1
  • 4
8
votes
2 answers

AVPlayer Full Screen

i'm using AVPlayer in my apps instead MPMoviePlayerController since i want to put the player as sublayer. However i need control like play, pause, search, and full screen. How do i get that button in AVPlayer? This is how i put the player: …
user3231429
  • 205
  • 1
  • 2
  • 13
8
votes
3 answers

AVPlayer doesn't show anything

I try to embed different videos from youtube vimeo, dailymotion. Sadly at the Moment nothing is shown except the backgroundcolor of my containerView: UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0, 320.0f,…
Davis
  • 1,253
  • 4
  • 17
  • 38
8
votes
1 answer

AVPlayerLayer get Image to UIImageView Buffer

i try to [playerLayer renderInContext:UIGraphicsGetCurrentContext()]; it will display black background. so i get current player item as thump image continuously it is not look like video play just still images continuously flow. so any other option…
Selvam M
  • 247
  • 1
  • 12
7
votes
1 answer

Set AVPlayer/AVPlayerLayer size using AutoLayout?

I'm trying to set the size/frame of the video I'm showing in my view, using AutoLayout. But I can't figure out how to do it properly. This is the code for my view: import UIKit import AVKit class VideoMeetingView: UIView { lazy var…
eivindml
  • 2,197
  • 7
  • 36
  • 68
7
votes
0 answers

AVPlayer's video and audio become out of sync after pausing and then resuming video

I'm using AVPlayer to play videos in my app. Video playback always works perfectly, except for when you pause/resume the video. If the user presses the pause button, and then resumes the video, sometimes the audio will be ahead of the video. The…
user3344977
  • 3,584
  • 4
  • 32
  • 88
7
votes
1 answer

How can I avoid the AVPlayerLayer `setPlayer` audio blip?

I have an application that plays video using AVPlayer and AVPlayerLayer. In my app, I'm able to play audio when the app is locked by setting the player property of my AVPlayerLayer to nil when the application enters the…
Aaron Wojnowski
  • 6,352
  • 5
  • 29
  • 46
6
votes
0 answers

Swift: AVPlayer release memory / resources

I am writing an app that need display different video according to the selection of the user. When the user select a video, the function playVideo will be called. And after the video finish playing, then the videoView will be hidden again. My code…
user6539552
  • 1,331
  • 2
  • 19
  • 39
6
votes
2 answers

AVPlayerLayer as SCNMaterial not rendered, audio playing fine

i'm trying to use a AVPlayerLayer as a SCNMaterial to be assigned to a SCNSphere. Based on:…
David Homes
  • 2,725
  • 8
  • 33
  • 53
6
votes
2 answers

AVPlayerLayer isn't showing AVPlayer video?

What's the trick to getting AVPlayer video content to show up in one's view? We are using the following AVPlayer code but nothing is appearing on screen. We know the video is there because we were able to show it using an…
Praxiteles
  • 5,802
  • 9
  • 47
  • 78
1
2
3
16 17