hvml
v0.0.3
Published
HVML Parser for JavaScript
Downloads
11
Readme
hvml
HVML Parser for Node.js
HVML (Hypervideo Markup Language) is a video metadata vocabulary. It covers three main classes of metadata:
- Technical details, like the available resolutions or codecs of a media file;
- Artistic details, like who appears in a given movie or what awards it has won; and
- Interactive UI instructions for compatible video players such as RedBlue.
HVML is designed to be human-friendly enough to write by hand in most cases. This library is not required in order to use it; it just provides an imperative API for working with it programmatically.
Installation
yarn add hvml
or
npm install hvml
Example Usage
const { HVML, Video } = require( 'hvml' );
const hvml = new HVML( './hvml.xml' );
hvml.ready.then( () => {
// Instance methods available now
console.log( hvml.toJson() );
} );
const video = new Video( {
"type": ["personal", "documentary"],
"lang": "en-US",
"id": "welcome-to-my-channel",
} );
video.setTitle( 'Welcome to My Channel!' );
video.setTitle( 'チャンネルへようこそ!', 'ja' );
// The Video types `personal` and `documentary` combine
// to create an implicit "vlog episode" semantic.
console.log( video.isVlogEpisode() ); // true
API
See the GitHub README for details.