Questions tagged [avqueueplayer]

AVQueuePlayer is a subclass of AVPlayer used to play a number of items in a sequence.

An AVPlayer object can be used to implement controllers and user interfaces for single- or multiple-item playback. The multiple-item case supports advanced behaviors.

AVPlayer works equally well with local and remote media files, providing appropriate information about readiness to play or about the need to await additional data before continuing.

The visual content of items played can be displayed by an instance of AVPlayer in a CoreAnimation layer of class AVPlayerLayer; to synchronize real-time playback with other CoreAnimation layers, AVSynchronizedLayer can be used. An instance of AVVideoCompositionCoreAnimationTool cannot be used with an AVPlayer object; for offline rendering AVAssetExportSession should be used.

The status of a player can be observed using key-value observing. AVPlayer serializes notifications of changes that occur dynamically during playback on a dispatch queue so that remote observers can be added and removed safely. By default, this queue is the main queue (see dispatch_get_main_queue). To ensure safe access to a player’s nonatomic properties while dynamic changes in playback state may be reported, one must serialize access with the receiver’s notification queue. In the common case, such serialization is naturally achieved by invoking AVPlayer’s various methods on the main thread or queue.

199 questions
3
votes
1 answer

How to detect volume button press on tvOS remote

Im trying to find a way to observe the player so that I can detect when a user increases or decreases the volume on the Apple TV. I have managed to get this to work for iOS by using: var audioSession: AVAudioSession? …
kaddie
  • 233
  • 1
  • 5
  • 27
3
votes
2 answers

seek to time in AVQueuePlayer

Can any one help me to seek at particular time in AVQueuePlayer? I have use this controller to play video in iPhone because i need to play two video at the same time. But my problem is to navigate in video and jump to at particular time, I am not…
Crazy Developer
  • 3,464
  • 3
  • 28
  • 62
3
votes
1 answer

An AVPlayerItem can occupy only one position in a player's queue at a time?

I have seen many questions on this and none have had a solution. I am getting: An AVPlayerItem can occupy only one position in a player's queue at a time In the console after quickly taping a view button which should have one of two states:…
user11182243
3
votes
1 answer

Issue with AVQueuePlayer seek(to:) and CMTime

I have an AVQueuePlayer and I'm trying to, on button press, seek back 5 seconds. My code is as follows: func seekBack() { guard let currentTime = self.player?.currentTime() else { return } let currentTimeSeconds =…
RPK
  • 1,830
  • 14
  • 30
3
votes
3 answers

Adding subtitles to AVPlayer video

I am using an AVPlayerView to display some local videos from my Apps Bundle directory. Now I want to add the ability to display subtitles for increased accessibility of my content. Since I’m the programmer, filmmaker as well as the one who has to…
ixany
  • 5,433
  • 9
  • 41
  • 65
3
votes
0 answers

Handling HTTP redirects in AVQueuePlayer

I have an application that can play an audio playlist using an AVQueuePlayer. The actual song's URLs are built dynamically and expires after a certain period of time after being built. So the playlist is constructed using something like a permalink,…
Marcos Crispino
  • 8,018
  • 5
  • 41
  • 59
3
votes
1 answer

Detecting AVPlayer video start stop events

Here is nice simple avplayer piece of code playing a small collection of videos in a queue. My question. I actually want to pause between videos on my queue. Is it possible? I did note that rate fires twice; status fires just once as does…
user3069232
  • 8,587
  • 7
  • 46
  • 87
3
votes
0 answers

AVQueuePlayer will not load the next item

I am trying to load the next item in AVQueuePlayer's que once the previous has finished loading for seamless playback(http streaming). I've been going off of Apples example - "AVFoundationQueuePlayer-iOS". From what I have seen from running Apples…
Peter
  • 1,053
  • 13
  • 29
3
votes
0 answers

AVQueuePlayer play a series of clips without hiccuping

I have a series of video clips in an AVQueuePlayer. How do I transition between them without a pause or delay? By default, it looks like there's a half second hiccup when transitioning between clip1.mp4 and clip2.mp4 All clips are local to the…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
3
votes
2 answers

AVPlayerItem was deallocated while key value observers were still registered

I am using AVQueuePlayer but it is crashing some times. I am getting this log AVPlayerItem was deallocated while key value observers were still registered with it. what is the region for crashing please help me.
Hari Babu
  • 891
  • 1
  • 9
  • 22
3
votes
3 answers

AVQueuePlayer not advancing to next item in iOS 8

I am using AVQueuePlayer to play a few videos, everything works fine in iOS 6 & 7. However, in iOS 8, when the current AVPlayerItem finishes playing the next video does not play. Placing an observer on the queue's currentItem property shows the the…
3
votes
1 answer

Gapless and non freeze playing of player items using AVQueuePlayer

I have some issue with avqueueplayer like app freezing for 2-3 seconds when each item ends in the queue. I am using queueplayer to play the records one after the other without gap. In order to achieve no gaps b/w player items, I need to load the…
Naveen
  • 636
  • 8
  • 28
3
votes
1 answer

Airplay with AVQueuePlayer has gaps

My app uses AVQueuePlayer to show video clips back to back. In testing on my AppleTV, it seems that when I switch to the next video in the queue, there is a small time gap where the Apple TV 'takes over' the screen and the home screen of the Apple…
Ish
  • 1,855
  • 5
  • 24
  • 32
3
votes
1 answer

iOS: How to play a mono audio file on both channels with AVPlayer

I'm currently using an AVQueuePlayer to play mono mp3 files that are downloaded from a URL. The audio sounds fine when it plays on the speakers, but when I put on headphones, the audio only comes out on one side. What is the simplest way to ensure…
loadedion
  • 2,217
  • 19
  • 41
3
votes
1 answer

App crashes with malloc: *** mmap(size=2147483648) failed (error code=12)

I am creating a AVQueuePlayer object by adding AVPlayerItems. All player items points to different audio URL and player should play as soon as it buffers. As I start the app in simulator, I get very strange issue with memory. The console says…
1 2
3
13 14