diff --git a/composer.json b/composer.json index aaa82c8d..d147f961 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "bower-asset/jquery" : "1.12.3", "bower-asset/jquery-timeago" : "1.5.2", - "bower-asset/tablesorter" : "2.0.5" + "bower-asset/tablesorter" : "2.0.5", + "bower-asset/mediaelement" : "2.21.1" }, "vendor-copy": { @@ -36,6 +37,7 @@ "vendor/bower-asset/jquery/dist/jquery.min.map" : "lib/vendor/js/jquery-1.12.3.min.map", "vendor/bower-asset/jquery-timeago/jquery.timeago.js" : "lib/vendor/js/jquery.timeago.js", "vendor/bower-asset/tablesorter/jquery.tablesorter.min.js" : "lib/vendor/js/jquery.tablesorter.min.js" + "vendor/bower-asset/mediaelement/build/flashmediaelement.swf" : "lib/vendor/swf/flashmediaelement.swf" }, "scripts": { diff --git a/ext/handle_video/main.php b/ext/handle_video/main.php index 4acb612d..21585748 100644 --- a/ext/handle_video/main.php +++ b/ext/handle_video/main.php @@ -14,7 +14,6 @@ * In the future, it may be necessary to change the user agent checks to reflect the current state of H.264 support.

* Made possible by:
* getID3() - Gets media information with PHP (no bulky FFMPEG API required).
- * Jaris FLV Player - GPLv3 flash multimedia player. */ class VideoFileHandler extends DataHandlerExtension { diff --git a/ext/handle_video/theme.php b/ext/handle_video/theme.php index 3cb88674..774ea55a 100644 --- a/ext/handle_video/theme.php +++ b/ext/handle_video/theme.php @@ -4,45 +4,48 @@ class VideoFileHandlerTheme extends Themelet { public function display_image(Page $page, Image $image) { $data_href = get_base_href(); $ilink = $image->get_image_link(); + $thumb_url = make_http($image->get_thumb_link()); //used as fallback image $ext = strtolower($image->get_ext()); - - if ($ext == "mp4") { - $html = "Video not playing? Click here to download the file.
- -"; - } elseif ($ext == "flv") { - $html = "Video not playing? Click here to download the file.
- - - - - - - "; - } elseif ($ext == "ogv") { - $html = "Video not playing? Click here to download the file.
- "; - } elseif ($ext == "webm") { - $ie_only = ""; - $html = $ie_only ."Video not playing? Click here to download the file.
- "; - } - else { + $full_url = make_http($ilink); + + $html = "Video not playing? Click here to download the file.
"; + + //Browser media format support: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats + $supportedExts = ['mp4' => 'video/mp4', 'm4v' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm', 'flv' => 'video/flv']; + if(array_key_exists($ext, $supportedExts)) { + //FLV isn't supported by