-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for Vue 3 Support in Plyr.io #2850
Comments
// components/videoplayer/VideoPlayer.vue
<script setup>
import Plyr from 'plyr';
import 'plyr/dist/plyr.css';
import { ref, defineProps, onMounted, onUnmounted } from 'vue';
const props = defineProps({
src: String,
});
const player = ref();
const playerId = `video-player-${Math.random().toString(36).substr(2, 9)}`; // generate unique ID
const createPlayer = (source, cover) => {
player.value = new Plyr(`#${playerId}`, {
controls: [
'play-large',
'play',
'progress',
'current-time',
'mute',
'volume',
'captions',
'fullscreen',
],
});
player.value.on('enterfullscreen', () => {
console.log('enterfullscreen');
});
player.value.on('exitfullscreen', () => {
console.log('exitfullscreen');
});
};
onMounted(() => {
createPlayer();
});
onUnmounted(() => {
player.value.destroy();
});
</script>
<template>
<video
:src="src"
:id="playerId"
crossorigin
playsinline
data-plyr-config="{}"
></video>
</template> |
how i can pass provider for (youtube or vimeo )
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear Plyr.io Team,
I hope you are doing well.
I am currently working on a project using Vue 3 and would love to integrate Plyr.io for media playback. However, I couldn't find clear documentation on Vue 3 compatibility.
Could you please confirm if Plyr.io officially supports Vue 3? If not, are there any plans for future support?
The text was updated successfully, but these errors were encountered: