Frame-Accurate Seeking plugin

This plugin adds support for seeking to specific frames and SMPTE timecodes.

Info

Since some browsers prohibit acccess to individual frames, the plugin uses a time-calculation approach which is not 100% accurate, but very close.

Installation

Include the plugin next to the core player:

Copy
Copied
<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/fas.min.js"></script>

Configuration

The plugin is configured with the top level configuration object fas. The configuration properties are:

parameter description
frame_rate the frame rate of the current video. 30 is assumed if omitted.

API

The API lives under the fas namespace in the Player API. The methods are:

method description
current_frame() returns the frame at current time
current_timecode() returns the current SMPTE timecode
seek_to(timecode_or_frame) seeks to either SMPTE timecode or frame number. If a string is passed as argument, the SMPTE timecode is assumed. If a number is passed, frame number is assumed.
jump(n) seeks n frames forward (or backward, if a negative number is passed).

Sample code

Copy
Copied
var player = flowplayer('#container', {
  src: '//edge.flowplayer.org/29.97fps.mp4',
  fas: {
    frame_rate: 29.97
  }
})

player.fas.seek_to(123);

Demo

Codepen