ultraviolettes/filament-audio-field-column
Composer 安装命令:
composer require ultraviolettes/filament-audio-field-column
包简介
A Filament plugin to display audio players with circular progress in forms, tables, and infolists
README 文档
README
A Filament plugin that provides audio player components with circular progress for forms, tables, and infolists.
Features
- Play/Pause button with smooth animations
- Circular progress indicator (SVG-based)
- Support for local and remote audio files (MP3, etc.)
- Dark mode support
- Optional volume control
- Optional duration display
- Customizable size and progress color
- Auto-pause when another player starts (only one plays at a time)
- Works in Tables, Infolists, and Forms
Installation
composer require ultraviolettes/filament-audio-field-column
Usage
Table Column
Display an audio player in your table:
use Ultraviolettes\FilamentAudio\Tables\Columns\AudioColumn; public static function table(Table $table): Table { return $table ->columns([ AudioColumn::make('audio_url') ->label('Preview'), // Or with a custom URL AudioColumn::make('preview') ->audioUrl(fn ($record) => $record->getAudioUrl()) ->size(40) ->progressColor('#10b981'), ]); }
Infolist Entry
Display an audio player in your infolist:
use Ultraviolettes\FilamentAudio\Infolists\Components\AudioEntry; public static function infolist(Infolist $infolist): Infolist { return $infolist ->schema([ AudioEntry::make('audio_url') ->label('Audio Preview') ->showDuration() ->showVolume(), ]); }
Form Field
Display an audio preview in your form (read-only player):
use Ultraviolettes\FilamentAudio\Forms\Components\AudioField; public static function form(Form $form): Form { return $form ->schema([ AudioField::make('audio_url') ->label('Audio Preview') ->audioUrl(fn ($record) => $record?->audio_url) ->showDuration() ->showVolume() ->size(48), ]); }
Configuration Options
All components support the following options:
| Method | Description | Default |
|---|---|---|
audioUrl(string|Closure) |
Set the audio URL directly | Uses state value |
size(int) |
Size of the player in pixels | 32 (column/entry), 48 (field) |
progressColor(string) |
Color of the progress circle | #00bfff |
showDuration(bool) |
Show the duration display | false (column/entry), true (field) |
showVolume(bool) |
Show volume control | false |
Examples
Basic Table Column
AudioColumn::make('audio_file')
Customized Column
AudioColumn::make('preview') ->label('Audio') ->audioUrl(fn ($record) => Storage::url($record->audio_path)) ->size(36) ->progressColor('#f59e0b') ->showDuration()
Full-Featured Form Field
AudioField::make('audio_preview') ->label('Current Audio') ->audioUrl(fn ($record) => $record?->getFirstMediaUrl('audio')) ->size(56) ->progressColor('#8b5cf6') ->showDuration() ->showVolume()
With Spatie Media Library
AudioColumn::make('audio') ->audioUrl(fn ($record) => $record->getFirstMediaUrl('tracks'))
Remote URLs
AudioColumn::make('sample') ->audioUrl('https://example.com/audio/sample.mp3')
Styling
The component uses Tailwind CSS classes and supports dark mode out of the box. The progress circle color can be customized using the progressColor() method with any valid CSS color value:
->progressColor('#10b981') // Hex ->progressColor('rgb(16, 185, 129)') // RGB ->progressColor('deepskyblue') // Named color
Browser Support
The audio player uses the native HTML5 <audio> element and supports all modern browsers. Supported audio formats depend on the browser:
- MP3: All modern browsers
- WAV: All modern browsers
- OGG: Firefox, Chrome, Opera
- AAC: Safari, Chrome, Edge
Requirements
- PHP 8.2+
- Laravel 11+
- Filament 4.x or 5.x
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License. See LICENSE.md for more information.
Credits
- Inspired by the audio preview component from BTY Monorepo
- Built with Filament
- Uses Alpine.js for interactivity
ultraviolettes/filament-audio-field-column 适用场景与选型建议
ultraviolettes/filament-audio-field-column 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 357 次下载、GitHub Stars 达 7, 最近一次更新时间为 2025 年 12 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「audio」 「laravel」 「mp3」 「player」 「filament」 「circular-progress」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ultraviolettes/filament-audio-field-column 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ultraviolettes/filament-audio-field-column 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ultraviolettes/filament-audio-field-column 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP library for handling audio/video files metadata
Library for manipulating audio files (validating, transcoding, and tagging)
A light weight Laravel package for simple operations with mp3 files
A wrapper around james-heinrich/getid3 to extract various information from media files.
PHP library to find podcasts
A Laravel package for downloading videos from the net by simply passing a URL
统计信息
- 总下载量: 357
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-28
