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

iOS AVQueuePlayer flickering when playing videos with different aspect ratios

I am using AVQueuePlayer to play several videos in a sequence. Everything works fine until there are videos with different aspect ratio. When the next AVPlayerItem starts - the previous item stretches too early and one can see an ugly distortion…
frangulyan
  • 3,580
  • 4
  • 36
  • 64
1
vote
0 answers

How does Snapchat & Instagram Stories handle skipping back and forth between clips?

As the title states, what is used to allow for the videos to seamlessly skip both back and forwards? I've attempted using AVPlayer with an Array of AVPlayerItems and manually swapping the current video, and I've used AVQueuePlayer and rebuilding…
1
vote
2 answers

Loading AVURLAsset asynchronously in AVQueuePlayer disturbing the order - iOS

I need to play some audios in a row, and therefore using AVQueuePlayer for that purpose. I'm loading audios in it as : for (NSInteger i = row ; i<_messagesArray.count ; i++) { _urlString =…
Hyder
  • 1,163
  • 2
  • 13
  • 37
1
vote
0 answers

TvOS AVQueuePlayer buffering issue

I have a TvOS app that plays music with an AVQueuePlayer (the songs are stored on a remote server). Usually, the songs play smoothly for several hours in a row. Sometimes, it lags for a very brief moment and continues playing. But some other times,…
Raphael Royer-Rivard
  • 2,252
  • 1
  • 30
  • 53
1
vote
2 answers

Play/Pause/Stop multiple audio file which are stored locally

I have 20 audio tracks, which are stored locally in my project. I want to play all that files sequentially . For that I have used AVQueuePlayer. Please check below code for reference. Declaration :- @interface ViewController () { AVAudioPlayer…
iGatiTech
  • 2,306
  • 1
  • 21
  • 45
1
vote
0 answers

AVQueuePlayer - using slider to control all audio tracks at once

I have multiple audio files that I want to play continuously and be able to control it with UISlider. I was using AVAudioPlayer but there was problem with gaps between each tracks. So I found AVQueuePlayer and now there are no gaps. But now I have…
Libor Zapletal
  • 13,752
  • 20
  • 95
  • 182
1
vote
0 answers

AVQueuePlayer gapless playback

I am trying to dynamically add .aac chunks (usually 10 seconds) during the playback to AVQueuePlayer to mimic the AVPlayer hls playback. However it plays songs one after another as I wished, there is about 200ms to 400 ms gap between…
Mord Fustang
  • 1,523
  • 4
  • 40
  • 71
1
vote
1 answer

AVFoundation play consecutive video fragments

I am working on an iOS app that involves fetching video fragments that are part of a stream from a web server and playing them consecutively inside the app. After some research, I decided to use an AVQueuePlayer. Every time I fetch an MP4 file from…
Joe
  • 2,386
  • 1
  • 22
  • 33
1
vote
1 answer

Audio Visualizer with AVQueuePlayer

I'm trying to build a Audio Visualizer when playing from the AVQueuePlayer, I want something similar to this but AVQueuePlayer does not have some of the methods required like [audioPlayer updateMeters], [audioPlayer numberOfChannels] and…
1
vote
0 answers

Playing still images as a video in AVQueuePlayer

I want to play a sequence of videos and images (like Snapchat does). By playing an image I mean having it show on the screen for a certain amount of time. I am using AVFoundation for media capture and playback, and I am using swift to develop this…
Anthony Silva
  • 195
  • 1
  • 14
1
vote
0 answers

CFunctionPointer in Xcode 6.1

Is CFunctionPointer supported in Xcode6?I am trying to run following code class Queue { var desc : AudioStreamBasicDescription var queue : AudioQueue? init(){} func audioQueueHandleBuffer(ctx : UnsafeMutablePointer<()>, inAQ…
codester
  • 36,891
  • 10
  • 74
  • 72
1
vote
2 answers

AVQueuePlayer unable to play local MP3 files

I'm currently writing an iOS app that allows users to stream music from soundcloud. Currently I am able to stream just fine from Soundcloud, in booth forefront and background app states. I have an issue when I download an MP3 files and attempt to…
1
vote
0 answers

Controlling current AVQueuePlayer item in background

I'm working on a walking tour that uses iBeacons and geofences. I'm trying to allow my users to plug in their headphones, close the app and get audio updates as they walk around. I have the basics of this down and can trigger audio when the app is…
nwales
  • 3,521
  • 2
  • 25
  • 47
1
vote
0 answers

Why is AVQueuePlayer able to initiate audio stream from url in background while AVPlayer cannot?

I've been testing background audio on ios triggered by location updates (iBeacons). I noticed that if I want to initiate an audio stream when my app is backgrounded it only works if I am using and instance of AVQueuePlayer. If the file is local I…
nwales
  • 3,521
  • 2
  • 25
  • 47
1
vote
2 answers

Starting AVQueuePlayer from background

Can't make AVQueuePlayer start playing sound queue when it's starting after the app went into the background. The basic question is: how to start sound from newly created AVQueuePlayer instance from background? It's for navi-like app that need to…
Jacek Kwiecień
  • 12,397
  • 20
  • 85
  • 157