summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-02-25 05:27:29 +0000
committerBharat Mediratta <bharat@menalto.com>2009-02-25 05:27:29 +0000
commit515c081f794c0e020241956f291381361e28489a (patch)
tree3c1f4a153d046db9f3a4a39df4954bbc33a227f1 /core/helpers
parent585ea819579405bbfe772d2e7fa647f54d5a17e2 (diff)
Add support MP4 movies also. Flowplayer supports them and can stream
them using the h264streaming plugin. Everything else is a fairly minor change.
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/graphics.php1
-rw-r--r--core/helpers/movie.php2
-rw-r--r--core/helpers/photo.php11
3 files changed, 4 insertions, 10 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php
index 92e1c3f7..d30701a0 100644
--- a/core/helpers/graphics.php
+++ b/core/helpers/graphics.php
@@ -107,6 +107,7 @@ class graphics_Core {
foreach ($ops as $target => $output_file) {
if ($input_item->is_movie()) {
// Convert the movie to a JPG first
+ $output_file = preg_replace("/...$/", "jpg", $output_file);
movie::extract_frame($input_file, $output_file);
$working_file = $output_file;
} else {
diff --git a/core/helpers/movie.php b/core/helpers/movie.php
index 9941fcee..9a93afbf 100644
--- a/core/helpers/movie.php
+++ b/core/helpers/movie.php
@@ -60,7 +60,7 @@ class movie_Core {
$movie->owner_id = $owner_id;
$movie->width = $movie_info[0];
$movie->height = $movie_info[1];
- $movie->mime_type = "video/x-flv";
+ $movie->mime_type = strtolower($pi["extension"]) == "mp4" ? "video/mp4" : "video/x-flv";
$movie->thumb_dirty = 1;
$movie->resize_dirty = 1;
diff --git a/core/helpers/photo.php b/core/helpers/photo.php
index 9b773dc4..aab72a87 100644
--- a/core/helpers/photo.php
+++ b/core/helpers/photo.php
@@ -44,13 +44,6 @@ class photo_Core {
}
$image_info = getimagesize($filename);
- if ($image_info) {
- $type = "photo";
- } else {
- $movie_info = movie::getmoviesize($filename);
- $image_info = array(200, 200, 'mime' => 'video/x-flv');
- $type = "movie";
- }
// Force an extension onto the name
$pi = pathinfo($name);
@@ -60,7 +53,7 @@ class photo_Core {
}
$photo = ORM::factory("item");
- $photo->type = $type;
+ $photo->type = "photo";
$photo->title = $title;
$photo->description = $description;
$photo->name = $name;
@@ -109,7 +102,7 @@ class photo_Core {
$group->input("name")->label(t("Name"));
$group->input("title")->label(t("Title"));
$group->textarea("description")->label(t("Description"));
- $group->upload("file")->label(t("File"))->rules("required|allow[jpg,png,gif,flv]");
+ $group->upload("file")->label(t("File"))->rules("required|allow[jpg,png,gif,flv,mp4]");
$group->hidden("type")->value("photo");
$group->submit("")->value(t("Upload"));
$form->add_rules_from(ORM::factory("item"));