Node version of Thomas Steiner's MediaFragment.js (Github).
Media Fragments URI is a W3C specification with the objective to provide for media-format independent, standard means of addressing media fragments on the Web using Uniform Resource Identifiers (URIs). (http://www.w3.org/2008/WebVideo/Fragments/)
This module is released under the Apache License Version 2.0
This library is not yet on npm server.
You can install it from git source with:
npm install git+https://github.com/pasqLisena/node-mediafragment
var mfParse = require('mediafragment'); var json = mfParse.parse('www.example.com/video.mp4?t=10,20'); console.log(JSON.stringify(json)); // {"query":{"t":[{"value":"10,20","unit":"npt","start":"10","end":"20","startNormalized":10,"endNormalized":20}]},"hash":{}}
Warning logs are disabled by default. In order to activate them, use
mfParse.setVerbose(true);
npm test