Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

300
Vistas
"VIDEOJS: WARN: Player "media" is already initialized" when it is not

I currently experience a small issue where I receive a warning from video.js which is as following:

VIDEOJS: WARN: Player "media" is already initialized. Options will not be applied.

The bizarre thing is that it has not been initialized. But rather it is within a jQuery's $(document).ready.

The relevant code is:

<script src="//vjs.zencdn.net/5.19.1/video.min.js"></script>

<script>
    $(document).ready(function() {
        var player = videojs('media', {
            fluid: true,
            playbackRates: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]
        });
    });
<script>

It know it has something to do with when how fast these resources get loaded, because every now and then the warning will not appear and the options are applied.

I do need this the player initialized once the "document is ready", though. How can I go about this issue?

Any help I would greatly appreciate!

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

I had the same problem. Videojs gets automatically initialized when the data-setup attribute is present in the <video> tag.

Remove data-setup and the player will not initialize by itself, the warning will not show up anymore when you execute the JS code now:

var player = videojs('media', options);

Now you can define the options and simply do ("media" is the id of your videoplayer):

var options = {
    "playbackRates": [1, 1.5, 2],
};

var video = videojs('media', options);

video.ready(function() {
    // …
});
over 4 years ago · Santiago Trujillo Denunciar

0

I also face the same problem. Videojs gets automatically initialized

Just Remove "data-setup" and the player will not initialize by itself

remove data-setup

over 4 years ago · Santiago Trujillo Denunciar

0

use this code after mounted() in vue

beforeDestroy() {
    if (this.player) {
        this.player.dispose()
    }
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda