summaryrefslogtreecommitdiff
path: root/mediabrowser/templates/listdir.html
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-01-02 15:05:53 +0100
committerYves Fischer <yvesf-git@xapek.org>2016-01-08 20:38:18 +0100
commit478b2feb875e4ef5a458531c0d24f0b2117f5490 (patch)
tree799ff53e65e3992424e190ee4201500a8862eb71 /mediabrowser/templates/listdir.html
parentd63cdea1618f3e493a966ce43fb735b0afc098b6 (diff)
downloadflask-mediabrowser-478b2feb875e4ef5a458531c0d24f0b2117f5490.tar.gz
flask-mediabrowser-478b2feb875e4ef5a458531c0d24f0b2117f5490.zip
better thumbs, better caching (with filesystem)
Diffstat (limited to 'mediabrowser/templates/listdir.html')
-rw-r--r--mediabrowser/templates/listdir.html42
1 files changed, 9 insertions, 33 deletions
diff --git a/mediabrowser/templates/listdir.html b/mediabrowser/templates/listdir.html
index cfa46f7..024822d 100644
--- a/mediabrowser/templates/listdir.html
+++ b/mediabrowser/templates/listdir.html
@@ -3,37 +3,13 @@
<head>
<title>Directory Browser - {{ path }}</title>
<link rel="stylesheet" href="{{ url_for('mediabrowser.assets', filename='style.css') }}" />
- <script>
- function convertOneThumbnailToVideo() {
- var els = document.getElementsByClassName("thumbnail");
- if (els.length > 0) {
- var el = els[0];
- console.log("convert",el);
-
- var videoEl = document.createElement("video");
- videoEl.addEventListener("error", convertOneThumbnailToVideo, true);
- videoEl.addEventListener("canplaythrough", convertOneThumbnailToVideo, true);
- videoEl.setAttribute("width", 90);
- videoEl.setAttribute("height", 50);
- videoEl.setAttribute("autoplay", "");
- videoEl.setAttribute("loop", true);
- videoEl.setAttribute("src", el.getAttribute("data-video-src"));
- el.parentNode.replaceChild(videoEl, el);
- }
- }
- window.onload = function() {
- convertOneThumbnailToVideo();
- }
- </script>
</head>
<body class="list">
- {% if parent != path %}
+ {% if path != '.' %}
<div>
+ <img src="{{ url_for('mediabrowser.assets', filename='parent.png') }}" />
<a href="{{ url_for('mediabrowser.listdir', path=parent) }}">
- <div style="width: 100%">
- <img src="{{ url_for('mediabrowser.assets', filename='parent.png') }}" />
- ..
- </div>
+ Parent Directory
</a>
</div>
{% endif %}
@@ -41,8 +17,10 @@
{% for file in files %}
{% if file['type'] == 'file' %}
<div>
- <img class="thumbnail" src="{{ url_for('mediabrowser.thumbnail', path=file['fullpath']) }}"
- data-video-src="{{ url_for('mediabrowser.thumbnail_video', path=file['fullpath']) }}"/>
+ <video src="{{ url_for('mediabrowser.thumbnail_video', path=file['fullpath']) }}"
+ poster="{{ url_for('mediabrowser.assets', filename='spinner.gif') }}"
+ autoplay="" loop="true" width="100" height="60">
+ </video>
<a href="{{ url_for('mediabrowser.watch', path=file['fullpath']) }}">
{{ file['filename'] }}
</a>
@@ -51,11 +29,9 @@
{% if file['type'] == 'directory' %}
<div>
+ <img src="{{ url_for('mediabrowser.assets', filename='directory.png') }}" />
<a href="{{ file['link'] }}">
- <div style="width: 100%">
- <img src="{{ url_for('mediabrowser.assets', filename='directory.png') }}" />
- {{ file['filename'] }}
- </div>
+ {{ file['filename'] }}
</a>
</div>
{% endif %}