Last active
November 9, 2021 18:37
-
-
Save fernando-mc/24b723986beccb1351fda48def85d576 to your computer and use it in GitHub Desktop.
Vue and Mux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<video | |
id="my-player" class="video-js vjs-16-9" controls preload="auto" width="100%"> | |
</video> | |
</template> | |
<script> | |
import videojs from '@mux/videojs-kit'; | |
import '@mux/videojs-kit/dist/index.css'; | |
export default { | |
name: "Video", | |
mounted() { | |
this.$nextTick(function () { | |
const player = videojs('my-player', { | |
timelineHoverPreviews: false, | |
plugins: { | |
mux: { | |
debug: false, | |
data: { | |
env_key: 'ENV_KEY_HERE', | |
video_title: 'Example Title' | |
} | |
} | |
} | |
}); | |
player.src({ | |
src: "MY_SOURCE_VIDEO_PLAYBACK_ID", | |
type: "video/mux", | |
}); | |
}) | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment