LuckSiege / LuckSiege/PictureSelector
使用系统播放器预览视频报错
- Dominant language
- Java
- Stars
- 13.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Current use version?
#### 当前使用的版本是多少?
```
v3.11.2
```
## Will this problem occur in demo?
#### Demo能否复现这问题?
```
能
```
## Describe the problem or provide an error log?
#### 描述问题或提供错误log?
```
1、调用setSandboxFileEngine设置UriToFileTransformEngine,使用系统播放器isUseSystemVideoPlayer(true)
2、选择视频文件
3、在表格里点击视频,进入预览,崩溃报错
FATAL EXCEPTION: main
Process: com.luck.pictureselector, PID: 31418
android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.luck.pictureselector/files/Movies/VID_20240107193248330.mp4 exposed beyond app through Intent.getData()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:2208)
at android.net.Uri.checkFileUriExposed(Uri.java:2407)
at android.content.Intent.prepareToLeaveProcess(Intent.java:11917)
at android.content.Intent.prepareToLeaveProcess(Intent.java:11859)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1826)
at android.app.Activity.startActivityForResult(Activity.java:5580)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:588)
at android.app.Activity.startActivityForResult(Activity.java:5533)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:574)
at android.app.Activity.startActivity(Activity.java:6036)
at android.app.Activity.startActivity(Activity.java:6003)
at com.luck.picture.lib.utils.IntentUtils.startSystemPlayerVideo(IntentUtils.java:33)
at com.luck.picture.lib.adapter.holder.PreviewVideoHolder.startPlay(PreviewVideoHolder.java:204)
at com.luck.picture.lib.adapter.holder.PreviewVideoHolder$3.onClick(PreviewVideoHolder.java:112)
at android.view.View.performClick(View.java:7570)
at android.view.View.performClickInternal(View.java:7540)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29710)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.app.ActivityThread.main(ActivityThread.java:8423)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the failing demo configuration and inspect IntentUtils.java at line 33, then follow the call from PreviewVideoHolder.java at line 204. Reproduce the crash when selecting a video for system-player preview; done means the preview opens without the reported FileUriExposedException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100