Vue.js

  抱歉,此页面正在等待翻译成土耳其语

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.12.11
2024 © PlayerJS

登录

登录

免费注册

注册
注册即表示您同意服务条款
登录(如果您有帐户)

恢复密码

恢复
忘记电子邮件?联系我们