绝对路径已经不推荐在Android10 上使用了,如何兼容Android10的文件系统?
类似的问题链接如下: https://stackoverflow.com/questions/58479616/ffmpeg-command-is-not-working-in-android-q
https://stackoverflow.com/questions/57445600/ffmpeg-seeking-not-possible-with-file-descriptor-on-android-q
你试过在Android 10上运行吗
你试过在Android 10上运行吗
没有,因为无法测试. /** * Absolute filesystem path to the media item on disk. *
* Note that apps may not have filesystem permissions to directly access * this path. Instead of trying to open this path directly, apps should * use {@link ContentResolver#openFileDescriptor(Uri, String)} to gain * access. * * @deprecated Apps may not have filesystem permissions to directly * access this path. Instead of trying to open this path * directly, apps should use * {@link ContentResolver#openFileDescriptor(Uri, String)} * to gain access. */ @Deprecated @Column(Cursor.FIELD_TYPE_STRING) public static final String DATA = "_data";
_data 已经标记为过时了,在Android10 上无法获取绝对路径.
暂时能想到的就是copy文件到私有目录,然后运行,但是如果视频较大也不是好办法
还有什么解决方案?