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

AVPlayer "freezes" the app at the start of buffering an audio stream

I am using a subclass of AVQueuePlayer and when I add new AVPlayerItem with a streaming URL the app freezes for about a second or two. By freezing I mean that it doesn't respond to touches on the UI. Also, if I have a song playing already and then…
raixer
  • 1,844
  • 3
  • 15
  • 16
21
votes
6 answers

Better way to do skip to previous with AVQueuePlayer?

I am using an AVQueuePlayer in my app. I have a two swipe gestures to skip to next and skip to previous avplayeritems. Right now to do skip to next I am just calling advanceToNextItem on the avqueueplayer which works well. However the skip to…
Tyler
  • 2,346
  • 6
  • 33
  • 59
16
votes
8 answers

Skip to Previous AVPlayerItem on AVQueuePlayer / Play selected Item from queue

I am playing a Tv-show that has been sliced to different chapters on my project using an AVQueuePlayer. I also want to offer the possibility to skip to the previous/next chapter or to select a different chapter on the fly, while the AVQueuePlayer is…
Amandir
  • 679
  • 1
  • 7
  • 20
13
votes
2 answers

Getting metadata from an audio stream

I would like to get the file name and, if possible, album image from a streaming URL in a AVPlayerItem that I am playing with AVQueuePlayer but I don't know how to go about doing this. Also if it turns out that my streaming URL doesn't have any…
raixer
  • 1,844
  • 3
  • 15
  • 16
13
votes
3 answers

How to add transition between videos when using AVQueuePlayer?

I am working on a video application that plays a number of videos one after another. The videos are stored in an array of AVPlayerItems. AVQueuePlayer is initialized with those AVPlayerItems and it automatically plays the videos from that array. The…
Parvez Belim
  • 1,003
  • 13
  • 36
11
votes
1 answer

MPNowPlayingInfoCenter AVPlayer on iOS 7

I'm making an app that streams music. I'm trying to display metadata (title, artist and artwork image) on the lock screen. MPNowPlayingInfoCenter seems to work well with MediaPlayer.framework, but I can't figure to make it work with AVPlayer on iOS…
Rémy Virin
  • 3,379
  • 23
  • 42
11
votes
3 answers

AVQueuePlayer playback without gap and freeze

I use AVQueuePlayer to play a sequence of movies which are loaded from URLs. I tried to initialize player instance with array of all AVPlayerItems that I need to play. player = [[AVQueuePlayer queuePlayerWithItems:playerItemsArray] But in this case…
yury.ku
  • 1,188
  • 1
  • 10
  • 19
8
votes
2 answers

MPNowPlayingInfoCenter stopped updating the progress bar

I am making an app that has a music player in it. I haven't worked on it in a while but the last time I worked on it the nowPlayingInfo was working. Now, when I updated it to Swift 3, everything works except for the progress bar. I have seen a few…
lagoon
  • 6,417
  • 6
  • 23
  • 30
8
votes
1 answer

Pre-load an AVPlayer streaming video

I'm trying to play a streaming video with a AVPlayer without any network delay. Fortunately, our app has a progress screen before the screen that plays the video. I'm hoping to use some of the time on this progress screen to pre-load the video so it…
Paul Cezanne
  • 8,629
  • 7
  • 59
  • 90
8
votes
1 answer

How to get a callback from AVQueuePlayer/AVPlayerItem when network become active (and is ready to play)?

I have a AVQueuePlayer based audio streaming player that needs to run in the background. The player needs to continue running until it finishes playing all the list. Of course it is going to have to pause if the network connection becomes bad, but…
barley
  • 4,403
  • 25
  • 28
7
votes
1 answer

AVQueuePlayer/AVPlayer loading notification?

I have an AVQueuePlayer (which obviously extends AVPlayer) that loads a playlist of streaming audio. Streaming is all working fine, but I'd like to have an activity indicator to show the user audio is loading. Trouble is, I can't seem to find any…
Keller
  • 17,051
  • 8
  • 55
  • 72
7
votes
5 answers

Replay items in AVQueuePlayer after last

I need to create something like an infinite loop in my AVQueuePlayer. Especially, I want to replay the whole NSArray of AVPlayerItems once the last component finishes playing. I must admit that I actually do not have any idea how to achieve this…
Edelweiss
  • 621
  • 1
  • 9
  • 24
7
votes
2 answers

Gapless playback with AVQueuePlayer/AVPlayer - is it possible?

I've been playing around with the AVPlayer and its subclass AVQueuePlayer (and an array of MPMediaItems) and have found that the latter performs better with gapless albums, but neither seem to fully achieve the task. There is a very noticeable pause…
sooper
  • 5,991
  • 6
  • 40
  • 65
6
votes
0 answers

AVPlayerLooper Hiccup / Video Looping Bug

The Problem I am using an AVPlayerLooper to replay an HTTP Live Streaming video indefinitely. The video replays perfectly for the first three loops. But on the fourth loop and all loops thereafter, the video "hiccups." In other words, when the video…
josephap
  • 2,075
  • 17
  • 24
6
votes
2 answers

Annoying lag when AVQueuePlayer jumps from asset to another

I have an AVQueuePlayer that is supposed to play sequentially an array of AVURLAsset representing consecutive fragments of one continuous video. Whenever a fragment ends and another starts, there is a small glitch that can be well noticed (frame…
Joe
  • 2,386
  • 1
  • 22
  • 33
1
2 3
13 14