Changeset 991512
- Timestamp:
- 09/16/2014 11:59:01 PM (12 years ago)
- Location:
- secure-html5-video-player/trunk
- Files:
-
- 5 edited
-
prepvideo.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
secure-html5-video-player.php (modified) (1 diff)
-
sh5vp-browser-detect.php (modified) (6 diffs)
-
sh5vp-functions.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
secure-html5-video-player/trunk/prepvideo.php
r987060 r991512 88 88 if (!file_exists($video_cache) 89 89 || abs(filesize($video_orig) - filesize($video_cache)) > 512 && !file_exists($in_progress_file)) { 90 90 91 $fp = fopen($in_progress_file, 'w'); 91 92 fwrite($fp, "1"); 92 93 fclose($fp); 93 94 94 if (!symlink($video_orig, $video_cache)) { 95 copy($video_orig, $video_cache); 95 $secure_html5_video_player_serve_method = get_option('secure_html5_video_player_serve_method'); 96 if ($secure_html5_video_player_serve_method == 'link') { 97 if (!symlink($video_orig, $video_cache)) { 98 copy($video_orig, $video_cache); 99 } 96 100 } 97 101 else { 102 if (!link($video_orig, $video_cache)) { 103 copy($video_orig, $video_cache); 104 } 105 } 98 106 unlink($in_progress_file); 99 107 } -
secure-html5-video-player/trunk/readme.txt
r989873 r991512 4 4 Requires at least: 3.0 5 5 Tested up to: 4.0 6 Stable tag: 3. 86 Stable tag: 3.9 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 128 128 == Changelog == 129 129 130 = 3.9 = 131 * Recognizes Firefox support for MP4 video playback. 132 * Prioritizes MP4 video playback in the ordering of the video sources. 133 * Added option to set the preference between 2 video file caching options: symbolic-linking and hard-linking/copying. 134 130 135 = 3.8 = 131 136 * Optimized videos served over file cache using symbolic links. … … 218 223 == Upgrade Notice == 219 224 225 = 3.9 = 226 Recognizes Firefox support for MP4 video playback. Prioritizes MP4 video playback in the ordering of the video sources. Added option to set the preference between 2 video file caching options: symbolic-linking and hard-linking/copying. 227 220 228 = 3.8 = 221 229 Optimized videos served over file cache using symbolic links. -
secure-html5-video-player/trunk/secure-html5-video-player.php
r989873 r991512 5 5 Description: Secure HTML5 Video Player allows you to play HTML5 video on modern browsers. Videos can be served privately; pseudo-streamed from a secured directory or via S3. 6 6 Author: Lucinda Brown, Jinsoo Kang 7 Version: 3. 87 Version: 3.9 8 8 Author URI: http://www.trillamar.com/ 9 9 License: GPLv3 -
secure-html5-video-player/trunk/sh5vp-browser-detect.php
r933859 r991512 48 48 private $__isSafari; 49 49 private $__isFirefox; 50 private $__versionFirefox; 50 51 private $__isOpera; 51 52 private $__isIE; … … 55 56 private $__tokens; 56 57 57 //static $_instance = NULL;58 59 58 public static function detect($_agent = '', $_force = FALSE) { 60 59 static $_instance = NULL; … … 83 82 if ($_curr_token != '') { 84 83 $tokenIndex += 1; 85 if (strpos(SH5VP_BrowserDetect::DIGITS, $_curr_token[0]) !== FALSE && $this->__tokens[$_last_token] && ( $_last_token == 'msie' || $_last_token == 'trident' )) {84 if (strpos(SH5VP_BrowserDetect::DIGITS, $_curr_token[0]) !== FALSE && $this->__tokens[$_last_token] && ( $_last_token == 'msie' || $_last_token == 'trident' || $_last_token == 'firefox')) { 86 85 $this->__tokens[$_last_token]['v'] = $_curr_token; 87 86 } … … 123 122 $this->__isSafari = !$this->__isChrome && isset( $this->__tokens['safari'] ); 124 123 $this->__isFirefox = isset( $this->__tokens['firefox'] ); 124 if ($this->__isFirefox) { 125 $this->__versionFirefox = floor( floatval($this->__tokens['firefox']['v']) ); 126 } 125 127 $this->__isOpera = isset( $this->__tokens['opera'] ); 126 128 … … 227 229 } 228 230 231 public function versionFirefox() { 232 return $this->__versionFirefox; 233 } 234 229 235 public function isOpera() { 230 236 return $this->__isOpera; … … 246 252 } 247 253 248 249 254 } 250 255 -
secure-html5-video-player/trunk/sh5vp-functions.php
r987060 r991512 1104 1104 } 1105 1105 $secure_html5_video_player_serve_from_file = ''; 1106 $secure_html5_video_player_serve_from_file_link = ''; 1106 1107 $secure_html5_video_player_serve_dynamically = ''; 1107 1108 switch ($secure_html5_video_player_serve_method) { 1108 1109 case 'file': 1109 1110 $secure_html5_video_player_serve_from_file = 'checked="checked"'; 1111 break; 1112 case 'link': 1113 $secure_html5_video_player_serve_from_file_link = 'checked="checked"'; 1110 1114 break; 1111 1115 case 'dynamic': … … 1123 1127 <input type="radio" 1124 1128 name="secure_html5_video_player_serve_method" 1129 id="secure_html5_video_player_serve_from_file_link" 1130 value="link" 1131 <?php print $secure_html5_video_player_serve_from_file_link ?> 1132 /><label for="secure_html5_video_player_serve_from_file_link"> <?php _e('Serve from cached files using symbolic links', 'secure-html5-video-player'); ?></label><br /><br /> 1133 <input type="radio" 1134 name="secure_html5_video_player_serve_method" 1125 1135 id="secure_html5_video_player_serve_dynamically" 1126 1136 value="dynamic" 1127 1137 <?php print $secure_html5_video_player_serve_dynamically ?> 1128 1138 /><label for="secure_html5_video_player_serve_dynamically"> <?php _e('Serve dynamically', 'secure-html5-video-player'); ?></label><br /><br /> 1129 <div class="inline_help"><?php _e('If [serve from cached files] is selected, the video files are copiedas needed to a temporary cache directory, and served directly to the client using the webserver. Otherwise, the original video files are loaded and served indirectly using PHP.', 'secure-html5-video-player'); ?></div><br/>1139 <div class="inline_help"><?php _e('If [serve from cached files] is selected, the video files are hard-linked (or copied) as needed to a temporary cache directory, and served directly to the client using the webserver. Otherwise, the original video files are loaded and served indirectly using PHP.', 'secure-html5-video-player'); ?></div><br/> 1130 1140 <div class="inline_help"><?php _e('For hosting providers that place limits on the resources available to PHP, serving dynamically should not chosen because it would not scale well. Choose [serve from cached files] so that the act of serving the video files is handled by the webserver rather than by PHP.', 'secure-html5-video-player'); ?></div><br/> 1131 <div class="inline_help"><?php _e(' Caching requires considerable amount of free drive space - at most 2x the space of the videos being served. If hard disk space is limited, select [serve dynamically].', 'secure-html5-video-player'); ?></div>1141 <div class="inline_help"><?php _e('Serving from cached files using symbolic links provides the same benefits as the other caching methodology. However, if your webserver is not configured to serve symbolically linked files, the videos will not be able to load properly. Use symbolic linked caching if the files cannot be hard-linked for whatever reason (ie. they are located in different filesystem from the website files).', 'secure-html5-video-player'); ?></div> 1132 1142 <?php 1133 1143 } … … 1520 1530 function secure_html5_video_player_shortcode_video($atts) { 1521 1531 $bd = SH5VP_BrowserDetect::detect(); 1532 1522 1533 $video_tag = ''; 1523 1534 $count_file_exists = 0; … … 1750 1761 if ($poster) { 1751 1762 $poster_attribute = 'poster="'.$poster.'"'; 1752 $image_fallback = "<img src='$poster' width='$width' height='$height' alt='Poster Image' title='No video playback capabilities.' />";1753 1763 } 1754 1764 … … 1819 1829 $video_tag .= "<!-- " . __('file not found', 'secure-html5-video-player') . ": {$secure_html5_video_player_video_dir}/{$file} -->\n"; 1820 1830 } 1821 else if ($bd->isFirefox() && $mp4 && !($ogg || $webm)) {1831 else if ($bd->isFirefox() && ($bd->versionFirefox() < 21 || $bd->isMac()) && $mp4 && !($ogg || $webm)) { 1822 1832 $video_tag .= "<iframe id='{$object_tag_id}' type='text/html' width='{$width}' height='{$height}' src='{$plugin_dir}/fallback/index.php?autoplay={$fallback_autoplay}&mp4={$fallback_mp4}&url={$fallback_plugin_dir}' frameborder='0' /></iframe>\n"; 1823 1833 } 1824 1834 else { 1825 1835 $video_tag .= "<video class='video-js sh5vp-video' width='{$width}' height='{$height}' {$poster_attribute} {$controls_attribute} {$preload_attribute} {$autoplay_attribute} {$loop_attribute} >\n"; 1836 if ($mp4_source) { 1837 $video_tag .= "{$mp4_source}\n"; 1838 } 1826 1839 if ($webm_source) { 1827 1840 $video_tag .= "{$webm_source}\n"; … … 1829 1842 if ($ogg_source) { 1830 1843 $video_tag .= "{$ogg_source}\n"; 1831 }1832 if ($mp4_source) {1833 $video_tag .= "{$mp4_source}\n";1834 1844 } 1835 1845 $video_tag .= "</video>\n"; … … 2127 2137 } 2128 2138 elseif ($bd->isFirefox()) { 2129 $can_play_mp4 = FALSE; 2130 $can_play_ogg = TRUE; 2131 $can_play_webm = TRUE; 2139 if ($bd->versionFirefox() >= 21 && !$bd->isMac()) { 2140 $can_play_ogg = TRUE; 2141 $can_play_webm = TRUE; 2142 } 2143 else { 2144 $can_play_mp4 = FALSE; 2145 $can_play_ogg = TRUE; 2146 $can_play_webm = TRUE; 2147 } 2132 2148 } 2133 2149 return ($has_mp4 && $can_play_mp4) || ($has_ogg && $can_play_ogg) || ($has_webm && $can_play_webm);
Note: See TracChangeset
for help on using the changeset viewer.