brotherton-erpnext/erpnext/public/js/education/lms/components/VideoModal.vue

35 lines
917 B
Vue
Raw Normal View History

2019-03-28 06:50:24 +00:00
<template>
2019-03-28 07:41:00 +00:00
<div class="modal" id="videoModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ title }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span id="close_modal" aria-hidden="true" @click="stopVideo()">&times;</span>
</button>
</div>
<div class="modal-body">
<youtube-player :url="video" :allowfullscreen="'false'"/>
</div>
</div>
</div>
</div>
2019-03-28 06:50:24 +00:00
</template>
<script type="text/javascript">
2019-03-28 07:41:00 +00:00
import YoutubePlayer from './YoutubePlayer.vue'
2019-03-28 06:50:24 +00:00
export default {
2019-03-28 07:41:00 +00:00
name: 'VideoModal',
props: ['title', 'video'],
components: {
YoutubePlayer
},
methods: {
stopVideo() {
$('.yvideo').each(function() {
this.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}', '*')
});
}
}
2019-03-28 06:50:24 +00:00
};
</script>