Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/billymohajeri/java-media-player
https://github.com/billymohajeri/java-media-player
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/billymohajeri/java-media-player
- Owner: billymohajeri
- Created: 2024-07-22T12:09:39.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-27T21:45:31.000Z (6 months ago)
- Last Synced: 2024-10-28T11:49:04.682Z (3 months ago)
- Language: Java
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Media Player Application
## Features
The media player application is a robust software that manages collections of different media files and users. Each user can create their own playlists and perform various actions on the media files within their playlists. One user can have multiple playlists. The application should ensure unique users.
- **Admin Features**:
- Only admins can add, remove, update, and delete all files and users in the application.- **User Features**:
- Users can manage their playlists, including adding, removing, playing, pausing, and stopping media files.
- Users can adjust media files while playing:
- Videos: Adjust volume and brightness.
- Audios: Adjust volume and sound effects.- **Error Handling**:
- Handle potential errors and exceptions gracefully, providing meaningful error messages to the user.## Requirements
- All instances of the database, repositories, and services should be initiated in `Main.java`.
- All functionalities should be handled via services only## Detailed Instructions
### Project Setup
- Create necessary packages such as `entities`, `repositories`, `interfaces`, `services`, `enums`, and `utilities`.
### Classes and Methods
#### Entities
1. **User**
- Fields: `int id`, `String username`, `String password`, `List playlists`
- Methods: `addPlaylist(Playlist playlist)`, `removePlaylist(Playlist playlist)`, `getPlaylists()`2. **Admin**
- Inherits from `User`
- Additional Methods: `addUser(User user)`, `removeUser(User user)`, `updateUser(User user)`3. **MediaFile**
- Fields: `int id`, `String name`, `String type`
- Methods: `play()`, `pause()`, `stop()`, `adjustSetting(String setting, int value)`4. **AudioFile** (inherits from `MediaFile`)
- Fields: `int volume`, `String soundEffect`
- Methods: `adjustVolume(int volume)`, `changeSoundEffect(String effect)`5. **VideoFile** (inherits from `MediaFile`)
- Fields: `int volume`, `int brightness`
- Methods: `adjustVolume(int volume)`, `adjustBrightness(int brightness)`6. **Playlist**
- Fields: `int id`, `String name`, `List mediaFiles`
- Methods: `addMediaFile(MediaFile mediaFile)`, `removeMediaFile(MediaFile mediaFile)`, `getMediaFiles()`, `playMedia(int mediaFileId)`, `pauseMedia(int mediaFileId)`, `stopMedia(int mediaFileId)`#### Repositories
1. **UserRepository**
- Methods: `addUser(User user)`, `removeUser(User user)`, `updateUser(User user)`, `getUserById(int id)`, `getAllUsers()`2. **MediaFileRepository**
- Methods: `addMediaFile(MediaFile mediaFile)`, `removeMediaFile(MediaFile mediaFile)`, `updateMediaFile(MediaFile mediaFile)`, `getMediaFileById(int id)`, `getAllMediaFiles()`3. **PlaylistRepository**
- Methods: `addPlaylist(Playlist playlist)`, `removePlaylist(Playlist playlist)`, `updatePlaylist(Playlist playlist)`, `getPlaylistById(int id)`, `getAllPlaylists()`#### Interfaces
1. **IUserService**
- Methods: `createUser(User user)`, `deleteUser(int id)`, `updateUser(User user)`, `getUser(int id)`, `listUsers()`2. **IMediaFileService**
- Methods: `addMediaFile(MediaFile mediaFile)`, `deleteMediaFile(int id)`, `updateMediaFile(MediaFile mediaFile)`, `getMediaFile(int id)`, `listMediaFiles()`, `playMedia(int id)`, `pauseMedia(int id)`, `stopMedia(int id)`, `adjustVolume(int id, int volume)`, `adjustBrightness(int id, int brightness)`, `changeSoundEffect(int id, String effect)`3. **IPlaylistService**
- Methods: `createPlaylist(Playlist playlist)`, `deletePlaylist(int id)`, `updatePlaylist(Playlist playlist)`, `getPlaylist(int id)`, `listPlaylists()`, `playMediaFromPlaylist(int playlistId, int mediaFileId)`, `pauseMediaInPlaylist(int playlistId, int mediaFileId)`, `stopMediaInPlaylist(int playlistId, int mediaFileId)`#### Services
1. **UserService** (implements `IUserService`)
- Methods: Implement all methods from `IUserService`2. **MediaFileService** (implements `IMediaFileService`)
- Methods: Implement all methods from `IMediaFileService`3. **PlaylistService** (implements `IPlaylistService`)
- Methods: Implement all methods from `IPlaylistService`### Main Application
- Initialize the application context (database), including repositories, and services in `Main.java`.
- Set up a simple console-based user interface for interaction.