MediaRecorder start called in invalid state: 4

前端 未结 4 1479
孤街浪徒
孤街浪徒 2021-01-28 02:04

I\'ve just started getting into android/Glass development and I was trying to add basic video recording functionality. Currently Glass limits you to 10 seconds unless you tap/p

4条回答
  •  温柔的废话
    2021-01-28 02:28

    I ran into the same issue on some Android devices. I was using Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES) as the output for the MediaRecorder instance. After reading is3av's answer, I changed the output path to Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) and the problem is solved.

    Seems like some phones don't allow files to be written to Environment.DIRECTORY_MOVIES path or that path doesn't exist.

提交回复
热议问题