问题
Is HTML5 <video>
tag be play video in reverse, or I have to download 2 videos (forward and backword play). Any solution that avoid user from downloading 2 videos?
回答1:
Without even going into HTML5 or Javascript, many video formats are streaming formats that are designed to be played forward. Playing it backwards would require decoding the whole stream, storing each raw frame on the disk to avoid clobbering memory, then rendering the frames backwards.
At least one person actually tried that using mplayer
, though, so it can be done, at least in principle.
回答2:
aMediaElement.playbackRate = -1;
UAs may not support this, though it is valid to set playbackRate
to a negative value.
回答3:
I managed to do it in an update method. Every frame I decrease video.currentTime to the time elapsed and so far it is the best result I managed to get.
来源:https://stackoverflow.com/questions/5277293/is-it-possible-to-play-html5-video-in-reverse