StreamingKit
StreamingKit copied to clipboard
clearQueue is called twice after calling playURL
I have noticed that when I start the player via playURL: and immediately add content with queueURL, the player will sometimes clear the content in the queue unexpectedly.
I have tracked this down to the fact that the [self clearQueue] method is called twice - once synchronously within the setDataSource:withQueueItemId: method (which is expected because it is called from within playURL:) and once again from within [self setCurrentlyReadingEntry: andStartPlaying:], which by default clears the queue again. I suspect that this second clearing of the queue is unintentional, and if I make the following code change, I get the expected behavior that the queue is not cleared after the initial time:
Change from
-(void) setCurrentlyReadingEntry:(STKQueueEntry*)entry andStartPlaying:(BOOL)startPlaying
{
[self setCurrentlyReadingEntry:entry andStartPlaying:startPlaying clearQueue:YES];
}
to
-(void) setCurrentlyReadingEntry:(STKQueueEntry*)entry andStartPlaying:(BOOL)startPlaying
{
[self setCurrentlyReadingEntry:entry andStartPlaying:startPlaying clearQueue:NO];
}
I suspect this is a bug. Thanks for taking a look at this.
Hi, In this func is it playing twice ? Your code is fixed above ?
Hi - with the setCurrentlyReadingEntry in its first form above, the first queue item gets cleared before it can play completely which I believe is a bug. In the second form, which is what I believe is correct, the first queue item plays completely.