3 Replies Latest reply on Feb 5, 2014 9:19 PM by Kutir Mobility

    How to open mp4 files from SD card?

      Hi,

      i have an application which downloads PDFs and mp4 files and stores them on the SD card. the application allows users to view these files.

      i am using "System.open_url" to open the files. Only PDF files are opened and viewed; when an attempt is made to open a mp4 file the following error message comes up:

      The document cannot be opened because it is not a valid PDF document
      

       

      the error message suggests that for mp4 files, the default PDF application is being launched. the System.open_url is being passed the file location as follows:

      System.open_url("/sdcard/MyFolder/pdf_file.pdf")   #This works and PDF file opens up
      System.open_url("/sdcard/MyFolder/mp4_file.mp4")   #This fails with error "The document cannot be opened because it is not a valid PDF document
      

       

      the mp4 files can be opened successfully from outside the application by navigating to the file location using the My FIles explorer.

      the above issue occurs when running the application on an Android device. One thing that seems odd here is that the app also have some mp4 files under "/public/media" folder, which open and play without any issue.

       

      Thanks.