Compare commits
No commits in common. "3e6e6077d2604caab08093ab3c9df8de6b666ae3" and "27cc1a81fd74d792b5d37cd4b2b03749c2e616b3" have entirely different histories.
3e6e6077d2
...
27cc1a81fd
3 changed files with 16 additions and 55 deletions
|
|
@ -49,24 +49,6 @@
|
||||||
//transition: opacity 0.4s;
|
//transition: opacity 0.4s;
|
||||||
|
|
||||||
}
|
}
|
||||||
.text {
|
|
||||||
.layer {
|
|
||||||
.title {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
&.active {
|
|
||||||
.title {
|
|
||||||
display: block
|
|
||||||
}
|
|
||||||
padding-bottom: 4px;
|
|
||||||
}
|
|
||||||
.annotation {
|
|
||||||
&.active {
|
|
||||||
padding-bottom: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.annotation {
|
.annotation {
|
||||||
//min-height: 100vh;
|
//min-height: 100vh;
|
||||||
.frame {
|
.frame {
|
||||||
|
|
|
||||||
|
|
@ -72,16 +72,11 @@ function timeupdate(event) {
|
||||||
var aout = parseFloat(annot.dataset.out)
|
var aout = parseFloat(annot.dataset.out)
|
||||||
if (ain <= currentTime && aout > currentTime) {
|
if (ain <= currentTime && aout > currentTime) {
|
||||||
annot.style.display = ''
|
annot.style.display = ''
|
||||||
annot.classList.add('active')
|
|
||||||
annot.parentElement.classList.add('active')
|
|
||||||
} else {
|
} else {
|
||||||
annot.style.display = 'none'
|
annot.style.display = 'none'
|
||||||
annot.classList.remove('active')
|
|
||||||
if (!annot.parentElement.querySelector('.active')) {
|
|
||||||
annot.parentElement.classList.remove('active')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
if (event.target.currentTime >= out_) {
|
if (event.target.currentTime >= out_) {
|
||||||
/*
|
/*
|
||||||
|
|
@ -450,22 +445,11 @@ function renderSingleMode(config) {
|
||||||
updatePlayer(config.video, frame, config['in'], config['out'], src, config)
|
updatePlayer(config.video, frame, config['in'], config['out'], src, config)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
config.layers.forEach(layer => {
|
|
||||||
var text_layer = document.createElement('div')
|
|
||||||
text_layer.classList.add('layer')
|
|
||||||
text_layer.classList.add(layer)
|
|
||||||
var title = document.createElement('div')
|
|
||||||
title.classList.add('title')
|
|
||||||
title.innerText = layer.charAt(0).toUpperCase() + layer.slice(1);
|
|
||||||
text_layer.appendChild(title)
|
|
||||||
config.annotations.forEach(clip => {
|
config.annotations.forEach(clip => {
|
||||||
var values = []
|
var values = []
|
||||||
clip.annotations.forEach(a => {
|
clip.annotations.forEach(a => {
|
||||||
if (a.layer == layer) {
|
|
||||||
values.push(a.value.replace(/src="\//g, `src="${streamPrefix}/`).replace(/href="\//g, `href="${pandoraURL}/`))
|
values.push(a.value.replace(/src="\//g, `src="${streamPrefix}/`).replace(/href="\//g, `href="${pandoraURL}/`))
|
||||||
}
|
|
||||||
})
|
})
|
||||||
if (values.length) {
|
|
||||||
values = values.join('<br><br>')
|
values = values.join('<br><br>')
|
||||||
var annot = document.createElement('div')
|
var annot = document.createElement('div')
|
||||||
annot.classList.add('annotation')
|
annot.classList.add('annotation')
|
||||||
|
|
@ -474,12 +458,7 @@ function renderSingleMode(config) {
|
||||||
annot.dataset['in'] = clip.annotations[0]['in']
|
annot.dataset['in'] = clip.annotations[0]['in']
|
||||||
annot.dataset['out'] = clip.annotations[0]['out']
|
annot.dataset['out'] = clip.annotations[0]['out']
|
||||||
annot.style.display = 'none'
|
annot.style.display = 'none'
|
||||||
text_layer.appendChild(annot)
|
text.appendChild(annot)
|
||||||
}
|
|
||||||
})
|
|
||||||
if (text_layer.querySelector('.annotation')) {
|
|
||||||
text.appendChild(text_layer)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
if (frame) {
|
if (frame) {
|
||||||
updatePlayer(config.video, frame, config['in'], config['out'], src, config)
|
updatePlayer(config.video, frame, config['in'], config['out'], src, config)
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,9 @@ class PandoraScroll extends HTMLElement {
|
||||||
config[a.name] = a.value != 'false'
|
config[a.name] = a.value != 'false'
|
||||||
}
|
}
|
||||||
if (a.name == 'layers') {
|
if (a.name == 'layers') {
|
||||||
config[a.name] = a.value.trim().split(' ')
|
config[a.name] = a.value.split(' ')
|
||||||
} else if (a.name == 'split') {
|
} else if (a.name == 'split') {
|
||||||
config[a.name] = a.value.trim().split(' ')
|
config[a.name] = a.value.split(' ')
|
||||||
} else if (['in', 'out'].indexOf(a.name) > -1) {
|
} else if (['in', 'out'].indexOf(a.name) > -1) {
|
||||||
config[a.name] = parseTime(a.value)
|
config[a.name] = parseTime(a.value)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue