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
4
votes
2 answers

swift 3 error: Type 'AVLayerVideoGravity' has no member 'resizeAspectFill'

I am working on an iOS app using Swift 3 where I have a video playing in the background. My code was working completely fine until randomly the error message: Type AVLayerVideoGravity aka (NSString) has no member resizeAspectFill appears. I can't…
4
votes
1 answer

Playing DRM protected video issues in AVPlayerViewController

I'm developing an iOS application of playing video app, some of the videos are DRM protected and not played in AVPlayerViewController. Please help me out in playing those videos. I have referred FairPlay Streaming notes but unable to get anything…
Dhaval Patel
  • 716
  • 1
  • 10
  • 26
4
votes
1 answer

AVPlayer layer not showing video content sometimes

AVPlayer layer not showing video content sometimes but plays audio. This happens some times not each time Here is my lines of code : override func viewDidLoad() { super.viewDidLoad() self.tempVideoPath = NSURL(fileURLWithPath:…
Payal Maniyar
  • 4,293
  • 3
  • 25
  • 51
4
votes
2 answers

AVPlayerLayer Position in UIView Layer

I am writing an application using Swift to view surveillance cameras via HLS. I have the basic device list working and I am able to segue to the Live view and display the stream however, I need to move the AVPlayerLayer and I am having trouble…
recoilnetworks
  • 488
  • 2
  • 6
  • 21
4
votes
0 answers

AVPlayer layer showing blank screen when application running or idle for 15 minutes

I would like to create a custom video player using AVPlayer() and AVPlayerLayer() classes. My code working fine for application fresh start but goes wrong and showing blank screen when the application running or idle for more than 15 minutes. When…
Shajakhan
  • 41
  • 2
4
votes
2 answers

AVPlayer force landscape mode for fullscreen

I am playing a video using an AVPlayer which is about 320x200 frame in my app. The avplayer also has a custom 'fullscreen' button added as overlay, like the youtube app player. How can I implement it such that when the app is in portrait mode and…
King David
  • 139
  • 1
  • 9
4
votes
3 answers

Using Swift with AVPlayer, how do you add and remove a video via code?

I'm new to Swift and am trying to add a video to the view and then remove it when my "stopScreenSaver" notification is dispatched. All seems to work well except for when I go to remove the video layer (playerLayer.removeFromSuperlayer()). Any…
B.Man
  • 79
  • 1
  • 1
  • 7
4
votes
1 answer

Video Playback in the Background

I saw a note that this address http://developer.apple.com/library/ios/#qa/qa1668/_index.html Note: If you disable the video tracks in the movie, or detach the AVPlayerLayer from its associated AVPlayer it will allow the movie audio to continue…
user1669335
  • 143
  • 10
3
votes
1 answer

How to stop going to picture in picture when swiped up(put the application in background) and video is playing in custom AVPLayer?

I am working on a video player which supports Picture in picture. I play ads and video content on that player. I want to restrict automatic picture in picture when swiped up(put the app in the background) from the device when the player is playing…
adee
  • 77
  • 8
3
votes
2 answers

AVPlayer video doesn't resize after device rotation

I'm trying to make a AVPlayer video always full screen after device rotation. Here is my complete code. I do not understand why the video is not resized. Even if I use subclass like layerClass. After device rotation the videoView is cut, I do not…
Silvering
  • 756
  • 1
  • 6
  • 33
3
votes
0 answers

AVPlayerLayer makes the music stop playing for a second when moving to background

I remove/restore the AVPlayerLayer and its associated AVPlayer, like apple suggest in the docs. /* Remove the AVPlayerLayer from its associated AVPlayer once the app is in the background. */ - (void)applicationDidEnterBackground:(UIApplication…
yogev
  • 41
  • 3
3
votes
1 answer

How can I add a smooth fade in/out transition to AVPlayerLooper?

I have an AVPlayerLooper which uses an AVQueuePlayer. It's really easy to loop the video, but I wanted to fade in the video during the first second, and fade out during the last second. I've been able to make it fade in and out by using an…
se_puede_dev
  • 585
  • 7
  • 16
3
votes
0 answers

AVPlayer not playing HD Videos of Large Dimensions

I have a Kiosk app that receives videos from the Dropbox SDK, saves the Data into the Temp Directory and plays it back on a loop using AVPlayerLayer. I have absolutely no issues when playing videos that are small/medium (1334x750), but larger…
Jacobo Koenig
  • 11,728
  • 9
  • 40
  • 75
3
votes
0 answers

Debbugging a 'crossed' or disabled play button on AVPlayerViewController

I am trying to play videos in my app, but when I selected larger files from data that I download from Dropbox, I get a crossed out play button, and can't see or play my video. I understand that there must be a couple of reasons why the player might…
Jacobo Koenig
  • 11,728
  • 9
  • 40
  • 75
3
votes
0 answers

How to add subview to AVPlayer in Airplay Mode?

I have added subview to AVPlayer successfully. But, when I am playing it in the airplay mode, its not appearing in the Apple TV. Can anyone help me on this? How to add subview to AVPlayer in Airplay Mode?
Anand
  • 3,346
  • 9
  • 35
  • 54