You will need to install a user script manager extension to install this script.
At first I made this script to replace the dailymotion player because for some reasons html5 was only a fallback.
Now that flash is almost dead it still works as a replacement as it somehow works better than their genuine player (and have no ads).
About the option "Prefer HLS to MP4" :
HLS Http Live Streaming is a technology based on small mp4 fragments used for adaptative streaming (Auto quality) and live streaming but with this option you can choose to also use it overall when selecting the quality manually, it may have a lower resolution sometimes but it have a great advantage => it's faster to load, monoblock mp4 files are tokenerized and often take several seconds if not forever to validate.
Here are some keyboard shortcuts you can use when the player has focus :
Enter : Fullscreen
Space : Play/Pause
Left/Right : seek backward/forward
Up/Down : volume change
You can also use mouse wheel to change volume when in fullscreen or over the mute button.
This script uses hls.js : https://github.com/dailymotion/hls.js/tree/master
and ionicons : http://ionicons.com/