New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-13150] Added support for prepareAsync #4220
Conversation
@@ -181,19 +187,7 @@ public void play() | |||
initialize(); | |||
} | |||
|
|||
if (mp != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this part is deleted, the sound won't play again after the sound is paused or stopped. Please test with KS->Phone->Sound.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch, I missed testing the 'pause'. I will fix this
Based on the review feedback, fixed the issue with 'pause' |
|
||
private void startPlaying() | ||
{ | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the play() method, initialize() and startPlaying() are already in a try-catch block, so the try-catch here is not necessary. Just need to put startPlaying() in a try-catch block in the onPrepared() method.
Since you add an Async call to prepare the media player, the states of the player have to be set in the right place. Otherwise, it will mess up the other sync methods, like stop and pause. |
Ping's comments have been addressed. However the functional test fails. I'm using this test: After calling stop(), there is a pause and then the stream starts again. It's because of the prepare listener (stop() calls .prepare). |
The re-start problem is fixed. However, stop() is holding up the thread (like start() was in the original complaint.) After stopping, it calls .prepare rather than .prepareAsync even when the source is remote. The |
Added new pull request #4593 |
Added async support
https://jira.appcelerator.org/browse/TIMOB-13150