Why MediaExtractor getTrackCount returns 0 in android 4.4.2

自古美人都是妖i 提交于 2019-12-11 20:20:55

问题


I ran exactly the same code on:

  • Android 4.1.2
  • Android 4.2.2
  • Android 4.4.2.

It works well on 4.1.2 and 4.2.2, but NOT on 4.4.2.

The problem is MediaExtractor.getTrackCount returns 0 on 4.4.2 (while it returns the right number on other devices)

Any idea?

I am also facing the very same issue. Did you got the solution ?


回答1:


I finally figured out where the problem is. For 4.4.2, u got to add permission in the AndroidManifest.xml about write external storage if you play local file. here is the code



来源:https://stackoverflow.com/questions/27127046/why-mediaextractor-gettrackcount-returns-0-in-android-4-4-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!