1.1.0 • Published 5 years ago

vc-gif v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

vc-gif

Summary

Adds GIF playback support for the BBC's VideoContext player

Installation:

npm i vc-gif

Example usage:

import GIFNode from "vc-gif";
import VideoContext from "videocontext";

const vcCanvas = document.getElementById(`player`);
const vc = new VideoContext(vcCanvas);

const node = vc.customSourceNode(GIFNode, `https://media1.giphy.com/media/4dDquQRZZOPyo/giphy.gif`);

node.startAt(0);
node.stopAt(60);

node.connect(vc.destination);
vc.play();

Implementation

Uses gify-parse and libgif in order to decode a gif for playback and collect the necessary metadata for controlling the playback with VideoContext. libgif controls the actual playback, drawing a GIF on to a canvas element which is then used as a source for a VideoContext node. gify-parse is only used to extract the duration of the gif, as lib-gif does not expose this information. This is very ineffcient as it means we have to decode the gif twice, so the biggest priority for further development will be to find a way of getting this information without doing so.

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago