Plugin Directory

Changeset 991512


Ignore:
Timestamp:
09/16/2014 11:59:01 PM (12 years ago)
Author:
trillamar
Message:

updates for 3.9 release

Location:
secure-html5-video-player/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • secure-html5-video-player/trunk/prepvideo.php

    r987060 r991512  
    8888    if (!file_exists($video_cache)
    8989    || abs(filesize($video_orig) - filesize($video_cache)) > 512 && !file_exists($in_progress_file)) {
     90   
    9091        $fp = fopen($in_progress_file, 'w');
    9192        fwrite($fp, "1");
    9293        fclose($fp);
    9394       
    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            }
    96100        }
    97        
     101        else {
     102            if (!link($video_orig, $video_cache)) {
     103                copy($video_orig, $video_cache);
     104            }
     105        }
    98106        unlink($in_progress_file);
    99107    }
  • secure-html5-video-player/trunk/readme.txt

    r989873 r991512  
    44Requires at least: 3.0
    55Tested up to: 4.0
    6 Stable tag: 3.8
     6Stable tag: 3.9
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    128128== Changelog ==
    129129
     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
    130135= 3.8 =
    131136* Optimized videos served over file cache using symbolic links.
     
    218223== Upgrade Notice ==
    219224
     225= 3.9 =
     226Recognizes 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
    220228= 3.8 =
    221229Optimized videos served over file cache using symbolic links.
  • secure-html5-video-player/trunk/secure-html5-video-player.php

    r989873 r991512  
    55Description: 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.
    66Author: Lucinda Brown, Jinsoo Kang
    7 Version: 3.8
     7Version: 3.9
    88Author URI: http://www.trillamar.com/
    99License: GPLv3
  • secure-html5-video-player/trunk/sh5vp-browser-detect.php

    r933859 r991512  
    4848    private $__isSafari;
    4949    private $__isFirefox;
     50    private $__versionFirefox;
    5051    private $__isOpera;
    5152    private $__isIE;
     
    5556    private $__tokens;
    5657   
    57     //static $_instance = NULL;
    58 
    5958    public static function detect($_agent = '', $_force = FALSE) {
    6059        static $_instance = NULL;
     
    8382                    if ($_curr_token != '') {
    8483                        $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')) {
    8685                            $this->__tokens[$_last_token]['v'] = $_curr_token;
    8786                        }
     
    123122        $this->__isSafari = !$this->__isChrome && isset( $this->__tokens['safari'] );
    124123        $this->__isFirefox = isset( $this->__tokens['firefox'] );
     124        if ($this->__isFirefox) {
     125            $this->__versionFirefox = floor( floatval($this->__tokens['firefox']['v']) );
     126        }       
    125127        $this->__isOpera = isset( $this->__tokens['opera'] );
    126128
     
    227229    }
    228230
     231    public function versionFirefox() {
     232        return $this->__versionFirefox;
     233    }
     234
    229235    public function isOpera() {
    230236        return $this->__isOpera;
     
    246252    }
    247253
    248 
    249254}
    250255
  • secure-html5-video-player/trunk/sh5vp-functions.php

    r987060 r991512  
    11041104    }
    11051105    $secure_html5_video_player_serve_from_file = '';
     1106    $secure_html5_video_player_serve_from_file_link = '';
    11061107    $secure_html5_video_player_serve_dynamically = '';
    11071108    switch ($secure_html5_video_player_serve_method) {
    11081109        case 'file':
    11091110            $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"';
    11101114            break;
    11111115        case 'dynamic':
     
    11231127    <input type="radio"
    11241128        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"
    11251135        id="secure_html5_video_player_serve_dynamically"
    11261136        value="dynamic"
    11271137        <?php print $secure_html5_video_player_serve_dynamically ?>
    11281138     /><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 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/>
     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/>
    11301140    <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>
    11321142    <?php
    11331143}
     
    15201530function secure_html5_video_player_shortcode_video($atts) {
    15211531    $bd = SH5VP_BrowserDetect::detect();
     1532   
    15221533    $video_tag = '';
    15231534    $count_file_exists = 0;
     
    17501761        if ($poster) {
    17511762            $poster_attribute = 'poster="'.$poster.'"';
    1752             $image_fallback = "<img src='$poster' width='$width' height='$height' alt='Poster Image' title='No video playback capabilities.' />";
    17531763        }
    17541764   
     
    18191829                $video_tag .= "<!-- " . __('file not found', 'secure-html5-video-player') . ": {$secure_html5_video_player_video_dir}/{$file} -->\n";
    18201830            }
    1821             else if ($bd->isFirefox() && $mp4 && !($ogg || $webm)) {
     1831            else if ($bd->isFirefox() && ($bd->versionFirefox() < 21 || $bd->isMac()) && $mp4 && !($ogg || $webm)) {
    18221832                $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";
    18231833            }
    18241834            else {
    18251835                $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                }
    18261839                if ($webm_source) {
    18271840                    $video_tag .= "{$webm_source}\n";
     
    18291842                if ($ogg_source) {
    18301843                    $video_tag .= "{$ogg_source}\n";
    1831                 }
    1832                 if ($mp4_source) {
    1833                     $video_tag .= "{$mp4_source}\n";
    18341844                }
    18351845                $video_tag .= "</video>\n";
     
    21272137    }
    21282138    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        }   
    21322148    }
    21332149    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.