Skip to content

Commit

Permalink
PlayUtils: use mVideo.getFileUri() instead of getUri() to know if fil…
Browse files Browse the repository at this point in the history
…e is local otherwise content://
  • Loading branch information
courville committed May 9, 2024
1 parent 794e023 commit bc28c36
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,19 @@ private void startPlayer(Context context,
}else {
if (resume == PlayerService.RESUME_NO)
resumePosition = 0;
log.debug("startPlayer: send onResumeReady");
onResumeReady(context, mVideo, mimeType, resume, legacyPlayer, resumePosition, externalPlayerWithResultStarter, playlistId);
}
}

public void requestVideoDb() {
log.debug("requestVideoDb: list subtitles");
if (FileUtils.isLocal(mVideo.getUri())) {
log.debug("requestVideoDb: list subtitles for " + mVideo.getFileUri());
if (FileUtils.isLocal(mVideo.getFileUri())) {
// provide local list of subs
log.debug("requestVideoDb: local list of subs");
listOfSubtitles = SubtitleManager.getListOfLocalSubs();
} else {
log.debug("requestVideoDb: remote prefetched list of subs");
// provide prefetched list of subs for remote shares
listOfSubtitles = SubtitleManager.getPreFetchedListOfSubs();
}
Expand Down Expand Up @@ -233,6 +236,7 @@ public void onNoSubtitlesFound(Uri uri) {
requestVideoDb();
}
});
log.debug("prepareSubs: launch preFetchHTTPSubtitlesAndPrepareUpnpSubs " + mVideo.getFileUri() + " -> " + mVideo.getFileUri());
// this copies subs locally to /storage/emulated/0/Android/data/org.courville.nova/cache/subtitles/
subtitleManager.preFetchHTTPSubtitlesAndPrepareUpnpSubs(mVideo.getFileUri(), mVideo.getFileUri());
}
Expand All @@ -256,6 +260,7 @@ else if (mResume == PlayerService.RESUME_FROM_LAST_POS) {
}
}
}
log.debug("onVideoDb: send onResumeReady");
onResumeReady(mContext, mVideo, mMimeType,
mResume, mLegacyPlayer, resumePos, mExternalPlayerWithResultStarter, mPlaylistId);
}
Expand Down

0 comments on commit bc28c36

Please sign in to comment.