Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
syncClientServerClock_(done) {
const utcTiming = parseUTCTiming(this.masterXml_);
// No UTCTiming element found in the mpd. Use Date header from mpd request as the
// server clock
if (utcTiming === null) {
this.clientOffset_ = this.masterLoaded_ - Date.now();
return done();
}
if (utcTiming.method === 'DIRECT') {
this.clientOffset_ = utcTiming.value - Date.now();
return done();
}
this.request = this.hls_.xhr({
uri: resolveUrl(this.srcUrl, utcTiming.value),
method: utcTiming.method,