diff --git a/pandora/0xdb.jsonc b/pandora/0xdb.jsonc index 483509977..4f481edf3 100644 --- a/pandora/0xdb.jsonc +++ b/pandora/0xdb.jsonc @@ -557,7 +557,8 @@ // fixme: there should be no magic applied to this file "id": "{{settings.SITEID}}", "name": "{{settings.SITENAME}}", - "url": "{{settings.URL}}" + "url": "{{settings.URL}}", + "videoprefix": "" }, "sitePages": [ {"id": "about", "title": "About"}, diff --git a/pandora/app/config.py b/pandora/app/config.py index 0545a0855..0eded5614 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -28,6 +28,7 @@ def load_config(): config['site']['name'] = settings.SITENAME config['site']['sectionName'] = settings.SITENAME config['site']['url'] = settings.URL + config['site']['videoprefix'] = settings.VIDEO_PREFIX config['keys'] = {} for key in config['itemKeys']: diff --git a/pandora/settings.py b/pandora/settings.py index 10cdd5e16..0615aba04 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -75,9 +75,13 @@ MEDIA_ROOT = normpath(join(PROJECT_ROOT, '..', 'data')) STATIC_ROOT = normpath(join(PROJECT_ROOT, '..', 'static')) TESTS_ROOT = join(PROJECT_ROOT, 'tests') +#if videos are served from another subdomain +VIDEO_PREFIX = '' + # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" + MEDIA_URL = '/data/' STATIC_URL = '/static/' diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js index 6fe192c74..5f945014e 100644 --- a/static/js/pandora/item.js +++ b/static/js/pandora/item.js @@ -64,7 +64,7 @@ pandora.ui.item = function() { }); pandora.site.video.resolutions.forEach(function(resolution) { video[resolution] = Ox.range(result.data.parts).map(function(i) { - return '/' + pandora.user.ui.item + '/' + return pandora.site.site.videoprefix + '/' + pandora.user.ui.item + '/' + resolution + 'p' + (i + 1) + '.' + pandora.user.videoFormat; }); });