avqueueplayer

Getting metadata from an audio stream

可紊 提交于 2019-12-03 03:20:01
问题 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 metadata can I put metadata in my NSURL* before passing it to the AVPlayerItem? Thanks. 回答1: Well I am surprised no one has answered this question. In fact no one has answered any of my other questions. Makes me wonder how much knowledge people in here

Getting metadata from an audio stream

可紊 提交于 2019-12-02 16:51:59
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 metadata can I put metadata in my NSURL* before passing it to the AVPlayerItem? Thanks. Well I am surprised no one has answered this question. In fact no one has answered any of my other questions. Makes me wonder how much knowledge people in here truly have. Anyways, I will go ahead and answer my own question. I found out how to get the metadata by

'An AVPlayerItem cannot be associated with more than one instance of AVPlayer'

守給你的承諾、 提交于 2019-12-02 05:12:02
问题 I know this question is all over Stack Overflow but still, most of them are old and not related with what I'm going to ask here. So I've got an array with AVPlayerItems and an AVQueuePlayer . At first I set the AVQueuePlayer to play the array items: func mediaPicker(mediaPicker: MPMediaPickerController!, didPickMediaItems mediaItemCollection: MPMediaItemCollection!) { mediaItems = mediaItemCollection.items for thisItem in mediaItems as [MPMediaItem] { var itemUrl = thisItem.valueForProperty

Replay items in AVQueuePlayer after last

杀马特。学长 韩版系。学妹 提交于 2019-11-30 19:13:25
I need to create something like an infinite loop in my AVQueuePlayer . Especially, I want to replay the whole NSArray of AVPlayerItem s once the last component finishes playing. I must admit that I actually do not have any idea how to achieve this and hope you can give me some clues. best way to loop a sequence of videos in AVQueuePlayer. observe for each playeritem in AVQueuePlayer. queuePlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone; for(AVPlayerItem *item in items) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(nextVideo:) name

Better way to do skip to previous with AVQueuePlayer?

不羁岁月 提交于 2019-11-30 04:58:01
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 previous I am removing all items and adding them back in with the previous video up front, this is really slow when skipping to previous multiple times. How can I make this faster just like calling advanceToNextItem ? My code looks like this: func skipToPrevious() { queuePlayer.removeAllItems() // move the previous playerItem to the front of the list then

Replay items in AVQueuePlayer after last

拜拜、爱过 提交于 2019-11-30 04:02:35
问题 I need to create something like an infinite loop in my AVQueuePlayer . Especially, I want to replay the whole NSArray of AVPlayerItem s once the last component finishes playing. I must admit that I actually do not have any idea how to achieve this and hope you can give me some clues. 回答1: best way to loop a sequence of videos in AVQueuePlayer. observe for each playeritem in AVQueuePlayer. queuePlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone; for(AVPlayerItem *item in items) { [

AVPlayer “freezes” the app at the start of buffering an audio stream

梦想与她 提交于 2019-11-28 15:47:52
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 add another one to the queue, AVQueuePlayer automatically starts preloading the song while it is still streaming the first one. This makes the app not respond to touches on the UI for two seconds just like when adding the first song but the song is still playing. So that means AVQueuePlayer is doing something in main thread that is causing the

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

。_饼干妹妹 提交于 2019-11-27 02:45:48
问题 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 already playing. Skipping to next Item is no problem with the advanceToNextItem provided by AVQueuePlayer, but there is nothing alike for skipping back or playing a certainitem from the queue. So I am not quite sure what would be the best approach

AVQueuePlayer playback without gap and freeze

雨燕双飞 提交于 2019-11-27 01:40:53
问题 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 AVQueuePlayer loads some initial part of each AVPlayerItem before starting playback. It causes frustrating freeze and application doesn't respond for some seconds. There is possibility to add only first AVPLayerItem to player's queue, observe its