mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Ensure the demo app requests local-file permissions for subtitle files
Currently we only do this for the main sample URI, not for subtitles. So pairing a web-based video file with a local subtitle file on a fresh install just throws a 'permission denied' exception. PiperOrigin-RevId: 290794091
This commit is contained in:
parent
e7cdd16407
commit
d64388a075
1 changed files with 5 additions and 0 deletions
|
|
@ -436,6 +436,11 @@ public class PlayerActivity extends AppCompatActivity
|
|||
}
|
||||
Sample.SubtitleInfo subtitleInfo = sample.subtitleInfo;
|
||||
if (subtitleInfo != null) {
|
||||
if (Util.maybeRequestReadExternalStoragePermission(
|
||||
/* activity= */ this, subtitleInfo.uri)) {
|
||||
// The player will be reinitialized if the permission is granted.
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Format subtitleFormat =
|
||||
Format.createTextSampleFormat(
|
||||
/* id= */ null,
|
||||
|
|
|
|||
Loading…
Reference in a new issue