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
0
votes
1 answer

How can I set offset of a video in Swift 4 ? Seek(to:) doesn't seem to work

I am having an issue setting offset of AVQueuePlayer video. I have tried seek(to function to set offset of the video but it doesn't seem to work. The video always starts from 0 Seconds. Other requirements are playing it with control and looping back…
Arsalan Haider
  • 559
  • 3
  • 9
  • 23
0
votes
1 answer

AVKit – Video clips loop just 2 times

I have got four video clips and I want to play them endlessly. But my AVQueuePlayer() loops all the videos just 2 times and then stops. How to make them play endlessly? Here's my code: import UIKit import AVKit class ViewController:…
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
0
votes
1 answer

Prevent cordova-plugin-playlist from buffering all tracks at once

I've been trying to solve this issue for a few weeks now. The issue revolves around a Cordova plugin called cordova-plugin-playlist that utilizes AVQueuePlayer. The issue is that when a large number of tracks (30+) are added, several of the tracks…
0
votes
1 answer

Swift: Replay video after finished playing in avqueueplayer

I want to play multiple videos one by one in my app in swift 4 and xcode 9. I can do this with avqueue player. But once the player is finished playing all videos then can not replay the player. Just a blank screen appears. Code: var selectedVideos…
Sarwar Jahan
  • 63
  • 10
0
votes
1 answer

iOS swift - Recording multiple video segments freezes on playback in AVQueuePlayer

Let me start by saying I have searched for an answer to this question for a long time and have read through many SO posts, but none have provided the answer I need I am attempting to record multiple video segments using multiple…
0
votes
2 answers

How to use AVQueuePlayer?

I want to play a set of video files from a remote server on iOS. I don’t want to use an HLS playlist. I am trying to use AVQueuePlayer. Here’s how I initialize it: let url = URL(string: "https://example.com/video.ts")! // 10 second video let item =…
adsalpha
  • 102
  • 2
  • 10
0
votes
0 answers

Issue with AVQueuePlayer and playerItemDidReachEnd

My app plays 8 videos (using AVPlayer) by tapping 8 buttons. When a video has finished playing the player is closed using the following code: -(void)playerItemDidReachEnd:(NSNotification *) notification { [self dismissViewControllerAnimated:YES…
Emily94
  • 75
  • 6
0
votes
1 answer

AVQueuePlayer SeekToTime

[queuePlayer seekToTime:CMTimeMake(time,1)]; While I take seekToTime, the audio does replay, not seek to the time. How to create CMTime para or you can tell me how to do all.
aaron
  • 1
0
votes
2 answers

How to set AVQuePlayer to the begining after it finishes playing all in Que

I have an AVQuePlayer that is downloading videos a user posts to firebase and then playing them in order via an AVQuePlayer. Everything works fine until the video que plays all vidoes, in which case, if you try and replay the que, a SIGABRT 1 error…
Chris
  • 387
  • 5
  • 18
0
votes
1 answer

Mac - Swift 3 - queuing audio files and playing

I would like to write an app in swift 3 in order to play queued audio files without any gap, crack or noise when passing from one to another. My first try was using AvAudioPlayer and AvAudioDelegate (AVAudioPlayer using array to queue audio files -…
Fredo
  • 153
  • 2
  • 13
0
votes
1 answer

AVQueuePlayer is taking lot of time to play first song

Below is my code to play AVQueueplayer with some web URL, but it takes almost 10-20 seconds to play first song. I have 10 songs, but for reference and to make it small, I have just kept one song here. arrSongs =…
Aks
  • 11
  • 1
  • 4
0
votes
1 answer

Playing AVPlayerItem CurrentTime in Seconds Return Inconsistent Values

I am retooling my audio player application to use AVQueuePlayer instead of AVAudioPlayer, as I now appreciate that I need to be able to queue up audio files for playback. Since AVQueuePlayer is a subclass of AVPlayer, which uses CMTime to keep track…
Gthoma2
  • 687
  • 1
  • 9
  • 22
0
votes
1 answer

AVPlayerViewController next/prev buttons don't work?

My code: AVQueuePlayer *player = ...; AVPlayerViewController *controller = [[AVPlayerViewController alloc] init]; [vc presentViewController:controller animated:YES completion:nil]; controller.player = player; …
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49
0
votes
1 answer

iOS - Can't use AVQueuePlayer initwithitems()

I want to create an array of AVPlayerItem objects from another array, by using the line in loop. It works for a single item but not for entire array. MPMediaQuery *albumQuery = [MPMediaQuery albumsQuery]; MPMediaPropertyPredicate *albumPredicate =…
Adam
  • 1,776
  • 1
  • 17
  • 28
0
votes
0 answers

Error about using AVQueuePlayer

I init a AVQueuePlayer like : AVPlayerItem *item1 = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:@"http://XXX.mp4"]]; AVPlayerItem *item2 = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:@"http://YYY.mp4"]]; AVQueuePlayer player =…