Skip to content

ionic-team/capacitor-file-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

capacitor-file-viewer

Logo

@capacitor/file-viewer

The FileViewer API provides mechanisms for opening files and previewing media. Not available on web.
🔌 Cordova Plugin · 🤖 Android Library · 🍏 iOS Library

🐛 Report Bug · 💡 Request Feature

Install

npm install @capacitor/file-viewer
npx cap sync

Example

import { FileViewer } from "@capacitor/file-viewer";

// can use a plugin like @capacitor/filesystem to get the full path to the file
const openDocument = async () => {
  await FileViewer.openDocumentFromLocalPath({
    path: "path/to/file.pdf"
  });
};

// ios-specific
const previewMedia = async () => {
  await FileViewer.previewMediaContentFromUrl({
    path: "https://url_hosting_media/file.mp4"
  });
}

API

Check the plugin's api here.

About

File Viewer plugin for Capacitor ⚡️

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published