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

198
Views
¿Usando la instancia requirejs fuera de la definición?

Estoy usando requirejs para determinar las dependencias. Tengo un código que determina el uso de Video.js :

 require.config({ 'paths': { 'bc': 'https://players.brightcove.net/1507807800001/default_default/index.min' }, waitSeconds: 30 }); require(['bc'], function() { var myPlayer = videojs.getPlayers().myPlayerID; myPlayer.on('loadstart', function(){ myPlayer.play(); }) });

También tengo un código que quiere obtener una instancia y usar ese Video.js :

 if (typeof myPlayer != "undefined") { console.log("myPlayer existence true"); myPlayer.stop(); } else { console.log("myPlayer existence false"); }

¿Hay alguna forma de acceder fuera de la definición de Video.js ? Este es un ejemplo de trabajo https://playcode.io/868784/

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puedes definir tu módulo y luego usarlo:

 require.config({ 'paths': { 'bc': 'https://players.brightcove.net/1507807800001/default_default/index.min' }, waitSeconds: 30 }); define('myPlayer', ['bc'], function() { var myPlayer = videojs.getPlayers().myPlayerID; myPlayer.on('loadstart', function(){ myPlayer.play(); }) return myPlayer; });

Vídeo.js:

 require(['myPlayer'], function (myPlayer) { myPlayer.stop(); });
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!