From bc28c36c82819f9bc96482b02cb32df1713f4bb4 Mon Sep 17 00:00:00 2001 From: Courville Software Date: Thu, 9 May 2024 19:37:45 +0200 Subject: [PATCH] PlayUtils: use mVideo.getFileUri() instead of getUri() to know if file is local otherwise content:// --- .../com/archos/mediacenter/video/utils/PlayUtils.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/archos/mediacenter/video/utils/PlayUtils.java b/src/main/java/com/archos/mediacenter/video/utils/PlayUtils.java index 3e834b6c..b76d477a 100644 --- a/src/main/java/com/archos/mediacenter/video/utils/PlayUtils.java +++ b/src/main/java/com/archos/mediacenter/video/utils/PlayUtils.java @@ -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(); } @@ -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()); } @@ -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); }