Created
December 20, 2018 01:12
-
-
Save rsimmons/9d2115525efc97a0363812732542cdde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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