Compare commits
No commits in common. "7ad121d912b38538299acd32c37dfe6d6e15e8d8" and "9b2fbe2e3f3783ed3fdc4d7b1394a8398cc227d3" have entirely different histories.
7ad121d912
...
9b2fbe2e3f
8 changed files with 12 additions and 103 deletions
|
|
@ -351,11 +351,11 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
||||||
"type": "enum",
|
"type": "enum",
|
||||||
"columnWidth": 90,
|
"columnWidth": 90,
|
||||||
"format": {"type": "ColorLevel", "args": [
|
"format": {"type": "ColorLevel", "args": [
|
||||||
["Public", "Restricted", "Private"]
|
["Public", "Out of Copyright", "Under Copyright", "Private"]
|
||||||
]},
|
]},
|
||||||
"sort": true,
|
"sort": true,
|
||||||
"sortOperator": "+",
|
"sortOperator": "+",
|
||||||
"values": ["Public", "Restricted", "Private", "Unknown"]
|
"values": ["Public", "Out of Copyright", "Under Copyright", "Private", "Unknown"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -66,25 +66,10 @@ def index(request, fragment):
|
||||||
clips = _order_clips(edit, sort)
|
clips = _order_clips(edit, sort)
|
||||||
else:
|
else:
|
||||||
clips = edit.get_clips(request.user)
|
clips = edit.get_clips(request.user)
|
||||||
|
|
||||||
preview = None
|
|
||||||
|
|
||||||
if len(parts) >= 3 and ':' in parts[-1]:
|
|
||||||
ts = ox.parse_timecode(parts[-1])
|
|
||||||
position = 0
|
|
||||||
for clip in clips:
|
|
||||||
c = clip.json()
|
|
||||||
if ts > position and ts < position + c['duration']:
|
|
||||||
start = ts - position + c.get('in', 0)
|
|
||||||
preview = '/%s/%sp%0.03f.jpg' % (clip.item.public_id, resolution, float(start))
|
|
||||||
break
|
|
||||||
position += c['duration']
|
|
||||||
if not preview:
|
|
||||||
clip = clips.first()
|
clip = clips.first()
|
||||||
if clip:
|
if clip:
|
||||||
start = clip.json()['in']
|
start = clip.json()['in']
|
||||||
preview = '/%s/%sp%0.03f.jpg' % (clip.item.public_id, resolution, float(start))
|
preview = '/%s/%sp%0.03f.jpg' % (clip.item.public_id, resolution, float(start))
|
||||||
if preview:
|
|
||||||
context['preview'] = request.build_absolute_uri(preview)
|
context['preview'] = request.build_absolute_uri(preview)
|
||||||
else:
|
else:
|
||||||
type = 'item'
|
type = 'item'
|
||||||
|
|
|
||||||
|
|
@ -543,9 +543,7 @@ pandora.ui.infoView = function(data, isMixed) {
|
||||||
|
|
||||||
function formatValue(key, value) {
|
function formatValue(key, value) {
|
||||||
var ret;
|
var ret;
|
||||||
if (key == 'date' && (!value || value.split('-').length < 4)) {
|
if (nameKeys.indexOf(key) > -1) {
|
||||||
ret = pandora.formatDate(value);
|
|
||||||
elif (nameKeys.indexOf(key) > -1) {
|
|
||||||
ret = formatLink(value.split(', '), 'name');
|
ret = formatLink(value.split(', '), 'name');
|
||||||
} else if (
|
} else if (
|
||||||
listKeys.indexOf(key) > -1 && Ox.getObjectById(pandora.site.itemKeys, key).type[0] == 'date'
|
listKeys.indexOf(key) > -1 && Ox.getObjectById(pandora.site.itemKeys, key).type[0] == 'date'
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,6 @@ window.VideoPlayer = function(options) {
|
||||||
|
|
||||||
self.controls = document.createElement('div')
|
self.controls = document.createElement('div')
|
||||||
self.controls.classList.add('mx-controls')
|
self.controls.classList.add('mx-controls')
|
||||||
if (options.poster) {
|
|
||||||
self.controls.classList.add('poster')
|
|
||||||
}
|
|
||||||
//self.controls.style.display = "none"
|
//self.controls.style.display = "none"
|
||||||
if (self.options.controls) {
|
if (self.options.controls) {
|
||||||
var ratio = `aspect-ratio: ${self.options.aspectratio};`
|
var ratio = `aspect-ratio: ${self.options.aspectratio};`
|
||||||
|
|
@ -48,13 +45,6 @@ window.VideoPlayer = function(options) {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx-controls.poster {
|
|
||||||
background-image: url(${self.options.poster});
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: contain;
|
|
||||||
background-blend-mode: overlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx-controls .toggle {
|
.mx-controls .toggle {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
@ -170,7 +160,6 @@ window.VideoPlayer = function(options) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
if (that.paused) {
|
if (that.paused) {
|
||||||
self.controls.classList.remove('poster')
|
|
||||||
that.play()
|
that.play()
|
||||||
} else {
|
} else {
|
||||||
that.pause()
|
that.pause()
|
||||||
|
|
@ -204,7 +193,6 @@ window.VideoPlayer = function(options) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (that.paused && !failed) {
|
if (that.paused && !failed) {
|
||||||
self.controls.classList.remove('poster')
|
|
||||||
that.play()
|
that.play()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -326,7 +314,6 @@ window.VideoPlayer = function(options) {
|
||||||
toggle.querySelector('div').innerHTML = icon.pause
|
toggle.querySelector('div').innerHTML = icon.pause
|
||||||
self.controls.style.opacity = '0'
|
self.controls.style.opacity = '0'
|
||||||
unblock.remove()
|
unblock.remove()
|
||||||
self.controls.classList.remove('poster')
|
|
||||||
that.play()
|
that.play()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -90,21 +90,6 @@ async function sortClips(edit, sort) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getClip(edit, position) {
|
|
||||||
const response = {}
|
|
||||||
let pos = 0
|
|
||||||
edit.clips.forEach(function(clip) {
|
|
||||||
if (clip.position < position && clip.position + clip.duration > position) {
|
|
||||||
response.item = clip.item
|
|
||||||
response.position = position - clip.position
|
|
||||||
if (clip['in']) {
|
|
||||||
response.position += clip['in']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return response
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadEdit(id, args) {
|
async function loadEdit(id, args) {
|
||||||
var data = window.data = {}
|
var data = window.data = {}
|
||||||
data.id = id
|
data.id = id
|
||||||
|
|
@ -122,7 +107,7 @@ async function loadEdit(id, args) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.edit = response['data']
|
data.edit = response['data']
|
||||||
if (data.edit.status !== 'public') {
|
if (['public', 'featured'].indexOf(data.edit) == -1) {
|
||||||
return {
|
return {
|
||||||
site: data.site,
|
site: data.site,
|
||||||
error: {
|
error: {
|
||||||
|
|
@ -212,15 +197,6 @@ async function loadEdit(id, args) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (data.layers[pandora.subtitleLayer]) {
|
|
||||||
var previous;
|
|
||||||
data.layers[pandora.subtitleLayer].forEach(annotation => {
|
|
||||||
if (previous) {
|
|
||||||
previous.out = annotation['in']
|
|
||||||
}
|
|
||||||
previous = annotation
|
|
||||||
})
|
|
||||||
}
|
|
||||||
var value = []
|
var value = []
|
||||||
pandora.layerKeys.forEach(layer => {
|
pandora.layerKeys.forEach(layer => {
|
||||||
if (!data.layers[layer]) {
|
if (!data.layers[layer]) {
|
||||||
|
|
@ -239,26 +215,14 @@ async function loadEdit(id, args) {
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
var layerClass = ""
|
value.push('<div class="layer">' + html.join('\n') + '</div>')
|
||||||
if (layerData.isSubtitles) {
|
|
||||||
layerClass = " is-subtitles"
|
|
||||||
}
|
|
||||||
value.push('<div class="layer'+layerClass+'">' + html.join('\n') + '</div>')
|
|
||||||
})
|
})
|
||||||
data.value = value.join('\n')
|
data.value = value.join('\n')
|
||||||
|
|
||||||
data.title = data.edit.name
|
data.title = data.edit.name
|
||||||
data.byline = data.edit.description
|
data.byline = data.edit.description
|
||||||
data.link = `${pandora.proto}://${data.site}/edits/${data.edit.id}`
|
data.link = `${pandora.proto}://${data.site}/edits/${data.edit.id}`
|
||||||
let poster = data.edit.posterFrames[0]
|
data.poster = data.videos[0].src.split('/' + pandora.resolution)[0] + `/${pandora.resolution}p${data.videos[0].in}.jpg`
|
||||||
if (args.parts[2] && args.parts[2].indexOf(':') > -1) {
|
|
||||||
poster = getClip(data.edit, parseDuration(args.parts[2]))
|
|
||||||
}
|
|
||||||
if (poster && poster.item) {
|
|
||||||
data.poster = `${pandora.proto}://${data.site}/${poster.item}/${pandora.resolution}${poster.position.toFixed(3)}.jpg`
|
|
||||||
} else {
|
|
||||||
data.poster = data.videos[0].src.split('/48')[0] + `/${pandora.resolution}p${data.videos[0].in.toFixed(3)}.jpg`
|
|
||||||
}
|
|
||||||
data.aspectratio = data.edit.clips[0].videoRatio
|
data.aspectratio = data.edit.clips[0].videoRatio
|
||||||
data.duration = data.edit.duration
|
data.duration = data.edit.duration
|
||||||
return data
|
return data
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@ async function loadData(id, args) {
|
||||||
"id",
|
"id",
|
||||||
"title",
|
"title",
|
||||||
"director",
|
"director",
|
||||||
"year",
|
|
||||||
"date",
|
|
||||||
"source",
|
"source",
|
||||||
"summary",
|
"summary",
|
||||||
"streams",
|
"streams",
|
||||||
|
|
@ -47,11 +45,6 @@ async function loadData(id, args) {
|
||||||
} else {
|
} else {
|
||||||
data.byline = data.item.director ? data.item.director.join(', ') : ''
|
data.byline = data.item.director ? data.item.director.join(', ') : ''
|
||||||
}
|
}
|
||||||
if (data.item.year) {
|
|
||||||
data.byline += ' (' + data.item.year + ')'
|
|
||||||
} else if (data.item.date) {
|
|
||||||
data.byline += ' (' + data.item.date.split('-')[0] + ')'
|
|
||||||
}
|
|
||||||
data.link = `${pandora.proto}://${data.site}/${data.item.id}/info`
|
data.link = `${pandora.proto}://${data.site}/${data.item.id}/info`
|
||||||
let poster = pandora.site.user.ui.icons == 'posters' ? 'poster' : 'icon'
|
let poster = pandora.site.user.ui.icons == 'posters' ? 'poster' : 'icon'
|
||||||
data.icon = `${pandora.proto}://${data.site}/${data.item.id}/${poster}.jpg`
|
data.icon = `${pandora.proto}://${data.site}/${data.item.id}/${poster}.jpg`
|
||||||
|
|
@ -112,15 +105,6 @@ async function loadData(id, args) {
|
||||||
duration: duration
|
duration: duration
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (data.layers[pandora.subtitleLayer]) {
|
|
||||||
var previous;
|
|
||||||
data.layers[pandora.subtitleLayer].forEach(annotation => {
|
|
||||||
if (previous) {
|
|
||||||
previous.out = annotation['in']
|
|
||||||
}
|
|
||||||
previous = annotation
|
|
||||||
})
|
|
||||||
}
|
|
||||||
var value = []
|
var value = []
|
||||||
Object.keys(data.layers).forEach(layer => {
|
Object.keys(data.layers).forEach(layer => {
|
||||||
var html = []
|
var html = []
|
||||||
|
|
@ -143,11 +127,7 @@ async function loadData(id, args) {
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
var layerClass = ""
|
value.push('<div class="layer">' + html.join('\n') + '</div>')
|
||||||
if (layerData.isSubtitles) {
|
|
||||||
layerClass = " is-subtitles"
|
|
||||||
}
|
|
||||||
value.push('<div class="layer'+layerClass+'">' + html.join('\n') + '</div>')
|
|
||||||
})
|
})
|
||||||
data.value = value.join('\n')
|
data.value = value.join('\n')
|
||||||
|
|
||||||
|
|
@ -157,11 +137,6 @@ async function loadData(id, args) {
|
||||||
} else {
|
} else {
|
||||||
data.byline = data.item.director ? data.item.director.join(', ') : ''
|
data.byline = data.item.director ? data.item.director.join(', ') : ''
|
||||||
}
|
}
|
||||||
if (data.item.year) {
|
|
||||||
data.byline += ' (' + data.item.year + ')'
|
|
||||||
} else if (data.item.date) {
|
|
||||||
data.byline += ' (' + data.item.date.split('-')[0] + ')'
|
|
||||||
}
|
|
||||||
data.link = `${pandora.proto}://${data.site}/${data.item.id}/${data["in"]},${data.out}`
|
data.link = `${pandora.proto}://${data.site}/${data.item.id}/${data["in"]},${data.out}`
|
||||||
data.poster = `${pandora.proto}://${data.site}/${data.item.id}/${pandora.resolution}p${data["in"]}.jpg`
|
data.poster = `${pandora.proto}://${data.site}/${data.item.id}/${pandora.resolution}p${data["in"]}.jpg`
|
||||||
data.aspectratio = data.item.videoRatio
|
data.aspectratio = data.item.videoRatio
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,6 @@ pandoraAPI("init").then(response => {
|
||||||
if (subtitleLayer) {
|
if (subtitleLayer) {
|
||||||
layerKeys.push(subtitleLayer.id)
|
layerKeys.push(subtitleLayer.id)
|
||||||
}
|
}
|
||||||
pandora.subtitleLayer = subtitleLayer.id
|
|
||||||
pandora.site.layers.map(layer => {
|
pandora.site.layers.map(layer => {
|
||||||
return layer.id
|
return layer.id
|
||||||
}).filter(layer => {
|
}).filter(layer => {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ function renderItemInfo(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderItem(data) {
|
function renderItem(data) {
|
||||||
|
window.item = window.item || {}
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
return renderError(data)
|
return renderError(data)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue