Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Eyevinn/dash-validator-js
MPEG DASH validator JS library
https://github.com/Eyevinn/dash-validator-js
Last synced: about 12 hours ago
JSON representation
MPEG DASH validator JS library
- Host: GitHub
- URL: https://github.com/Eyevinn/dash-validator-js
- Owner: Eyevinn
- Created: 2016-12-21T13:40:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-09T22:32:05.000Z (about 1 year ago)
- Last Synced: 2024-10-30T05:23:57.161Z (9 days ago)
- Language: JavaScript
- Size: 1.39 MB
- Stars: 23
- Watchers: 8
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-video - Eyevinn/dash-validator-js - MPEG DASH validator JS library. (DASH / Talks Presentations Podcasts)
README
[![Build Status](https://travis-ci.org/Eyevinn/dash-validator-js.svg?branch=master)](https://travis-ci.org/Eyevinn/dash-validator-js)
[![Coverage Status](https://coveralls.io/repos/github/Eyevinn/dash-validator-js/badge.svg)](https://coveralls.io/github/Eyevinn/dash-validator-js)A Javascript library to validate content with the MPEG DASH streaming format
## Usage (Node JS)
```
npm install --save dash-validator
```Example implementation:
```
const DashValidator = require("dash-validator");const validator = new DashValidator("http://example.com/test.mpd");
validator.load().then(() => {
console.log("Loaded manifest");
console.log(validator.duration());
validator.verifyAllSegments(verifyFn).then(result => {
console.log(result);
});
}).catch(console.error);function verifyFn(headers) {
return (typeof headers["x-my-custom-header"] !== "undefined");
}
```To verify dynamically updating manifests:
```
validator.load().then(() => {
validator.validateDynamicManifest(5).then((result) => {
console.log(result);
});
validator.on("invalidplayhead", (data) => {
console.log(data);
});
validator.on("checking", data => {
const mpd = data.mpd;
const headers = data.headers;
console.log("Playhead: " + new Date(mpd.timeAtHead));
});
});
```## Usage (Browser)
```
var validator = new DashValidator("http://example.com/test.mpd");
validator.load().then(function() {
return validator.validateDynamicManifest(2);
}).then(function(result) {
var status = document.getElementById("status");
if (result.ok == result.iterations) {
status.innerHtml = "All OK";
}
});```