Node Minecraft Protocol Media Player
Play .nbs music and mp4 etc videos inside minecraft using minecraft-protocol or anything of your choice
Feel free to open an issue or a pull request! :D
Available on npm
npm install nmp-player
If you can do any of these and have free time to do so, you are free to open a PR :3
- Probably a subtitle player (needs xml parsing i think)
- Propose a json/file structure for medias
- Stream mode for VideoPlayer
module.exports
- MediaPlayer
- VideoPlayer
- SongPlayer
- VideoProcessor
- DisplayList
- MapData
Abstract class containing basic methods. You can use this to make your own media players.
Extends EventEmitter
Set the volume
Set the framerate (FPS, frames per second)
Set the playback speed. Default is 1
Returns a percentage (0 to 100) of the player's progress. Is always 100
is player.isStream
is true
Get the duration of the media in milliseconds
Play or resume, if fromStart
is true
, plays the media from the beginning, otherwise resumes if paused
Pause the media
Stops playing and rewinds to the start
seekTo, seek, rewind or forward the playback.
- f : the frame count
seekTo, seek, rewind or forward the playback.
- s : amount in seconds
If true, loops when the player ends playing
The media started playing again because loop is on
The media ended
speaks for itself
Forcefully stopped, one reason why is player.play(true)
Stream mode is a mode where the playback excepts frames to be ready.
If true
, the player is in stream mode. If false
, it isnt.
Add the frame, calling this in non-stream mode might have side effects
player.addFrame but in bulk
Emitted when the player starts to wait for input, aka use this to show a loading icon idk
Emitted when buffering ends
All methods in MediaPlayer are present
- Stream mode is not supported
- Added SongPlayer
- Server is now optional for VideoPlayer
- Added the ability to add custom frame display functions to VideoPlayer
- Changed Converter class function names to be more understandable