Skip to content

Commit

Permalink
Use native video entity method for checking if a video is local or not
Browse files Browse the repository at this point in the history
  • Loading branch information
melonmanchan committed Apr 26, 2016
1 parent 72dccdf commit 4d065cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,8 @@ public void prepare(Video video, AnnotationEditor annotationEditor) {
orientationPatcher.updateOrientation(video);
orientationPatcher.setView(videoSurface);

System.out.println(URLUtil.isFileUrl(videoUri.toString()));

// Seems as if the DefaultUriDataSource cannot correctly guess a local file URI, so just do it manually
if (URLUtil.isFileUrl(videoUri.toString()) == true) {
if (video.isLocal()) {
dataSource = new FileDataSource();
} else {
String userAgent = Util.getUserAgent(getActivity(), "ACHSO");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ protected Video readVideoFromFile(File file) throws IOException {
video.setLastModified(new Date(file.lastModified()));
video.setRepository(this);

Uri videoUri = video.getVideoUri();

// Sanity test to check if user deleted video file from gallery
// Missing thumb nail icon is fine, since you can still watch the local video
if (URLUtil.isFileUrl(videoUri.toString())) {
if (video.isLocal()) {
Uri videoUri = video.getVideoUri();
File sanityCheckFile = new File(videoUri.getPath());

if (!sanityCheckFile.exists()) {
Expand Down

0 comments on commit 4d065cb

Please sign in to comment.