ios8 - AVQueuePlayer not advancing to next item in iOS 8 -



ios8 - AVQueuePlayer not advancing to next item in iOS 8 -

i using avqueueplayer play few videos, works fine in ios 6 & 7. however, in ios 8, when current avplayeritem finishes playing next video not play. placing observer on queue's currentitem property shows the queue has next video set current item expected, not play (even explicit play calls).

does have insight might happening , how prepare it? has else come across issue?

i had same issue , wasted 10 hours on this... fixed adding "insertitem" method main thread. have player property :

@property avqueueplayer * player;

i init :

_player = [[avqueueplayer alloc] init];

and here method add together items path :

- (void)addinqueueplayerfile:(nsstring *)path { avasset * asset = [avasset assetwithurl:[[nsurl alloc] initfileurlwithpath:path]]; avplayeritem * playeritem = [avplayeritem playeritemwithasset:asset]; dispatch_async(dispatch_get_main_queue(), ^{ [_player insertitem:playeritem afteritem:nil]; }); }

so working don't understand why... if has answer...

but if doesn't work you, seek add together observer player (and/or playeritem). can add together observer :

[_player addobserver:self forkeypath:@"status" options:0 context:nil]

and grab method :

- (void)observevalueforkeypath:(nsstring *)keypath ofobject:(id)object change:(nsdictionary *)change context:(void *)context { if (object == _player && [keypath isequaltostring:@"status"]) { if (_player.status == avplayerstatusfailed) { nslog(@"avplayer failed"); } else if (_player.status == avplayerstatusreadytoplay) { nslog(@"avplayer item ready play"); } else if (_player.status == avplayerstatusunknown) { nslog(@"avplayer item unknown"); } } }

let me know if work you.

ios ios8 xcode6 avplayer avqueueplayer

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -