fix embed options

This commit is contained in:
j 2020-05-30 14:33:04 +02:00
parent d82cd9b6a7
commit 1cc18c52c3
2 changed files with 12 additions and 8 deletions

View file

@ -40,7 +40,7 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
description: Ox._('Embed a Clip or a Full Video'), description: Ox._('Embed a Clip or a Full Video'),
inputs: [ inputs: [
'item', 'position', 'in', 'out', 'annotation', 'title', 'item', 'position', 'in', 'out', 'annotation', 'title',
'showTimeline', 'showAnnotations', 'matchRatio' 'showTimeline', 'showAnnotations', 'showLayers', 'matchRatio', 'timeline'
] ]
}, },
{ {
@ -85,7 +85,7 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
description: Ox._('Embed an Edited Video'), description: Ox._('Embed an Edited Video'),
inputs: [ inputs: [
'edit', 'editMode', 'position', 'edit', 'editMode', 'position',
'showTimeline', 'showAnnotations', 'matchRatio' 'showTimeline', 'showAnnotations', 'showLayers', 'matchRatio', 'timeline'
] ]
} }
].map(function(item, index) { ].map(function(item, index) {
@ -233,8 +233,7 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
data = getData(); data = getData();
if (view == 'document') { if (view == 'document') {
var prefix = type == 'iframe' var prefix = type == 'iframe'
? (pandora.site.site.https ? 'https' : 'http') ? (document.location.protocol + '//' + document.location.host + '/')
+ '://' + pandora.site.site.url + '/'
: '/', : '/',
page = type == 'iframe' ? 'documents' : 'document', page = type == 'iframe' ? 'documents' : 'document',
resolution = 480; resolution = 480;
@ -260,9 +259,12 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
options = Ox.serialize({ options = Ox.serialize({
title: data.title || void 0, title: data.title || void 0,
showTimeline: data.showTimeline || void 0, showTimeline: data.showTimeline || void 0,
timeline: data.timeline || void 0, timeline: data.showTimeline && data.timeline ? data.timeline : void 0,
showAnnotations: data.showAnnotations || void 0, showAnnotations: data.showAnnotations || void 0,
showLayers: data.showAnnotations && data.showLayers ? data.showLayers : void 0, showLayers: data.showAnnotations && data.showLayers &&
data.showLayers.length < pandora.site.layers.length
? data.showLayers.join(',')
: void 0,
matchRatio: Ox.contains(['video', 'edit'], view) ? data.matchRatio || void 0 : void 0, matchRatio: Ox.contains(['video', 'edit'], view) ? data.matchRatio || void 0 : void 0,
showInfo: Ox.contains(['list', 'text'], view) || (view == 'edit' && !!$input.editMode.value()) || void 0 showInfo: Ox.contains(['list', 'text'], view) || (view == 'edit' && !!$input.editMode.value()) || void 0
}, true), }, true),
@ -275,8 +277,7 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
return Ox.encodeHTMLEntities( return Ox.encodeHTMLEntities(
( (
type == 'iframe' type == 'iframe'
? (pandora.site.site.https ? 'https' : 'http') ? (document.location.protocol + '//' + document.location.host + '/')
+ '://' + pandora.site.site.url + '/'
: '/' : '/'
) )
+ ( + (

View file

@ -456,6 +456,9 @@ appPanel
videoFormat: Ox.getVideoFormat(pandora.site.video.formats) videoFormat: Ox.getVideoFormat(pandora.site.video.formats)
}); });
pandora.site.site.url = document.location.host
pandora.site.site.https = document.location.protocol == 'https:'
Ox.Map.GoogleApiKey = pandora.site.site.googleapikey; Ox.Map.GoogleApiKey = pandora.site.site.googleapikey;
// set locale and initialize url controller // set locale and initialize url controller