fix: Minor Changes
This commit is contained in:
parent
e6735e418f
commit
56ad5da090
@ -3,7 +3,7 @@
|
|||||||
<section class='video-top-section video-section-bg'>
|
<section class='video-top-section video-section-bg'>
|
||||||
<div>
|
<div>
|
||||||
<div class="embed-responsive embed-responsive-16by9">
|
<div class="embed-responsive embed-responsive-16by9">
|
||||||
<iframe class="embed-responsive-item" :src="'https://www.youtube.com/embed/' + contentData.url" allowfullscreen></iframe>
|
<iframe class="embed-responsive-item" :src="'https://www.youtube.com/embed/' + videoID" allowfullscreen></iframe>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3 row">
|
<div class="mt-3 row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
@ -42,11 +42,14 @@ export default {
|
|||||||
name: 'Video',
|
name: 'Video',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
contentData: ''
|
contentData: '',
|
||||||
|
videoID: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getContent().then(data => this.contentData = data);
|
this.getContent()
|
||||||
|
.then(data => this.contentData = data)
|
||||||
|
.then((contentData) => this.videoID = this.getVideoID(this.contentData.url))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getContent() {
|
getContent() {
|
||||||
@ -54,6 +57,19 @@ export default {
|
|||||||
type: this.type,
|
type: this.type,
|
||||||
content: this.content
|
content: this.content
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getVideoID(link) {
|
||||||
|
if (!Array.prototype.last){
|
||||||
|
Array.prototype.last = function(){
|
||||||
|
return this[this.length - 1];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (link.includes('v=')){
|
||||||
|
return link.split('v=')[1].split('&')[0]
|
||||||
|
}
|
||||||
|
else if (link.includes('youtu.be')) {
|
||||||
|
return link.split('/').last().split('?')[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -64,11 +64,6 @@ export default {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-top-section {
|
|
||||||
padding-top: 3rem !important;
|
|
||||||
padding-bottom: 1rem !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-description-section {
|
.video-description-section {
|
||||||
padding-top: 0em !important;
|
padding-top: 0em !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,6 @@ def get_next_content(current_content, current_content_type, topic):
|
|||||||
content_list = [{'content_type':item.doctype, 'content':item.name} for item in topic.get_contents()]
|
content_list = [{'content_type':item.doctype, 'content':item.name} for item in topic.get_contents()]
|
||||||
current_index = content_list.index({'content': current_content, 'content_type': current_content_type})
|
current_index = content_list.index({'content': current_content, 'content_type': current_content_type})
|
||||||
try:
|
try:
|
||||||
# print(content_list[current_index + 1])
|
|
||||||
return content_list[current_index + 1]
|
return content_list[current_index + 1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user