Skip to content

Commit d50df81

Browse files
committed
動画検索対象切り替え修正
スタイル、サムネイル画像エラー対応、ファイル名変更
1 parent 26d63c1 commit d50df81

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

src/components/EditLessonScreenInner3.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@
4848
v-if="v.videoUrl"
4949
class="SearchResultButton"
5050
color="#338dce"
51-
@click="registerVideoUrl(v.videoUrl)"
51+
@click="
52+
registerVideoUrl(
53+
v.videoUrl,
54+
v.videoTitle,
55+
v.videoThumbnailUrl
56+
)
57+
"
5258
>
5359
<v-icon color="white"> mdi-link </v-icon>
5460
{{
@@ -190,8 +196,10 @@ export default class EditLessonScreenInner3 extends Vue {
190196
}
191197
}
192198
193-
private registerVideoUrl(url: string) {
199+
private registerVideoUrl(url: string, title: string, thumbnailUrl: string) {
194200
this.tempFormData.videoUrl = url
201+
this.tempFormData.videoTitle = title
202+
this.tempFormData.videoThumbnailUrl = thumbnailUrl
195203
}
196204
197205
private pageChange(pageNumber: number) {
@@ -232,13 +240,14 @@ export default class EditLessonScreenInner3 extends Vue {
232240
}
233241
234242
private mapJunyiacademy(v: Movie): formData {
243+
const videoId: string = v.inherentProperties.url.slice(-11)
235244
return {
236245
videoUrl: v.inherentProperties.url,
237246
videoTitle: v.title,
238247
videoSubTitle: '',
239248
videoDescription: v.description,
240249
videoPlayTime: '',
241-
videoThumbnailUrl: v.inherentProperties.thumbnailUrl,
250+
videoThumbnailUrl: `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`,
242251
}
243252
}
244253

src/components/EditorInputFieldPickable.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<template>
22
<div>
3-
<span v-if="title" class="EditorField-Title"
4-
>{{ title }}
5-
<movie-selector v-if="selector" @change="$emit('changeMovie', $event)" />
6-
</span>
3+
<span v-if="title" class="EditorField-Title">{{ title }}</span>
4+
<movie-selector
5+
v-if="selector"
6+
class="EditorField-Selector"
7+
@change="$emit('changeMovie', $event)"
8+
/>
79
<div class="EditorField-Form">
810
<editor-input-field
911
:value="value"
@@ -84,12 +86,16 @@ export default Vue.extend({
8486

8587
<style lang="scss" scoped>
8688
.EditorField-Title {
87-
display: flex;
89+
display: inline-flex;
8890
font-size: 16px;
8991
font-weight: bold;
9092
color: $color-white;
9193
margin-bottom: 4px;
9294
}
95+
.EditorField-Selector {
96+
display: inline-flex;
97+
margin-bottom: 8px;
98+
}
9399
.EditorField-Form {
94100
display: flex;
95101

src/static/data/movie-source.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"sourceType": "NHK",
44
"name": "NHK For Schoolの動画",
5-
"dataFile": "movies2-nhk.json"
5+
"dataFile": "movies-nhk.json"
66
},
77
{
88
"sourceType": "junyiacademy",
File renamed without changes.

0 commit comments

Comments
 (0)