Need help using Media Element with Nuxt
[issue link]Hi guys,
Is anyone try this with Nuxt? I’m trying to create a components with Media Element but I got this error MediaElement is not a constructor. Here is my file:
<template>
<video width="320" height="240">
<source type="video/mp4" src="video.mp4" />
</video>
</template>
<script>
let MediaElementPlayer
if (process.browser) {
MediaElementPlayer= require('mediaelement')
}
export default {
mounted () {
let player = new MediaElementPlayer('video', {
pluginPath: 'https://cdnjs.com/libraries/mediaelement/',
success: function (mediaElement, originalNode, instance) {
}
})
player.on('play', () => {
this.$emit('play')
})
}
}
</script>
Thanks!