Skip to content

Instantly share code, notes, and snippets.

@zopyx
Created December 3, 2017 14:52
Show Gist options
  • Save zopyx/f7c93b1e3d65273ee66c33d83d4a5c5a to your computer and use it in GitHub Desktop.
Save zopyx/f7c93b1e3d65273ee66c33d83d4a5c5a to your computer and use it in GitHub Desktop.
Vue.component('media', {
props: ['url', 'mediatype'],
template:'\
<video class="video-tile" width="320" height="240" controls> \
<source v-if="mediatype==\'youtube\'" :src="url" type="video/youtube"> \
<source v-if="mediatype==\'vimeo\'" :src="url" type="video/vimeo"> \
</video> ',
data: function() {
return {
url: this.url
}
},
mounted: function() {
alert(this.url);
console.log(this);
$('.video-tile').mediaelementplayer();
alert(this.url);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment