@capgo/capgo-skills
Version:
55 agent skills for Capacitor mobile development
28 lines (18 loc) • 667 B
Markdown
Open files and preview media on mobile devices.
**Platforms:** Android, iOS (no Web)
```bash
npm install @capacitor/file-viewer
npx cap sync
```
```typescript
import { FileViewer } from '@capacitor/file-viewer';
await FileViewer.openDocumentFromLocalPath({ path: 'path/to/file.pdf' });
await FileViewer.openDocumentFromUrl({ url: 'https://example.com/document.pdf' });
await FileViewer.previewMediaContentFromUrl({ url: 'https://example.com/video.mp4' });
```
- Media preview methods (`previewMediaContentFromUrl`, etc.) are iOS-only. On Android, they fall back to standard document opening.
- No Web support.