Files
signage-player/README.md
2025-05-15 19:35:51 +03:00

150 lines
4.5 KiB
Markdown

# 🎥 Kivy Media Player
A media player application built using **Kivy** that allows users to play video files, display images, and manage settings for quick connect codes and server configurations. The application checks for updates to the playlist every five minutes while running in full-screen mode.
---
## 📂 Project Structure
```
signage-player
├── src
│ ├── media_player.py # Handles media playback
│ ├── python_functions.py # Utility functions for downloading files and updating playlists
│ ├── kv
│ │ └── media_player.kv # Layout for the media player screen
│ ├── Resurse
│ │ ├── app_config.txt # Configuration file
│ │ ├── log.txt # Log file for media events
│ │ ├── play.png # Play button icon
│ │ ├── pause.png # Pause button icon
│ │ └── other icons... # Additional icons for the UI
│ └── static
│ └── resurse # Directory for media files (images/videos)
├── requirements.txt # Project dependencies
├── run_app.sh # Script to run the application
├── install.sh # Installation script
├── How to use.txt # Detailed usage instructions
└── README.md # Documentation for the project
```
---
## 🚀 Setup Instructions
### Prerequisites
Before installing the application, ensure the following are installed on your Raspberry Pi:
- **Python 3.7 or higher**
- **pip3** (Python package manager)
- **ffmpeg** (for video conversion)
- **Internet connection** for downloading dependencies
### Installation Steps
1. **Clone the Repository**
```bash
git clone https://gitea.moto-adv.com/ske087/signage-player.git
cd signage-player
```
2. **Run the Installation Script**
```bash
./install.sh
```
The installation script will:
- Update the system.
- Install required Python and system dependencies.
- Clone the repository to `/home/pi/Desktop/ds-player`.
- Add the run_app.sh script to `~/.bashrc` for autostart.
- Make the run_app.sh script executable.
3. **Reboot the Device**
After installation, reboot the Raspberry Pi to start the application automatically:
```bash
sudo reboot
```
---
## 🎮 How to Use
### MediaPlayer Screen
- **▶️ Play/Pause Button**:
- Toggles between playing and pausing the media.
- Automatically resumes playback after 30 seconds if not toggled again.
- **⏩ Next/⏪ Previous Buttons**:
- Navigate to the next or previous media in the playlist.
- **❌ Exit App Button**:
- Opens a password-protected popup. Enter the `quickconnect_key` from the configuration file to exit the app.
### Settings Screen
- **Configuration Fields**:
- Update fields like `screen_orientation`, `screen_name`, `quickconnect_key`, `server_ip`, and `port`.
- **💾 Save Button**:
- Saves the updated configuration and returns to the MediaPlayer screen.
- **❌ Exit App Button**:
- Opens a password-protected popup. Enter the `quickconnect_key` to exit the app.
---
## ⚙️ Configuration
### Configuration File
The configuration file is located at:
```bash
/home/pi/Desktop/signage-player/src/Resurse/app_config.txt
```
### Example Configuration
```json
{
"screen_orientation": "Landscape",
"screen_name": "tv-panou1",
"quickconnect_key": "8887779",
"server_ip": "172.20.10.9",
"port": "80"
}
```
### Updating Configuration
1. Navigate to the **Settings Screen** in the app.
2. Update the fields and click **Save**.
3. The configuration will be saved to app_config.txt.
---
## 🛠️ Troubleshooting
### Permission Denied for run_app.sh
- Ensure the script is executable:
```bash
chmod +x /home/pi/Desktop/signage-player/run_app.sh
```
### Application Does Not Start on Boot
- Verify the `~/.bashrc` entry is correct.
- Check the script's permissions and paths.
### Media Files Not Playing
- Ensure media files are downloaded to the correct directory:
```bash
/home/pi/Desktop/signage-player/src/static/resurse
```
- Check the playlist configuration and server connection.
### Password for Exit App
- The password is the `quickconnect_key` from the configuration file (`app_config.txt`).
---
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any suggestions or improvements.
---
## 📜 License
This project is licensed under the **MIT License**. See the `LICENSE` file for more details.
````