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

522
Views
Error de VideoJS: el elemento o ID proporcionado no es válido

Soy nuevo en videojs y lightning.js. Intenté usar document.querySelector pero sigo recibiendo el mismo error. Pensé que tal vez por el navegador, así que probé en Chrome, Firefox, Edge.

TypeError: El elemento o ID proporcionado no es válido. (videojs) en videojs (video.es.js:27887) en Function._template (App.js:19) en Function.getTemplateFunc (lightning.js:9068) en nuevo componente (lightning.js:9016) en nueva aplicación ( App.js:4) en Stage.element (lightning.js:13634) en Stage.c (lightning.js:13642) en index.js:117, recibo un error en esta línea -> var player = videojs(' mi video')

 import { Lightning, Utils } from '@lightningjs/sdk' import videojs from 'video.js' export default class App extends Lightning.Component { static getFonts() { return [{ family: 'Regular', url: Utils.asset('fonts/Roboto-Regular.ttf') }] } static _template() { var video = document.createElement('video') var source = document.createElement('source') console.log(video); video.setAttribute("id","myvideo"); video.setAttribute("class","video-player"); source.setAttribute("type", 'video/mp4'); source.setAttribute("src", "https://github.com/googleboy0/Programming/raw/main/Dilwale%20Dulhania%20Le%20Jayenge%20-%20Trailer%20(with%20English%20Subtitles).mp4") video.appendChild(source); var player = videojs('myvideo') player.play() } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Está creando un elemento pero nunca lo agrega al documento. Por lo tanto, la biblioteca no puede encontrarlo. (Le está dando una ID, no un elemento real). Consulte los documentos para createElement para saber cómo se hace.

about 4 years ago · Juan Pablo Isaza Report
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!