a video player library for pygame-ce, works on desktop and web
supports python 3.9+
- ability to fetch local & web videos on both desktop & web
- ability to play said videos with its original audio[1], override the audio, or no sound at all
- works on:
- desktop: windows, linux, raspberry pi os, etc.
- web: pygbag, pyodide & pyscript[2]
put this in your cli: pip install git+https://github.com/richkdev/richyplayer.git then just do import richyplayer
put the entire richyplayer folder inside the the root folder as your main.py
BEFORE:
my-project
├── img/
│ └── image.png
├── sfx/
│ └── sound.mp3
├── main.py
├── README.md
└── requirements.txt
AFTER:
my-project
├── richyplayer/
│ ├── __init__.py
│ ├── richyplayer.py
│ └── ...
├── img/
│ └── image.png
├── sfx/
│ └── sound.mp3
├── main.py
├── README.md
└── requirements.txt
check richyplayer/examples/ for examples on how to use the richyplayer
- original video's audio can't be played on all supported web platforms. the workaround is to play the put the audio in a different file - whether it be local or web - and pass the path to the
override_audio_sourceparam inVideoPlayer.open(). - on pyodide, pass enableRunUntilComplete: false to loadPyodide so that the old no-op behavior is enabled.
references when using the richyplayer
- pygame-ce
- https://pyga.me/docs/ (make sure to check when a specific pygame-ce feature was added/removed/modified)
- opencv-python
- pygbag
- pyodide
- pyscript