Skip to content

Commit

Permalink
0.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
birme committed Jan 28, 2017
1 parent c6ccd41 commit eaf12b5
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 64 deletions.
28 changes: 21 additions & 7 deletions dist/dashvalidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ DashValidator.prototype.verifyTimestamps = function verifyTimestamps(allowedDiff
if (Math.abs(timeAtHead - d) > diffCriteria) {
result.clock = "BAD";
result.clockOffset = Math.abs(timeAtHead - d);
} else {
result.clock = "OK";
result.clockOffset = Math.abs(timeAtHead - d);
}
}
resolve(result);
Expand Down Expand Up @@ -203,9 +206,10 @@ DashValidator.prototype.verifyAllSegments = function verifyAllSegments(verifyFn,
* streaming
*
* @param {number} iterations Number of iterations to test
* @param {Function} _optIterator For testing purposes
* @returns {Promise}
*/
DashValidator.prototype.validateDynamicManifest = function validateDynamicManifest(iterations) {
DashValidator.prototype.validateDynamicManifest = function validateDynamicManifest(iterations, _optIterator) {
var _this5 = this;

return new Promise(function (resolve, reject) {
Expand All @@ -221,7 +225,7 @@ DashValidator.prototype.validateDynamicManifest = function validateDynamicManife
});
});
});
}).then(function (result) {
}, _optIterator).then(function (result) {
resolve(result);
}).catch(reject);
});
Expand Down Expand Up @@ -638,8 +642,9 @@ var DashValidatorRunner = function constructor(mpd, headers, updateTime) {
*
* @param {number} iterations Number of iterations to run
* @param {Function} mpdUpdateFn Function that is called to update manifest
* @param {Function} _optIterator Used for testing purposes
*/
DashValidatorRunner.prototype.start = function start(iterations, mpdUpdateFn) {
DashValidatorRunner.prototype.start = function start(iterations, mpdUpdateFn, _optIterator) {
var _this2 = this;

return new Promise(function (resolve, reject) {
Expand Down Expand Up @@ -682,6 +687,9 @@ DashValidatorRunner.prototype.start = function start(iterations, mpdUpdateFn) {
}

setTimeout(timerFn.bind(_this2), _this2.updateTime * 1000);
if (_optIterator) {
_optIterator();
}
});
};

Expand Down Expand Up @@ -741,6 +749,12 @@ function hasValidPlayhead(mpd) {
function hasValidHeaders(lastHeaders, currentHeaders) {
var lastDate = new Date(lastHeaders["date"]);
var currentDate = new Date(currentHeaders["date"]);
var lastModifiedDate = new Date(lastHeaders["last-modified"]);
var currentModifiedDate = new Date(currentHeaders["last-modified"]);

if (lastModifiedDate >= currentModifiedDate) {
return false;
}

if (lastDate >= currentDate) {
return false;
Expand Down Expand Up @@ -20360,7 +20374,7 @@ module.exports={
"spec": ">=6.0.0 <7.0.0",
"type": "range"
},
"/Users/jobi/Projects/eyevinn-labs/src/dash-validator/node_modules/browserify-sign"
"/Users/deejaybee/Code/eyevinn/dash-validator-js/node_modules/browserify-sign"
]
],
"_from": "elliptic@>=6.0.0 <7.0.0",
Expand Down Expand Up @@ -20395,7 +20409,7 @@ module.exports={
"_shasum": "e4c81e0829cf0a65ab70e998b8232723b5c1bc48",
"_shrinkwrap": null,
"_spec": "elliptic@^6.0.0",
"_where": "/Users/jobi/Projects/eyevinn-labs/src/dash-validator/node_modules/browserify-sign",
"_where": "/Users/deejaybee/Code/eyevinn/dash-validator-js/node_modules/browserify-sign",
"author": {
"name": "Fedor Indutny",
"email": "fedor@indutny.com"
Expand Down Expand Up @@ -58968,7 +58982,7 @@ module.exports={
"spec": ">=2.3.0 <2.4.0",
"type": "range"
},
"/Users/jobi/Projects/eyevinn-labs/src/dash-validator/node_modules/request"
"/Users/deejaybee/Code/eyevinn/dash-validator-js/node_modules/request"
]
],
"_from": "tough-cookie@>=2.3.0 <2.4.0",
Expand Down Expand Up @@ -59004,7 +59018,7 @@ module.exports={
"_shasum": "f081f76e4c85720e6c37a5faced737150d84072a",
"_shrinkwrap": null,
"_spec": "tough-cookie@~2.3.0",
"_where": "/Users/jobi/Projects/eyevinn-labs/src/dash-validator/node_modules/request",
"_where": "/Users/deejaybee/Code/eyevinn/dash-validator-js/node_modules/request",
"author": {
"name": "Jeremy Stashewsky",
"email": "jstashewsky@salesforce.com"
Expand Down
75 changes: 34 additions & 41 deletions dist/dashvalidator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="module-da
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jan 26 2017 10:28:29 GMT+0100 (CET) using the Minami theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat Jan 28 2017 11:23:36 GMT+0100 (CET) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
10 changes: 7 additions & 3 deletions docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ <h1 class="page-title">index.js</h1>
if (Math.abs(timeAtHead - d) > diffCriteria) {
result.clock = "BAD";
result.clockOffset = Math.abs(timeAtHead - d);
} else {
result.clock = "OK";
result.clockOffset = Math.abs(timeAtHead - d);
}
}
resolve(result);
Expand Down Expand Up @@ -230,9 +233,10 @@ <h1 class="page-title">index.js</h1>
* streaming
*
* @param {number} iterations Number of iterations to test
* @param {Function} _optIterator For testing purposes
* @returns {Promise}
*/
DashValidator.prototype.validateDynamicManifest = function validateDynamicManifest(iterations) {
DashValidator.prototype.validateDynamicManifest = function validateDynamicManifest(iterations, _optIterator) {
return new Promise((resolve, reject) => {
this._runner.start(iterations, () => {
return new Promise((resolveUpdateMpd) => {
Expand All @@ -246,7 +250,7 @@ <h1 class="page-title">index.js</h1>
})
});
});
})
}, _optIterator)
.then((result) => {
resolve(result);
}).catch(reject);
Expand Down Expand Up @@ -348,7 +352,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jan 26 2017 10:28:29 GMT+0100 (CET) using the Minami theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat Jan 28 2017 11:23:36 GMT+0100 (CET) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
41 changes: 32 additions & 9 deletions docs/module-dash-validator-DashValidator.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ <h4 class="name" id="duration"><span class="type-signature"></span>duration<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line225">line 225</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line229">line 229</a>
</li></ul></dd>


Expand Down Expand Up @@ -370,7 +370,7 @@ <h4 class="name" id="isLive"><span class="type-signature"></span>isLive<span cla

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line240">line 240</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line244">line 244</a>
</li></ul></dd>


Expand Down Expand Up @@ -574,7 +574,7 @@ <h4 class="name" id="segmentUrls"><span class="type-signature"></span>segmentUrl

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line233">line 233</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line237">line 237</a>
</li></ul></dd>


Expand Down Expand Up @@ -628,7 +628,7 @@ <h5>Returns:</h5>



<h4 class="name" id="validateDynamicManifest"><span class="type-signature"></span>validateDynamicManifest<span class="signature">(iterations)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<h4 class="name" id="validateDynamicManifest"><span class="type-signature"></span>validateDynamicManifest<span class="signature">(iterations, _optIterator)</span><span class="type-signature"> &rarr; {Promise}</span></h4>



Expand Down Expand Up @@ -692,6 +692,29 @@ <h5>Parameters:</h5>
</tr>



<tr>

<td class="name"><code>_optIterator</code></td>


<td class="type">


<span class="param-type">function</span>



</td>





<td class="description last">For testing purposes</td>
</tr>


</tbody>
</table>

Expand Down Expand Up @@ -729,7 +752,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line195">line 195</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line199">line 199</a>
</li></ul></dd>


Expand Down Expand Up @@ -902,7 +925,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line183">line 183</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line186">line 186</a>
</li></ul></dd>


Expand Down Expand Up @@ -1056,7 +1079,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line165">line 165</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line168">line 168</a>
</li></ul></dd>


Expand Down Expand Up @@ -1258,7 +1281,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line123">line 123</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line126">line 126</a>
</li></ul></dd>


Expand Down Expand Up @@ -1324,7 +1347,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jan 26 2017 10:28:29 GMT+0100 (CET) using the Minami theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat Jan 28 2017 11:23:36 GMT+0100 (CET) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
4 changes: 2 additions & 2 deletions docs/module-dash-validator.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h4 class="name" id="module:dash-validator"><span class="type-signature"></span>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line298">line 298</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line302">line 302</a>
</li></ul></dd>


Expand Down Expand Up @@ -955,7 +955,7 @@ <h5 class="subsection-title">Properties:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jan 26 2017 10:28:29 GMT+0100 (CET) using the Minami theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat Jan 28 2017 11:23:36 GMT+0100 (CET) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-validator",
"version": "0.4.4",
"version": "0.4.5",
"description": "JS library to validate MPEG DASH manifests and segments",
"main": "index.js",
"engines": {
Expand Down

0 comments on commit eaf12b5

Please sign in to comment.