Download the PHP
package amjadiqbal/laravel-media-viewer without Composer
On this page you can find all versions of the php package
amjadiqbal/laravel-media-viewer. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor amjadiqbal Package laravel-media-viewer Short Description Show PDFs, video and audio from any Laravel disk without leaking private files: Blade and Livewire components with a pdf.js PDF viewer (page navigation, zoom, search, thumbnails), a Video.js player with HLS (hls.js), signed expiring URLs and Range-aware streaming. License
MIT Homepage https://github.com/amjadiqbal/laravel-media-viewer
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Informations about the package laravel-media-viewer
# Laravel Media Viewer: private PDF viewer and video player for Laravel
Show PDFs, video and audio stored on any Laravel disk, private ones included, without
making the files public. Blade and Livewire components give you a **pdf.js PDF viewer**
(page navigation, zoom, search, thumbnails) and a **Video.js player with HLS**, and every
file is served through a **signed, expiring URL** (bound to the user when someone is signed in)
with proper Range support.
[](https://packagist.org/packages/amjadiqbal/laravel-media-viewer)
[](https://packagist.org/packages/amjadiqbal/laravel-media-viewer)
[](LICENSE.md)
**Docs and demo:** [amjad.com.pk/laravel/packages/laravel-media-viewer](https://amjad.com.pk/laravel/packages/laravel-media-viewer)
## Why
Showing an uploaded file in Laravel usually means one of three compromises:
- **`storage:link` makes it public.** Anyone with the URL has the file, forever.
- **A plain download route breaks media.** Without Range requests, videos can't seek and
large PDFs load in full before the first page appears.
- **The browser's own PDF viewer differs everywhere.** It looks different in each browser,
ignores toolbar options in some, and behaves differently again on iOS.
This package fixes all three. Files stay on a private disk. The page gets a short-lived signed
URL; when a user is signed in, only that user can use it. The stream route answers Range requests correctly,
and the viewers are the same pdf.js and Video.js UI in every browser.
## Features
- **PDF viewer** (pdf.js 6.4.299): page navigation, zoom steps, page width or whole page, text
search with match count and highlighting, full screen, optional download button, keyboard
friendly, dark mode.
- **PDF thumbnails** for lists, rendered lazily as they scroll into view. Through Range
requests the browser fetches only what its page needs. In our test, page 1 of a 4.6 MB,
60-page PDF took 216 KB. (On a remote disk whose stream can't seek, such as S3 in `stream`
mode, the app still reads the file from the start up to the requested offset; use
`redirect` mode there, see [Delivery](#delivery-stream-or-redirect).)
- **Video and audio** (Video.js 10.1.0): `.mp4`, `.webm`, `.mov`, `.mp3`, `.m4a`, `.ogg`, `.wav`,
`.flac` and more, with seeking over Range requests.
- **HLS from a private disk**: `.m3u8` plays through Video.js's hls.js adapter. Playlists are
rewritten so every variant, segment, init map and key is a signed URL too.
- **Livewire**: the components work inside Livewire components and with `wire:navigate`, and
`` gives you a file list with thumbnails next to a viewer.
- **Security** (details in [Security model](#security-model)): disk and extension allow-lists,
signed and expiring URLs (bound to the signed-in user), an optional Gate checked on every request,
path-traversal protection, and Subresource Integrity for every pdf.js and Video.js file.
- Any disk: `local`, `public`, S3, R2 or anything else Flysystem supports. Optionally redirect
to the disk's own temporary URL to save your server's bandwidth.
## Requirements
- PHP 8.3+
- Laravel 12 or 13
- Livewire 3 or 4, only for the gallery component (tested with Livewire 4.4)
## Installation
That's all. There is nothing to build, and nothing to publish. The first viewer on a page
prints the small script and stylesheet it needs, and pdf.js and Video.js load from jsDelivr
with integrity hashes the first time they are used.
Then allow the disks you want to show (`local` and `public` are allowed by default):
## Usage
### PDF
### PDF thumbnails
### Video and HLS
Options: `poster` (a URL) or `poster-path` (on the same disk), `aspect-ratio`, `autoplay`,
`muted`, `loop`, `preload`, and `hls` to force HLS for a source without the `.m3u8` extension.
Anything in the slot goes inside the `
All versions of laravel-media-viewer with dependencies
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package amjadiqbal/laravel-media-viewer contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.