[xiph-commits] r3921 - arkaiv/trunk/arkaiv/templates

dcrowdy at svn.annodex.net dcrowdy at svn.annodex.net
Sun May 10 20:13:10 PDT 2009


Author: dcrowdy
Date: 2009-05-10 20:13:09 -0700 (Sun, 10 May 2009)
New Revision: 3921

Modified:
   arkaiv/trunk/arkaiv/templates/playlistview.mak
Log:
Crude but effective playlist function restored.


Modified: arkaiv/trunk/arkaiv/templates/playlistview.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/playlistview.mak	2009-05-11 01:40:14 UTC (rev 3920)
+++ arkaiv/trunk/arkaiv/templates/playlistview.mak	2009-05-11 03:13:09 UTC (rev 3921)
@@ -1,11 +1,160 @@
 <%inherit file="/autohandler"/> 
-<h2>
-${c.name}
-</h2>
+
+<div id="video">
+
+<video src='${c.clips[0]['url']}' controls='controls' ontimeupdate="Updatetime()" width=320 height=240></video>
+##<p>${c.clips[0]['name']}</p>
+
+<form name="api">
+<table style="font-size:small">
+<tr>
+<td>Time:</td>
+<td><input name="tfield" cols="8"></textarea></td>
+##<td>Go to:</td>
+##<td><input name="gfield" cols="6" onchange='Gototime("${c.sourcedict['urlpath']}?t=")'></textarea></td>
+</tr>
+##Output area useful for debugging:
+##<tr>
+##<td>Output:</td>
+##<td><textarea name="ofield" cols="40" rows="2"></textarea></td>
+##</tr>
+</table>
+</form>
+##</div>
+
+##<div id="playlistitems">
+<table style="font-size:small">
+
 % for clip in c.clips:
-<audio src='${clip['url']}' controls='controls'></audio>
-<p>
+<tr>
+##%    if clip['end'] == 0:
+   <td><a onclick='ClipPlay("${clip['url']}")'><img src="/images/blank.png"></a></td>
+##  %   else:
+##   <td><a onclick='ClipPlay("${c.sourcedict['urlpath']}?t=${clipinfo['id']}/${clipinfo['end_time']}")'><img src="${c.sourcedict['clipimageurl']}${clipinfo['img_src']}"></a></td>
+## %     endif
+##%  endif
+##
+## %  if c.sourcedict['has_video'] == "No":
+## %    if clipinfo['end_time'] == 0:
+##   <td><a onclick='ClipPlay("${c.sourcedict['urlpath']}?t=${clipinfo['id']}")'><img src="/images/blank.png"></a></td>
+##  %   else:
+##   <td><a onclick='ClipPlay("${c.sourcedict['urlpath']}?t=${clipinfo['id']}/${clipinfo['end_time']}")'><img src="/images/blank.png"></a></td>
+## %     endif
+##%  endif
+##
+    <td>${clip['id']}</td>
+    <td>${clip['name']}</td>
+    <td>${clip['url']}</td>
+##
+##${ h.form(h.url_for(action='deleteclip'), multipart=True) }
+##<td>${ h.submit('Delete') } </td>
+##${ h.hidden_field('clipid', value=clipinfo['ixc']) }
+##${ h.hidden_field('itemid', value=c.itemid) }
+##${ h.end_form() } 
+##
+</tr> 
 % endfor
+</table>
+</div>
 
-<hr>
+##
+##Add new clip:
+##<!--${ h.form(h.url_for(action='addclip'), multipart=True) }-->
+##<form name="addaclip" action="addclip" >
+##<table style="font-size:small">
+##<tr>
+##    <td>Start</td>
+##  <td>${ h.text_field('starttime', size=5) }</td>
+##</tr>
+##<tr>
+##<tr>
+##    <td>End</td>
+##  <td>${ h.text_field('endtime', size=5) }</td>
+##</tr>
+##<td>Desc</td>
+##  <td>
+##  <input type="text" name="desc" size="20" onfocus="disableShortcuts()" onblur="enableShortcuts()" id="desc" />
+##  <!--${ h.text_field('desc') }--></td>
+##</tr>
+##<tr>
+##    <td>a_text</td>
+##  <td>${ h.text_field('a_text') }</td>
+##</tr>
+##<tr>
+##    <td>a_href</td>
+##  <td>${ h.text_field('a_href') }</td>
+##</tr>
+##</table>
+##${ h.hidden_field('headindex', value = c.headdict['index']) }
+##${ h.hidden_field('itemid', value=c.itemid) }
+##${ h.hidden_field('hasvideo', value=c.sourcedict['has_video']) }
+##${ h.submit('Add') } 
+##${ h.end_form() } 
+##
 
+<script>
+
+var output = document.api.ofield;
+var toutput = document.api.tfield;
+var gototime = document.api.gfield;
+var myVideo = document.getElementsByTagName('video')[0];
+var myAudio = document.getElementsByTagName('audio')[0];
+
+if (myAudio) {
+//  addOutput("Audio");
+  myMedia = myAudio;
+}
+else {
+//  addOutput("Video");
+  myMedia = myVideo;
+}
+
+v.addEventListener("seeked", function() { document.getElementsByTagName("video")[0].play(); }, true);
+
+function ClipPlay(location) {
+  myMedia.src = location
+  myMedia.load();
+  myMedia.play();
+  //addOutput("Audio clip");
+}
+
+function Updatetime() {
+  addToutput(myMedia.currentTime);
+}
+
+function addToutput(str) {
+  toutput.value = str;
+}
+
+function Gototime(location) {
+  t = getGoto();
+//  addOutput(location + t);
+  myMedia.src = location + t;
+  myMedia.load();
+  myMedia.play();
+}
+
+function getGoto() {
+  i = parseInt(gototime.value);
+  return isNaN(i) ? 0 : i;
+}
+
+var outLines = 0;
+
+function addOutput(str) {
+  if (outLines == 0) {
+    output.value = str;
+  } else {
+    output.value = str + "\n" + output.value;
+  }
+  outLines++;
+  if (outLines == 11) {
+    i = output.value.lastIndexOf("\n");
+    output.value = output.value.substr(0, i);
+    outLines--;
+  }
+
+}
+</script>
+
+



More information about the commits mailing list