If you can do this on the server side in advance then ffmpeg has a reverse video filter which will allow you create a reversed copy of a video. See here for an example:
There are also custom tools which can do this, again generally server side.
If you must do it on the player then it is not going to be easy as most video encoding schemes will encode so that the encoding for a given frame is dependent on one or more frames before it, and also sometimes dependent on one or more frames after it also.
In other words to create the frame correctly you may need to refer to one or more previous and one or more subsequent frames.
To play it backwards it would still need to do this decoding so you would need a player that could isolate a set of frames or 'Group of Pictures' that was autonomous, i.e. not dependent on any other previous or subsequent frames, and then decode it in the right order to play the video backwards.
The player would also need to stream the file from the end rather than the start, if it is streaming it rather than downloading it, if it was to stream it efficiently.
A crude way to do it that may work for some formats would be to:
- load the video and examine the frame rate and duration
- seek to the end time
- in a loop:
- seek to the time approximately one frame back (by calculating from frame rate)
- display the frame at this time
- repeat until you reach the first frame
I suspect, however, this will be slow and give you a 'jerky' video playback.