-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed a timing issue when replacing the queue with a new video.
all operations that modify the queue are asynchronous, and accept a callback function (ie: Runnable). previously, no callbacks were used. the queue was cleared and a new item was immediately added. this usually worked, but it's a race condition; sometimes the new video wouldn't appear. this commit changes the order of operations, and adds a callback. 1) new video is added to end of existing queue 2) wait for callback 3) clear all elements in queue EXCEPT the last video result: works great. no race condition. new video always loads.
- Loading branch information
1 parent
b557add
commit fe3363e
Showing
2 changed files
with
108 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters