Popcorn.js Documentation

Media Properties

Media properties are available to the user in order to set attributes on a popcorn instance. Keep in mind, altering this properties may create undesired results and are use at your own risk ( especially the media property )

frameAnimation

Purpose

Setting the Popcorn constructors option object property frameAnimation to true will opt-in playback to be managed by a requestAnimationFrame loop, resulting in up to 60 fps playback (results may vary depending on system). This will also grant the use of the frame callback method in any plugins that implement it.

Options

  • frameAnimation [Boolean] - state whether to use frameAnimation or not

Use Case

  • Firing events on a per frame level, increasing accuracy
  • Enable the use of the frame callback for plugins if they implement it

Examples

1 Popcorn("#video-element-id", {
2       frameAnimation: true
3     });

Live demo of updating the currentTime of a video

framerate

Purpose

You can set the framerate to be used for all start/end points of a given Popcorn instance

Options

  • frameRate [Number] - framerate to be used. Will be used to calculate SMPTE formatted times.

Example

Live demo of setting the frame rate