Commit 17cc845c authored by Anton's avatar Anton

Rename Video to Media

parent e259669f
Pipeline #14257 passed with stage
in 33 seconds
......@@ -59,7 +59,7 @@
'Image': 'photo',
'IFrame': 'picture in picture',
'Internal-Link': 'link',
'Video': 'local movies',
'Media': 'local movies',
'Text': 'subject',
'Title': 'title',
'Annotation-List': 'comment'
......
......@@ -5,7 +5,7 @@
q-list-header
q-btn(outline, size="sm", style="margin-right: 0.5em",
@click="handleClickUnsetCurrentTimeline", icon="keyboard backspace" label="Timelines")
div {{currentTimeline.title}} (Videos)
div {{currentTimeline.title}} (Media)
template(v-else)
q-list-header Timelines
......@@ -25,25 +25,25 @@
template(v-if="currentTimeline")
// loading, nothing here
template(v-if="currentVideos.length === 0")
template(v-if="loadingVideos")
template(v-if="currentMedia.length === 0")
template(v-if="loadingMedia")
q-item
q-item-side
q-spinner(style="margin-right: 1em")
q-item-main Loading Videos
q-item-main Loading Media
template(v-else)
q-item No Videos Found!
q-item No Media Found!
// videos, annotations
// media, annotations
template(v-else)
template(v-for="(entry, i) in currentVideos")
template(v-for="(entry, i) in currentMedia")
template(v-if="i > 0")
q-item-separator
q-item.video-item
q-item.media-item
q-item-side
q-icon(
draggable="true",
@dragstart.native="event => {handleItemDragStart(event, entry.annotation, 'CellVideo')}",
@dragstart.native="event => {handleItemDragStart(event, entry.annotation, 'CellMedia')}",
name="local movies", style="font-size: 1.8rem")
q-icon(
draggable="true",
......@@ -70,8 +70,8 @@
return {
timelines: [],
currentTimeline: null,
currentVideos: [],
loadingVideos: false
currentMedia: [],
loadingMedia: false
}
},
mounted () {
......@@ -84,18 +84,18 @@
methods: {
async handleTimelineItemClick (events, timeline) {
this.currentTimeline = timeline
this.currentVideos = []
this.loadingVideos = true
this.currentMedia = []
this.loadingMedia = true
const query = {
type: 'Annotation',
'body.purpose': 'linking',
'body.type': 'Video',
'body.type': { $in: ['Video', 'Audio'] },
'target.id': this.currentTimeline.id
}
const result = await this.$store.dispatch('annotations/find', query)
const videos = result.items
const media = result.items
const entries = []
for (let annotation of videos) {
for (let annotation of media) {
let meta = {}
try {
meta = await this.$store.dispatch('metadata/get', annotation)
......@@ -107,21 +107,21 @@
entry.title = meta.title || this.$t('labels.title_unknown')
entries.push(entry)
}
this.currentVideos = entries
this.loadingVideos = false
this.currentMedia = entries
this.loadingMedia = false
},
handleClickUnsetCurrentTimeline () {
this.currentTimeline = null
this.currentVideos = []
this.currentMedia = []
},
handleItemDragStart (event, item, component = 'CellVideo') {
handleItemDragStart (event, item, component = 'CellMedia') {
const resourceCell = {
component,
config: {},
data: {
id: item.id,
sourceUuid: item._uuid,
content: component === 'CellVideo' ? item.body.source.id : item.id
content: component === 'CellMedia' ? item.body.source.id : item.id
}
}
event.dataTransfer.setData('text/plain', JSON.stringify(resourceCell))
......@@ -135,7 +135,7 @@
.piecemaker-source-container
overflow auto
.video-item
.media-item
.q-item-side
width 20%
......
......@@ -58,14 +58,14 @@ import { DateTime, Interval } from 'luxon'
import constants from 'mbjs-data-models/src/constants'
import CellInfo from '../CellInfo'
import Username from '../../../shared/elements/Username'
import VideoTitle from '../../../shared/elements/VideoTitle'
import MediaTitle from '../../../shared/elements/MediaTitle'
import MarkdownDisplay from '../../../shared/elements/MarkdownDisplay'
export default {
components: {
CellInfo,
Username,
VideoTitle,
MediaTitle,
MarkdownDisplay
},
props: ['cell', 'display', 'preview', 'visible'],
......@@ -102,7 +102,7 @@ export default {
}
await this.fetchAnnotations()
this.$root.$on('video-time-changed', this.onVideoTimeChanged)
this.$root.$on('video-time-changed', this.onMediaTimeChanged)
this.$root.$on('grid-datetime', this.onGridDateTime)
},
computed: {
......@@ -126,11 +126,11 @@ export default {
}
},
methods: {
onVideoTimeChanged (time, globalTime, origin = undefined) {
onMediaTimeChanged (time, globalTime, origin = undefined) {
if (!this.visible) return
// if (Date.now() - this.lastSignal < 500) return
// this.lastSignal = Date.now()
if (!origin || (origin.type === 'Video' && this.video.target.id === origin.origin.target.id)) {
if (!origin || (origin.type === 'Media' && this.video.target.id === origin.origin.target.id)) {
// console.debug('CellAnnotationList: received video-time-changed event', time, globalTime, origin)
this.playerTime = time
this.gridTime = globalTime
......@@ -144,7 +144,7 @@ export default {
},
onGridDateTime (datetime, origin = undefined) {
if (!this.visible) return
if (!origin || (origin.type === 'Video' && this.video.target.id === origin.origin.target.id)) {
if (!origin || (origin.type === 'Media' && this.video.target.id === origin.origin.target.id)) {
console.debug('CellAnnotationList: received grid-datetime event', datetime, origin)
this.gridTime = datetime
}
......
<template lang="pug">
div(v-if="visible", :class="{'display-preview': preview, 'display-full': display}")
q-window-resize-observable(@resize="resizeVideo")
q-window-resize-observable(@resize="resizeMedia")
template(v-if="display")
video-player(
media-player(
:class="{ hidePlayer: !showPlayer }",
ref='videoPlayer',
:annotation="video || fauxVideo",
:annotation="video || fauxMedia",
@ready="handlePlayerReady",
@play="handlePlayerPlaying",
@canplay:once="onCanPlay",
......@@ -15,19 +15,19 @@
:no-volume-panel="true")
template(v-else)
cell-info(:cell="cell", type="Video Cell")
cell-info(:cell="cell", type="Media Cell")
</template>
<script>
import CellInfo from '../CellInfo'
import { VideoPlayer } from '../../../shared'
import { MediaPlayer } from '../../../shared'
import { DateTime, Interval } from 'luxon'
export default {
components: {
CellInfo,
VideoPlayer
MediaPlayer
},
props: ['cell', 'display', 'preview', 'visible'],
data () {
......@@ -40,10 +40,10 @@
}
},
computed: {
fauxVideo () {
fauxMedia () {
return {
body: {
type: 'Video',
type: 'Media',
purpose: 'linking',
source: {
id: this.cell ? this.cell.data.content : undefined
......@@ -82,13 +82,13 @@
}
const _this = this
this.$root.$on('grid-datetime', datetime => {
console.debug('CellVideo: received grid-datetime', datetime.toISO())
console.debug('CellMedia: received grid-datetime', datetime.toISO())
_this.setPlayerTimeFromDateTime(datetime)
})
this.$root.$on('annotation-trigger', (annotation, annotationGlobalTime) => {
if (!_this.video) return
if (_this.video.target && annotation.target.id === _this.video.target.id) {
console.debug('CellVideo: received annotation-trigger', annotation.id, annotationGlobalTime.toISO())
console.debug('CellMedia: received annotation-trigger', annotation.id, annotationGlobalTime.toISO())
_this.setPlayerTimeFromDateTime(annotationGlobalTime)
}
})
......@@ -103,7 +103,7 @@
}
}
},
resizeVideo () {
resizeMedia () {
if (this.$refs) {
let player = this.$refs.videoPlayer
if (player) {
......@@ -128,7 +128,7 @@
},
getSignature () {
if (this.video) {
return { origin: this.video, type: 'Video' }
return { origin: this.video, type: 'Media' }
}
else {
return { origin: this.cell, type: '2DCell' }
......@@ -141,7 +141,7 @@
const movieTime = Interval.fromDateTimes(this.videoTime, datetime)
.toDuration()
.as('seconds')
console.debug('CellVideo: setting player to second', movieTime)
console.debug('CellMedia: setting player to second', movieTime)
this.player.currentTime(movieTime)
}
catch (e) {
......@@ -152,7 +152,7 @@
handlePlayerReady (player) {
this.$root.$emit('video-loaded', this.getSignature())
this.player = player
this.resizeVideo()
this.resizeMedia()
},
handlePlayerPlaying () {
this.$root.$emit('video-started-playing', this.getSignature())
......
......@@ -3,7 +3,7 @@ import CellTitle from './CellTitle'
import CellImage from './CellImage'
import CellIFrame from './CellIFrame'
import CellInternalLink from './CellInternalLink'
import CellVideo from './CellVideo'
import CellMedia from './CellMedia'
import CellAnnotationList from './CellAnnotationList'
export default {
......@@ -12,6 +12,6 @@ export default {
CellImage,
CellIFrame,
CellInternalLink,
CellVideo,
CellMedia,
CellAnnotationList
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment