Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laravel-admin-extensions/media-player
Play audio/videos in laravel-admin
https://github.com/laravel-admin-extensions/media-player
Last synced: about 1 month ago
JSON representation
Play audio/videos in laravel-admin
- Host: GitHub
- URL: https://github.com/laravel-admin-extensions/media-player
- Owner: laravel-admin-extensions
- License: mit
- Created: 2018-11-13T17:11:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-19T03:41:40.000Z (over 4 years ago)
- Last Synced: 2024-10-31T09:25:56.220Z (about 1 month ago)
- Language: JavaScript
- Size: 955 KB
- Stars: 31
- Watchers: 2
- Forks: 10
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-laravel-admin - media-player - 视频/音频播放器 (扩展包 / 网格类扩展包)
README
laravel-admin Media player
======This extension allows you to play video or audio on grid pages and show pages with the help of [mediaelement](https://github.com/mediaelement/mediaelement).
[中文介绍](https://laravel-admin.org/posts/21)
## Screenshots
![wx20181114-010912](https://user-images.githubusercontent.com/1479100/48430450-4ef5fa80-e7aa-11e8-8fcd-1f5717b0d3d6.png)
![wx20181114-011037](https://user-images.githubusercontent.com/1479100/48430451-4ef5fa80-e7aa-11e8-8394-38ed2c6c75ba.png)
## Installation
```bash
composer require laravel-admin-ext/media-playerphp artisan vendor:publish --tag=laravel-admin-media-player
```## Usage
If you have a field `foo` that stores the full url of the audio/video file, or the path under the disk configured by `admin.upload.disk`, you can use it in the following way.
In the grid page:
```php
// Add a play button to the current field column. After clicking it will open a modal to play the video file.
$grid->foo()->video();// Add an audio player to the current field column
$grid->foo()->audio();
```
In show page:
```php
// This field will be displayed as a video player
$show->foo()->video();// this field will be displayed as an audio player
$show->foo()->audio();
```If the field `foo` is another path or a file path under another server, you can use the following settings.
```php
$grid->foo()->video(['server' => 'http:www.foo.com/']);
```This player feature of this extension is based on [mediaelement](https://github.com/mediaelement/mediaelement) and can be referenced [API and Configuration](https://github.com/mediaelement/mediaelement/blob/master/docs/api.md) Add more settings to the player.
For example, set the size of the player:
```php
$grid->foo()->video(['videoWidth' => 720, 'videoHeight' => 480]);
```## Donate
If you feel that this project has saved you time, you may wish to support it ;)
![-1](https://cloud.githubusercontent.com/assets/1479100/23287423/45c68202-fa78-11e6-8125-3e365101a313.jpg)
License
------------
Licensed under [The MIT License (MIT)](LICENSE).