Files
RadioPlayer-22/README.md

251 líneas
6.4 KiB
Markdown
Original Vista normal Histórico

2025-08-01 00:46:14 +00:00
# 🎵 Game! Radio Player
2022-12-24 18:30:54 +00:00
2025-08-01 00:46:14 +00:00
A modern, responsive web-based radio player with a beautiful Spotify-inspired interface. Stream your favorite radio station with real-time song information, lyrics, and playback history.
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
![Radio Player Preview](img/cover.png)
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
## ✨ Features
- **🎧 Live Streaming**: Supports multiple streaming protocols (Icecast, Zeno, Shoutcast, Radiojar)
- **🎨 Modern UI**: Spotify-inspired interface with smooth animations
- **📱 Responsive Design**: Works perfectly on desktop, tablet, and mobile devices
- **🎵 Real-time Metadata**: Displays current song, artist, and album artwork
- **📜 Lyrics Integration**: Automatic lyrics lookup using Vagalume API
- **📚 Playback History**: Shows up to 5 recently played songs
- **🎛️ Volume Control**: Precise volume control with keyboard shortcuts
- **⌨️ Keyboard Shortcuts**: Full keyboard navigation support
- **🎨 Dynamic Artwork**: Album covers with loading animations
- **🔊 Media Session**: Integration with browser media controls
## 🚀 Quick Start
### Prerequisites
- A modern web browser (Chrome, Firefox, Safari, Edge)
- A radio stream URL
- (Optional) Vagalume API key for lyrics
### Installation
1. **Clone the repository**
```bash
git clone https://github.com/yourusername/radio-player.git
cd radio-player
```
2. **Install dependencies** (if using npm/pnpm)
```bash
pnpm install
```
3. **Configure your radio stream**
- Open `js/script.js`
- Update the `URL_STREAMING` constant with your stream URL
- Update the `API_URL` with your metadata API endpoint
4. **Serve the files**
```bash
# Using Python
python -m http.server 8000
# Using Node.js
npx serve .
# Using PHP
php -S localhost:8000
```
5. **Open in browser**
```
http://localhost:8000
```
## ⚙️ Configuration
### Stream Configuration
Edit `js/script.js` to configure your radio stream:
2023-06-18 21:49:17 +00:00
```javascript
2025-08-01 00:46:14 +00:00
// Change Stream URL Here
const URL_STREAMING = "https://your-stream-url.com/stream"
// API endpoint for metadata
const API_URL = "https://your-api-endpoint.com/metadata"
// Vagalume API key for lyrics (optional)
const API_KEY = "your-vagalume-api-key"
```
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
### Supported Stream Types
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
- **Icecast**: `http://icecast.server.com:8000/stream`
- **Shoutcast**: `http://shoutcast.server.com:8000/stream`
- **Radiojar**: `https://stream.radiojar.com/stream`
- **Zeno**: `https://zeno.fm/stream`
### API Configuration
The player expects a JSON API response with the following structure:
```json
{
"title": "Song Title",
"artist": "Artist Name",
"art": "https://album-art-url.com/cover.jpg",
"history": [
{
"song": "Previous Song",
"artist": "Previous Artist",
"artwork": "https://previous-artwork-url.com/cover.jpg"
}
]
}
```
## 🎮 Keyboard Shortcuts
| Key | Action |
|-----|--------|
| `Space` or `P` | Play/Pause |
| `↑` | Volume Up |
| `↓` | Volume Down |
| `M` | Mute/Unmute |
| `0-9` | Set volume to 0-90% |
## 🎨 Customization
### Styling
The player uses CSS custom properties for easy theming. Edit `css/style.css` to customize:
```css
:root {
--primary-color: #1db954;
--secondary-color: #191414;
--text-color: #ffffff;
--background-color: #121212;
}
```
### History Items
To change the number of history items displayed:
1. Edit `js/script.js`
2. Modify the `HISTORY_ITEMS_COUNT` constant in `initializeHistoryItems()`
```javascript
const HISTORY_ITEMS_COUNT = 10 // Change from 5 to desired number
```
2023-06-21 20:28:06 +00:00
2025-08-01 00:46:14 +00:00
## 📱 Browser Support
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
- ✅ Chrome 60+
- ✅ Firefox 55+
- ✅ Safari 12+
- ✅ Edge 79+
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
## 🔧 Development
2023-12-10 01:34:23 +00:00
2025-08-01 00:46:14 +00:00
### Project Structure
2023-12-10 01:34:23 +00:00
2025-08-01 00:46:14 +00:00
```
radio-player/
├── css/
│ ├── animate.css # Animation library
│ ├── bootstrap.min.css # Bootstrap framework
│ ├── font-awesome.min.css # Icon library
│ └── style.css # Custom styles
├── fonts/ # Font Awesome fonts
├── img/ # Images and artwork
├── js/
│ ├── bootstrap.min.js # Bootstrap JavaScript
│ └── script.js # Main application logic
├── index.html # Main HTML file
├── package.json # Dependencies
└── README.md # This file
```
2023-11-14 06:43:35 +00:00
2025-08-01 00:46:14 +00:00
### Key Functions
2023-11-14 06:43:05 +00:00
2025-08-01 00:46:14 +00:00
- `Page()` - Handles UI updates and DOM manipulation
- `Player()` - Manages audio playback and controls
- `getStreamingData()` - Fetches metadata from API
- `initializeHistoryItems()` - Dynamically generates history items
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
## 🌐 API Integration
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
### Vagalume Lyrics API
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
To enable lyrics functionality:
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
1. Visit [Vagalume API](https://api.vagalume.com.br/docs/)
2. Get your API key
3. Update the `API_KEY` constant in `js/script.js`
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
### Custom Metadata API
2023-09-09 17:52:44 +00:00
2025-08-01 00:46:14 +00:00
The player expects a REST API endpoint that returns JSON metadata. Implement your own API or use services like:
2023-09-09 17:52:44 +00:00
2025-08-01 00:46:14 +00:00
- RadioAPI.me
- Radio Browser API
- Custom Icecast metadata parser
2024-08-08 06:41:19 +00:00
2025-08-01 00:46:14 +00:00
## 🐛 Troubleshooting
2024-10-16 13:09:02 +00:00
2025-08-01 00:46:14 +00:00
### Common Issues
2024-10-16 13:09:02 +00:00
2025-08-01 00:46:14 +00:00
**Stream not playing:**
- Check if the stream URL is accessible
- Verify CORS settings on your server
- Ensure the stream format is supported
2023-09-09 17:52:44 +00:00
2025-08-01 00:46:14 +00:00
**Metadata not updating:**
- Verify API endpoint is working
- Check browser console for errors
- Ensure API response format matches expected structure
2024-09-26 00:53:29 +00:00
2025-08-01 00:46:14 +00:00
**Lyrics not showing:**
- Verify Vagalume API key is valid
- Check if song/artist exists in Vagalume database
- Ensure API requests are not blocked by CORS
2023-09-09 17:52:44 +00:00
2025-08-01 00:46:14 +00:00
### Debug Mode
2023-09-09 17:52:44 +00:00
2025-08-01 00:46:14 +00:00
Enable debug logging by opening browser console and looking for:
- API response data
- Stream connection status
- Error messages
2023-09-09 17:52:44 +00:00
2025-08-01 00:46:14 +00:00
## 📄 License
2023-09-09 17:52:44 +00:00
2025-08-01 00:46:14 +00:00
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
2023-07-25 01:33:25 +00:00
2025-08-01 00:46:14 +00:00
## 🤝 Contributing
2023-07-25 01:33:25 +00:00
2025-08-01 00:46:14 +00:00
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
## 🙏 Acknowledgments
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
- [Bootstrap](https://getbootstrap.com/) - CSS framework
- [Font Awesome](https://fontawesome.com/) - Icons
- [Animate.css](https://animate.style/) - Animations
- [Vagalume](https://www.vagalume.com.br/) - Lyrics API
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
## 📞 Support
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
If you need help or have questions:
2023-06-18 21:49:17 +00:00
2025-08-01 00:46:14 +00:00
- Create an [issue](https://github.com/yourusername/radio-player/issues)
- Check the [documentation](https://github.com/yourusername/radio-player/wiki)
- Join our [Discord community](https://discord.gg/your-community)
2023-08-21 01:06:16 +00:00
2025-08-01 00:46:14 +00:00
---
2023-08-21 01:02:42 +00:00
2025-08-01 00:46:14 +00:00
Made with ❤️ for radio lovers everywhere