Vue.js

  Lo sentimos, esta página está pendiente de traducción al español

Example of a simple Vue3 application that creates a player in the player container

App.vue

<template>
  <div id="player"></div>
</template>

<script>
import { ref } from 'vue';
import pjs from './playerjsloader.js';

export default {
   name: 'Test',
   setup() {
      pjs.then(() => {
         let player = new Playerjs({
            id: 'player',
            file: 'https://plrjs.com/sample.mp4',
         });
      });
   },
};
</script>

<style>
#player {
   width: 100%;
}
</style>

playerjsloader.js

export default new Promise((res) => {
   const script = document.createElement('script');
   script.onload = () => res();
   script.setAttribute(
      'src',
      'https://mysite.com/playerjs.js'
   );
   document.head.appendChild(script);
});

You need to change the selected links to your own.

There is also an example of player integration for an old Vue 2


19.10.26
2024 © PlayerJS

Inicio de sesión

Conectarse

Regístrate gratis

Inscríbete
Al registrarte, aceptas Condiciones del servicio
Iniciar sesión si tienes una cuenta.

Restaurar contraseña

Restaurar
¿Ha olvidado su correo electrónico? Contacte con nosotros