Created
December 3, 2017 14:52
-
-
Save zopyx/f7c93b1e3d65273ee66c33d83d4a5c5a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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