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-13704] Android: Added setTime() method to android/modules/media/src/java/ti/modules/tita... #4219
[TIMOB-13704] Android: Added setTime() method to android/modules/media/src/java/ti/modules/tita... #4219
Conversation
…itanium/media/AudioPlayerProxy.java
Hi Sheran, |
Hey there, Ok, I understand what you mean. The thing is, I compiled and ran the SDK and this worked for me; no crashes. It may be likely that because I added the propertyAccessor it worked. My modified SDK is working fine for my app and I will continue to use it. I submitted the pull request in the hopes of having it tested and possibly giving back to the community. Thanks for following up with this and getting back to me. |
He Sheran, |
Adding the Kroll.setProperty does not crash the build. It would just overwrite the setter. However, it probably isn't necessary like @hieupham007 said since it's handled inside propertyChanged of TiSound. Anyways, I tested the PR, and the setTime() method isn't working as expected. It doesn't seem to skip to a particular time in the stream. For me, it just always starts off from the beginning. |
Hmm, ok. Not sure why this happens to you guys. Just before writing this, I used my modified SDK and tried again and it works fine. I have not tested playback from a local source, but I've tried streaming and it works. Here's the code I use: function doPlay(e) {
audioPlayer.addEventListener('change', handleChange);
audioPlayer.url = "http://tenminutepodcast.com/Audio/BitKillerJones.mp3";
audioPlayer.setTime(55000);
audioPlayer.start();
} This is in my alloy.js var audioPlayer = Ti.Media.createAudioPlayer({
allowBackground: true
}); As I said before, I'm happy with the results I have so far. I didn't know that adding the property into the propertyAccessor automagically created the getter and setter, so I will remove my explicit setter and test it as well. Thanks for letting me know about that. |
Ok, just tested it with the new test case and it works great. If you could remove the setTime() method, I would be happy to merge in this PR. |
@ayeung I've removed the setTime() method now. Sorry, didn't see your message earlier. |
Code reviewed and functionally tested. Request accepted |
[TIMOB-13704] Android: Added setTime() method to android/modules/media/src/java/ti/modules/tita...
This is my contribution to adding a setTime() method to AudioPlayer. Corresponding JIRA ticket is https://jira.appcelerator.org/browse/TIMOB-13704