Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
analizando m3u8 para el reproductor de video javascript

Estoy tratando de reproducir video de transmisión m3u8 con mi reproductor de Javascript. Pero parece que tengo un problema de análisis cuando se trata de administrar m3u8. ¿Hay algo mal en esta función?

 prototype.parseManifest = function (data) { var lastSlash = this._liveManifestUrl.lastIndexOf("/"); var baseUrl = this._liveManifestUrl.substring(0, lastSlash + 1); var lastPoint = this._liveManifestUrl.lastIndexOf("."); var extension = this._liveManifestUrl.substring(lastPoint + 1); var result = []; var count = 0; if(extension == 'json'){ var fragments = JSON.parse(data); for (var i = 0; i < fragments.length; i++){ result.push(baseUrl + fragments[i].fragment); count++; } } else if(extension == 'm3u8') { var fragments = data.split(/\r?\n/); for (var i = 0; i < fragments.length; i++){ if(fragments[i].charAt(0) != '#' && fragments[i].length > 0){ result.push(baseUrl + fragments[i]); count++; } } } else { console.log('Manifest extension unknown : ' + extension ); } console.log("Manifest updated: " + count + " fragments were found. Last fragment is " + result[count - 1]); return result; };
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!