Android getsupportedvideosizes returns null on emulator

前端 未结 4 1430
轻奢々
轻奢々 2021-01-27 14:22

I have tried to get the supported video size as below in an emulator but it always return null.Why it is so?I have tried in 4.03.Thanks in advance

 Camera cam         


        
4条回答
  •  梦如初夏
    2021-01-27 15:10

    answered also here

    Sample code:

    public List getSupportedVideoSizes(Camera camera) {
        if (camera.getParameters().getSupportedVideoSizes() != null) {
            return camera.getParameters().getSupportedVideoSizes();
        } else {
            // Video sizes may be null, which indicates that all the supported
            // preview sizes are supported for video recording.
            return camera.getParameters().getSupportedPreviewSizes();
        }
    }
    

提交回复
热议问题