Is it possible to play HTML5 video in reverse?

天大地大妈咪最大 提交于 2020-01-19 05:39:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!