Skip to content
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-24082 Android: TiSound MediaPlayer.setDataSource error #8607

Closed
wants to merge 1 commit into from

Conversation

frankieandone
Copy link
Contributor

JIRA: https://jira.appcelerator.org/browse/TIMOB-24082

AssetFileDescriptor gives wrong startOffset value which causes media player to crash on Android 4.4.2 device

@@ -104,7 +104,7 @@ protected void initializeAndPlay()
}
// Why mp.setDataSource(afd) doesn't work is a problem for another day.
// http://groups.google.com/group/android-developers/browse_thread/thread/225c4c150be92416
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset()+1, afd.getLength());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue seems specific to 4.4.2, you should encapsulate your solution to that version. Also, what is the value of getStartOffset() and why does it need +1 to work? Try with a few more audio files, see if you can reproduce the issue again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants