Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Code video alternatives into the db.

Instead of mangling the DB with alternatives, provide the real
file with web-encoded alternatives as subfield for the real
file.

This way the .js code can offer the proper encoded versions
and it can still offer to download the real file through
the download link.

.js code will need to parse .alts[] from here.
  • Loading branch information...
commit d79ce205878e3acfdc4b4a806e166749d3ee5f6f 1 parent 6354dca
@sofar authored
Showing with 21 additions and 3 deletions.
  1. +21 −3 db.php
View
24 db.php
@@ -104,9 +104,6 @@
continue;
}
- # now we just include the original video, let the .js code
- # handle getting the recoded video versions.
-
$a .= "{ name: '" . $image . "'";
# store original date of the file
@@ -127,6 +124,27 @@
$a .= ", date: " . $date . " ";
}
+ # for video types, include web-playable versions
+ switch (strtolower($pi['extension'])) {
+ case 'avi':
+ case 'mpg':
+ $a .= ', alts: [ "' .
+ $pi['filename'] . '.mp4", ' .
+ $pi['filename'] . '.ogv" ' .
+ '] ';
+ break;
+ case 'mp4':
+ $a .= ', alts: [ "' .
+ $pi['filename'] . '.ogv" ' .
+ '] ';
+ break;
+ case 'ogv':
+ $a .= ', alts: [ "' .
+ $pi['filename'] . '.mp4" ' .
+ '] ';
+ break;
+ }
+
$a .= "}";
# date tag the album based on the oldest item
Please sign in to comment.
Something went wrong with that request. Please try again.