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

AVPlayer rate property is inaccurate

Any idea why the playback tempo of audio files via an AVQueuePlayer is not an accurate product of the original audio file's tempo and the AVPlayers rate property? e.g. the original tempo is 100 b.p.m. and I set the rate to 0.7, expecting an output…
AcmeCat
  • 212
  • 2
  • 12
2
votes
1 answer

NSNotificationCenter to AVQueuePlayer in swift

I added list of AVQueuePlayer to UITableViewCell. I added array of videos to AVQueuePlayer as follows: if let urls = delegate.arrayVideofeedItemsList[indexPath.row] as? NSArray { let player = AVQueuePlayer() …
rani
  • 593
  • 3
  • 10
  • 28
2
votes
0 answers

AVQueuePlayer current item is null after the last item playback is complete

I am using AVQueue Player to enqueue hls streams. After the last stream has been played, the currentItem seems to be null : NULL==avPlayerInstance.currentItem returns true. However, I want the last item to stay in the queue player, since I want to…
basum
  • 319
  • 1
  • 3
  • 18
2
votes
0 answers

AVQueuePlayer rate changes to 0 prior to handling AVAudioSessionInterruptionNotification

In an app I have a player object that has an AVQueuePlayer property to play audio files. In my player object I have all the code necessary to handle AVAudioSessionInterruptionNotification as below: - (void)p_audioSessionInterruption:(NSNotification…
ozzotto
  • 1,146
  • 3
  • 13
  • 30
2
votes
1 answer

AVQueuePlayer - keep active while item is being buffered

Is it possible to keep the AVQueuePlayer active while a remote AVPlayerItem is being buffered? Currently, when item goes into buffering, playback stops and all info set by MPNowPlayingInfoCenter is removed - lock screen, command center, external…
Armands L.
  • 1,885
  • 2
  • 14
  • 18
2
votes
0 answers

How to play youtube Videos continuously like a playlist?

We are able to play youtube videos by fetching the data using Youtube API for iOS Application. We would like to play a set of videos continuously like a playlist. Can someone guide us through this issue. we tried using different players but none of…
2
votes
2 answers

AVQueuePlayer video is not working in Swift

I am currently trying to implement advertisement with video in Swift. I tried to use AVPlayerViewController and AVQueuePlayer. However AVQueuePlayer is not playing the videos after first one finishes. Here is my code: override func viewDidLoad()…
ridvankucuk
  • 2,407
  • 1
  • 23
  • 41
2
votes
2 answers

Play nth item of AVQueuePlayer

I have an instance of AVQueuePlayer and I've initialised it with a collection of videos using AVPlayerItem (let's say I have 10 items), On a button event, I need to play the item of nth index from the collection. I've used -…
Pradeep Singh
  • 752
  • 1
  • 10
  • 23
2
votes
0 answers

AVPlayer or AVQueuePlayer during iPhone Call

I have an app that uses AVPlayer (or AVQueuePLayer) to play local files that were recorded by the App. All works great. But I also want this to work on iPhone when a call is in progress (the videos are event recordings). What I found is that…
2
votes
2 answers

Possible to insert item at top of queue using AVQueuePlayer?

Assuming the queue has already been initialized, the only method I see to add items into the queue is: - (void)insertItem:(AVPlayerItem *)item afterItem:(AVPlayerItem *)afterItem The documentation says Pass nil to append the item to the queue. So…
Oren
  • 5,055
  • 3
  • 34
  • 52
2
votes
0 answers

AVQueuePlayer removeAllItems Crash

I have problem with removeAllItems on AVQueuePlayer. I using AVQueuePlayer for playing music from the web. For playing next song, in this class we have method advanceToNextItem. But for previous we should create new queue. Why that I do it so: -…
Yevgen THD
  • 169
  • 1
  • 10
2
votes
1 answer

how to use AVQueuePlayer in AVPlayer

currently i am using following codes to play song playerItem = [AVPlayerItem playerItemWithURL:[song valueForProperty:MPMediaItemPropertyAssetURL]]; [_avPlayer replaceCurrentItemWithPlayerItem:playerItem]; here i am using AVPlayer for playing…
abymathew
  • 115
  • 1
  • 1
  • 11
2
votes
0 answers

is it possible to have level metering in AVQueuePlayer on iOS?

Using AVAudioPlayer I can get the volume in RMS or peak by calling peakPowerForChannel; unluckly I have an implementation using AVQueuePlayer, because the app need to continue playing in background. is it possible to have level metering in…
Stone Alessandro
  • 359
  • 3
  • 14
2
votes
1 answer

How to load the next file while current one is playing through HTTP Live Streaming?

I'm working on an app in which I need to stream a large collection of audio files ranging from 5 to 15 seconds each. I would like to reduce the load time between the files as much as possible. Main Question: Is there a way to start buffering the…
Nelu
  • 16,644
  • 10
  • 80
  • 88
2
votes
0 answers

How to display (the official way) custom art in the lock screen while app is running

I've heard folks say that Apple will not allow doing things like this: How to set lock screen , wallpaper and Ringtone programmatically in iPhone? I wonder however, if there is an official way of doing this. If not, or how are music apps like Songza…
MrShoot
  • 843
  • 1
  • 9
  • 21