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
1
vote
1 answer

How to Log which AVPlayerItem is playing in AVQueuePlayer?

I'm using the AVQueuePlayer to play many audio files in sequence. I need to log every AVPlayerItem that is playing. How to do that?
neowinston
  • 7,584
  • 10
  • 52
  • 83
1
vote
1 answer

Can iOS 4 o r5 update/change the play items when it is on background?

If I use a pre-initialized items to construct a AVQueuePlayer, the sound can come out without problem. But I wonder is there any way to change the item in the list of the player when background? I am developing a alarm clock app for my first…
Sevear Liu
  • 61
  • 6
1
vote
1 answer

AVQueuePlayer playing several audio tracks in background iOS5

I used AVQueuePlayer to play several items in background. And code worked perfect in iOS4. And in iOS5 AVQueuePlayer changed its behavior, so player stops playing after first item is ended. Matt Gallagher wrote a hint in this post. "As of iOS 5, it…
mashe
  • 89
  • 1
  • 7
1
vote
0 answers

AVQueuePlayer stutters when modifying the next item in line

The audio playback stutters for a brief moment when modifying the queue. Whenever I try to modify the next item in the line of playback, the audio always stutters. It doesn't matter if I add a new element, or remove the next in-line element. Sample…
gentique
  • 29
  • 4
1
vote
0 answers

How can I obtain gapless playback with AVPlayer?

I am trying to play files consecutively with no gap in between. The first thing I tried was using AVQueuePlayer: let player = AVQueuePlayer() let playerItem1 = ... let playerItem2 = ... player.insert(playerItem1, after:…
Hello
  • 219
  • 2
  • 7
1
vote
1 answer

Using AVQueuePlayer to enforce/respect desired gaps between PlayItems

Hi all I'm using AVQueuePlayer to play a sequence of media files (audio, video). I sometimes have PlayItems that are shorter than the durations I need i.e. I want a silence between some items. I have been considering trying to use some combination…
1
vote
1 answer

How to loop videos with AVQueuePlayer after it completes

I have an array of URLs that I then turn into an array of AVPlayerItems and use AVQueuePlayer to loop through the videos- usually 1-7 videos at a time. However when it stops I am not sure how to start it again to play the same array of videos until…
1
vote
1 answer

How to set an observer on the queue player's currentItem?

I am trying to set an observer for the currentItem of the AVQueueplayer but I get an error called EXC_BAD_ACCESS. Can someone help me please? Thanks for your attention. I’m looking forward to your reply. Here is my code: struct VideoPlayerS :…
NYBSZ37
  • 61
  • 7
1
vote
2 answers

How to fill an array with elements of AVPlayerItem type from a local directory

I use AVQueuePlayer in my app and I need to have an array with my tracks with type [AVPlayerItem]. Array must creates every time when TableView loads. Also I have an array "content" with elements in current folder to create a table view cells. How…
VyacheslavB
  • 181
  • 9
1
vote
2 answers

set volume of AVQueuePlayer

I have use AVQueuePlayer to play two video at the same time, Now I have some problem in my application. I want to mute the video while it is playing . But there is no method found to set volume. Can any one help me to set volume in…
Crazy Developer
  • 3,464
  • 3
  • 28
  • 62
1
vote
1 answer

set seek time in AVQueuePlayer in iphone

I am developing an application in that I want to play two video at the same time, That is not possible using MPMoviePlayer. So I have used AVQueuePlayer To play video. As I am success to play video but the problem is in jumping to particular time.…
1
vote
1 answer

How to insert a pause in between items in AVQueuePlayer?

I am using AVQueuePlayer to playback a batch of audio files. I'd like to insert a pause in between items. Any idea how to do that? Here the method that adds items into the queue: func addItemToAudioQueue (file:String, last:Bool) { let…
Björn
  • 111
  • 10
1
vote
0 answers

AVQueuePlayer doesn't play long duration wav audio

I tried playing a .wav of 7 minutes,17 minutes, 20 minutes works fine, but when trying to play an audio of 1.04 hour it doesn't work. And I am sure that .wav file I am using is not corrupted since its being used by android app and they are able to…
nikhil
  • 616
  • 8
  • 22
1
vote
1 answer

How to add new items to AVQueuePlayer currently playing with old items

Adding New Items To AVQueuePlayer Doesn't Play I have scenarios where I'm streaming HLS audios from server. Initially I make an Array of AVPlayerItem. And initialise the AVQueuePlayer, And on button clicks it plays initial items very fine. But down…
Hasnain Kanji
  • 17
  • 1
  • 8
1
vote
0 answers

Possible bug tracking buffer progress with AVPlayerItem.loadedTimeRanges

I'm running into some strange issues with AVQueuePlayer. I'll first explain the purpose of my implementation, then go over the issues I am hitting. Running: iPhone5s, iOS 10.1.1, LTE connection Video: Progressively downloading a video. .mp4, 5mb, 4…
Levi
  • 51
  • 4