Skip to content

Instantly share code, notes, and snippets.

@rsimmons
Created December 20, 2018 01:12
Show Gist options
  • Save rsimmons/9d2115525efc97a0363812732542cdde to your computer and use it in GitHub Desktop.
Save rsimmons/9d2115525efc97a0363812732542cdde to your computer and use it in GitHub Desktop.
const originalStringify = JSON.stringify;
JSON.stringify = function(value) {
if (value && value.params && value.params.profiles) {
value.params.profiles.unshift(WEBVTT_FMT);
// console.log('stringify', value);
}
return originalStringify.apply(this, arguments);
};
const originalParse = JSON.parse;
JSON.parse = function() {
const value = originalParse.apply(this, arguments);
if (value && value.result && value.result.movieId && value.result.timedtexttracks) {
// console.log('parse', value);
extractMovieTextTracks(value.result);
}
return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment