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
6
votes
0 answers

AVQueuePlayer (or AVPlayer) with a Soundcloud stream item block the UI (Main Thread)

Thank to those two posts, I resolve this problem during the creation of the AVPLayerItem AVQueuePlayer playback without gap and freeze AVPlayer "freezes" the app at the start of buffering an audio…
Damien Romito
  • 9,801
  • 13
  • 66
  • 84
6
votes
3 answers

How to do something when AVQueuePlayer finishes the last playeritem

I've got an AVQueuePlayer which I'm creating from an array of 4 AVPlayerItems, and it all plays fine. I want to do something when the last item in the queue finishes playing, I've looked a load of answers on here and this is the one that looks most…
MikeF
  • 151
  • 1
  • 4
5
votes
0 answers

Audio duration returns nan in AVQueuePlayer

When I try to play a .wav file from server using AVQueuePlayer it returns duration as nan. I used this code to get the duration audioPlayer.currentItem?.duration.seconds audioPlayer.currentItem?.asset.duration.seconds And I am sure that .wav file…
nikhil
  • 616
  • 8
  • 22
5
votes
1 answer

AVURLAsset loadValuesAsynchronously never fail

I am reading & trying Apple's sample code about loading video assets. But I notice that the loadValuesAsynchronously function on AVURLAsset never fail even if I turn on airplane mode on the device or turn off wifi on my mac. Anybody know under what…
Yuchen
  • 30,852
  • 26
  • 164
  • 234
5
votes
1 answer

AVQueuePlayer starting next item too soon

I've got an AVQueuePlayer, and under specific circumstances, it will start playing the next track before the previous one has finished. It doesn't play them both simultaneously, it just cuts out the first track early and starts the next one. This…
aethe
  • 909
  • 1
  • 8
  • 12
5
votes
2 answers

How do I loop the queue of sounds in AVQueuePlayer?

I know multiple questions concerning the same issue exist, but after following this one's suggestions, I run into a couple of problems. I have everything set up but I get to mach errors everytime I use kMTTimeZero. soundQueue = [AVQueuePlayer…
KingPolygon
  • 4,753
  • 7
  • 43
  • 72
4
votes
2 answers

Controlling the pre-buffering of items in the avqueueplayer

Please can someone tell me if there is a way to selectively pre-buffer the avplayeritems in the AVQueuePlayer array rather than leaving it down to the AVQueuePlayer automatic way of only loading the next item in as the first item finishes…
Geoff H
  • 3,107
  • 1
  • 28
  • 53
4
votes
0 answers

The next and previous controls of the default video screen with AVPlayerViewController - AVQueuePlayer, is not working

I have a list of songs to play in AVPlayerViewController, so I use AVQueuePlayer to play it. All the songs are kept in the bundle. Now, the default video screen I get the things functioning are: Play/Pause Auto switching to next video after…
4
votes
6 answers

'An AVPlayerItem cannot be associated with more than one instance of AVPlayer'

I know this question is all over Stack Overflow but still, most of them are old and not related with what I'm going to ask here. So I've got an array with AVPlayerItems and an AVQueuePlayer. At first I set the AVQueuePlayer to play the array…
4
votes
1 answer

How to play multiple videos in AVQueuePlayer or AVMutableComposition without any gapes or freeze?

I know this question has been asked a few times in past and I have read responses to those. But nothing seems to work the way I want. There are multiple videos and all are added in queue of AVQueuePlayer. I have tried adding in two ways as…
blancos
  • 1,576
  • 2
  • 16
  • 38
4
votes
1 answer

Removing AVPlayerItem observers

If I use KVO to observe my player items like this: AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:url]; [playerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:MyClassKVOContext]; …
Oren
  • 5,055
  • 3
  • 34
  • 52
4
votes
2 answers

Check if AVQueuePlayer is playing?

I'm trying to develop multi files audio player so I used AVQueuePlayer, I need to check whenever the player is playing a sound or paused? For AvAudioPlayer, I have the property "isPlaying", but for AVQueuePlayer how to check it? Thanks.
hafedh
  • 539
  • 1
  • 9
  • 26
4
votes
2 answers

How to know when AVPlayerItem is playing

I am having a problem with AVPlayerItem and AVQueuePlayer. Currently i have a lot of music files which are 1-2 sec long and a queue Player for playing them in sequence. What I want is to know when a music file has just started playing and not when…
Theodoros80
  • 796
  • 2
  • 15
  • 43
4
votes
2 answers

iOS: AVQueuePlayer/AVPlayerItem 'An AVPlayerItem can occupy only one position in a player's queue at a time.'

I keep getting this error: 'An AVPlayerItem can occupy only one position in a player's queue at a time.' I NSLog'd the players items, and none of them seem to be equal. Further, I added this just to be sure: if([player canInsertItem:itemToAdd…
JoshDG
  • 3,871
  • 10
  • 51
  • 85
4
votes
1 answer

Odd RTCReporting bug

I'm developing an iOS app and my AVQueuePlayer is causing issues. As it plays, this error appears: RTCReporting: resolve from https://qtpartners.apple.com/storebags/hls?version=1.32 RTCReporting: environment release doesn't exist in storebag I…
Sam Baumgarten
  • 2,231
  • 3
  • 21
  • 46
1
2
3
13 14