问题
I'm trying to seek video with no steaming.
this is my page:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="flowplayer-3.2.13.min.js"></script>
<title>Flowplayer test</title>
</head><body>
<a style="display:block;width:640px;height:360px" id="player"></a>
<script>
flowplayer("player","flowplayer/flowplayer-3.2.18.swf",{
clip: {url:'sp/gailun640x360.mp4'}});
function vgoto(val) {$f(0).seek(val);}
</script>
<a href="javascript:vgoto(0);">0s</a>
<a href="javascript:vgoto(10);">10s</a>
<a href="javascript:vgoto(20);">20s</a>
<a href="javascript:vgoto(30);">30s</a>
<a href="javascript:vgoto(40);">40s</a>
...
<a href="javascript:vgoto(100);">100s</a>
</body></html>
When I click "10s" and seek video to 10s, video time become 7.04s,
then I seek to 20s, it become 17.04s,
and so on, like:
30s -> 20.08
40s -> 30.08
50s -> 40.08
60s -> 56.52
70s -> 66.52
80s -> 76.52
90s -> 86.52
100s -> 90.92
thanks for any help.
回答1:
The issue is that flowplayer can seek to keyframes only so in order to be able to seek to any second you need to have keyframe for every second. Most probably that means that you need to recode videos when they are uploaded using ffmpeg configured to force keyframes every second.
来源:https://stackoverflow.com/questions/23755956/seek-on-flowplayer-is-not-right