Plugin Directory

Changeset 834182


Ignore:
Timestamp:
01/07/2014 02:01:10 AM (12 years ago)
Author:
trillamar
Message:

version 3.2 updates

Location:
secure-html5-video-player/trunk
Files:
40 added
5 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • secure-html5-video-player/trunk/readme.txt

    r778669 r834182  
    33Tags: html5, video, player, secure, javascript, m4v, mp4, ogg, ogv, theora, webm, flowplayer, skins, media server, youtube, vimeo, amazon, s3
    44Requires at least: 3.0
    5 Tested up to: 3.6.1
    6 Stable tag: 3.1
     5Tested up to: 3.8
     6Stable tag: 3.2
    77
    88Secure 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.
     
    8888
    8989    [video autoplay="yes"]
     90
     91### loop
     92Replay the video from the beginning after it completes playing.
     93
     94        [video loop="yes"]
     95
     96### controls
     97Enable or disable video playback controls. (Only applies to the "native" skin.)
     98
     99    [video controls="no"]
    90100
    91101
     
    117127== Changelog ==
    118128
     129= 3.2 =
     130* Upgraded Flowplayer files to the latest version to resolve a security hole.
     131* Removed option for Flash fall back.  Flash fall back now happens automatically, and only for IE 7 and 8.
     132* Added option to turn on controls in HTML5 video player for the native skin setting.
     133* Added Spanish language localization, courtesy of webhostinghub.com.
     134
    119135= 3.1 =
    120136* Added ability to set the duration time for S3 media lifespan.
     
    174190== Upgrade Notice ==
    175191
     192= 3.2 =
     193Upgraded Flowplayer files to the latest version to resolve a security hole. Removed option for Flash fall back.  Flash fall back now happens automatically, and only for IE 7 and 8. Added option to turn on controls in HTML5 video player for the native skin setting. Added Spanish language localization, courtesy of webhostinghub.com.
     194
    176195= 3.1 =
    177196Added ability to set the duration time for S3 media lifespan. Expanded the S3 server list for current Amazon S3 global regions. Note: The S3 server must be specified to the one that matches the region of the bucket. Added additional help text in the S3 settings tab.
  • secure-html5-video-player/trunk/secure-html5-video-player.php

    r778669 r834182  
    55Description: An enhanced video plugin for WordPress built on the VideoJS HTML5 video player library.  Settings can be easily configured with a control panel and simplified short codes.  Video files can be served from a secured private directory.
    66Author: Lucinda Brown, Jinsoo Kang
    7 Version: 3.1
     7Version: 3.2
    88Author URI: http://www.trillamar.com/
    99License: LGPLv3
  • secure-html5-video-player/trunk/sh5vp-functions.php

    r778669 r834182  
    1818    $secure_html5_video_player_s3_link_expire_units = get_option('secure_html5_video_player_s3_link_expire_units');
    1919    if (!$secure_html5_video_player_s3_link_expire) {
    20 $secure_html5_video_player_s3_link_expire = 28800;
     20        $secure_html5_video_player_s3_link_expire = 28800;
    2121    }
    2222    else {
     
    719719    _e('Replay the video from the beginning after it completes playing.', 'secure-html5-video-player');
    720720    print '<br/><br/><code>[video loop="yes"]</code>';
     721
     722    print '<h3>controls</h3>';
     723    _e('Enable or disable video playback controls. (Only applies to the "native" skin.)', 'secure-html5-video-player');
     724    print '<br/><br/><code>[video controls="no"]</code>';
     725
    721726   
    722727    print '<br/><br/><hr/><br/><label class="title">';
     
    741746    add_option('secure_html5_video_player_skin', 'tube');
    742747    add_option('secure_html5_video_player_key_seed', base64_encode(AUTH_KEY));
    743     add_option('secure_html5_video_player_enable_flash_fallback', 'yes');
    744748    add_option('secure_html5_video_player_enable_download_fallback', 'yes');
    745749   
     
    749753    add_option('secure_html5_video_player_default_autoplay', 'no');
    750754    add_option('secure_html5_video_player_default_loop', 'no');
     755    add_option('secure_html5_video_player_default_controls', 'yes');
    751756
    752757    add_option('secure_html5_video_player_enable_media_server', 'no');
     
    785790    delete_option('secure_html5_video_player_default_autoplay');
    786791    delete_option('secure_html5_video_player_default_loop');
     792    delete_option('secure_html5_video_player_default_controls');
    787793
    788794    delete_option('secure_html5_video_player_enable_media_server');
     
    818824    }
    819825   
    820     if (isset($_REQUEST['secure_html5_video_player_enable_flash_fallback'])
    821     && $_REQUEST['secure_html5_video_player_enable_flash_fallback'] == 'yes') {
    822         update_option('secure_html5_video_player_enable_flash_fallback', 'yes');
    823     }
    824     else {
    825         update_option('secure_html5_video_player_enable_flash_fallback', 'no');
    826     }
    827 
    828826    if (isset($_REQUEST['secure_html5_video_player_enable_download_fallback'])
    829827    && $_REQUEST['secure_html5_video_player_enable_download_fallback'] != '') {
     
    863861    else {
    864862        update_option('secure_html5_video_player_default_loop', 'no');
     863    }
     864
     865    if (isset($_REQUEST['secure_html5_video_player_default_controls'])
     866    && $_REQUEST['secure_html5_video_player_default_controls'] == 'yes') {
     867        update_option('secure_html5_video_player_default_controls', 'yes');
     868    }
     869    else {
     870        update_option('secure_html5_video_player_default_controls', 'no');
    865871    }
    866872   
     
    10091015if ( !function_exists('secure_html5_video_player_options_compatibility') ):
    10101016function secure_html5_video_player_options_compatibility() {
    1011     $secure_html5_video_player_enable_flash_fallback = ('yes' == get_option('secure_html5_video_player_enable_flash_fallback') ? 'checked="checked"' : '');
    1012     ?>
    1013     <input type='checkbox' value="yes" id="secure_html5_video_player_enable_flash_fallback" name='secure_html5_video_player_enable_flash_fallback' <?php print $secure_html5_video_player_enable_flash_fallback ?> />
    1014     <label class="title" for='secure_html5_video_player_enable_flash_fallback'><?php _e('Enable Flash fallback', 'secure-html5-video-player'); ?></label>
    1015     <br/>
    1016     <small><?php _e('If checked, Flowplayer will act as a fallback for non-html5 compliant browsers.', 'secure-html5-video-player'); ?></small>
    1017     <br/><br/><br/>
    1018 
    1019     <?php
    10201017    $secure_html5_video_player_enable_download_fallback = get_option('secure_html5_video_player_enable_download_fallback');
    10211018    if ($secure_html5_video_player_enable_download_fallback == '') {
     
    11021099
    11031100
    1104 
    1105 
    11061101if ( !function_exists('secure_html5_video_player_options_form_media_server') ):
    11071102function secure_html5_video_player_options_form_media_server() {
     
    11371132    $secure_html5_video_player_default_autoplay = ('yes' == get_option('secure_html5_video_player_default_autoplay') ? 'checked="checked"' : '');
    11381133    $secure_html5_video_player_default_loop = ('yes' == get_option('secure_html5_video_player_default_loop') ? 'checked="checked"' : '');
     1134    $secure_html5_video_player_default_controls = ('no' != get_option('secure_html5_video_player_default_controls') ? 'checked="checked"' : '');
    11391135    ?>
    11401136    <label class="title" for='secure_html5_video_player_default_width'><?php _e('Default width', 'secure-html5-video-player'); ?></label><br/>
     
    11911187            '<b>no</b>'
    11921188        ); ?></small>
     1189    <br/><br/>
     1190
     1191    <input type='checkbox' value="yes" id="secure_html5_video_player_default_controls" name='secure_html5_video_player_default_controls' <?php print $secure_html5_video_player_default_controls ?> />
     1192    <label class="title" for='secure_html5_video_player_default_controls'><?php _e('Video Player Controls', 'secure-html5-video-player'); ?></label>
     1193    <br/>
     1194    <small><?php
     1195        printf(
     1196            __('If checked, the video player will show playback controls by default.  Can be overrided by setting the %1$s attribute in the short tag to %2$s or %3$s.', 'secure-html5-video-player'),
     1197            '<b>controls</b>',
     1198            '<b>yes</b>',
     1199            '<b>no</b>'
     1200        ); ?></small>
     1201    <br/><br/>
    11931202    <?php
    11941203}
     
    12191228}
    12201229endif;
    1221 
    1222 
    1223 
    12241230
    12251231
     
    14561462function secure_html5_video_player_add_header() {
    14571463    global $secure_html5_video_player_is_android;
     1464    global $secure_html5_video_player_is_ios;
    14581465    global $secure_html5_video_player_is_explorer7;
    14591466    global $secure_html5_video_player_is_explorer8;
    1460     global $secure_html5_video_player_is_ios;
    1461     if ($secure_html5_video_player_is_explorer7 || $secure_html5_video_player_is_explorer8
    1462     || $secure_html5_video_player_is_ios || $secure_html5_video_player_is_android) {
     1467    if ($secure_html5_video_player_is_ios || $secure_html5_video_player_is_android) {
     1468        return;
     1469    }
     1470    else if ($secure_html5_video_player_is_explorer7 || $secure_html5_video_player_is_explorer8) {
     1471        $plugin_dir = plugins_url('secure-html5-video-player');
     1472        print "<link rel='stylesheet' type='text/css' href='{$plugin_dir}/flowplayer/skin/minimalist.css'/>";
     1473        print "<script type='text/javascript' src='{$plugin_dir}/flowplayer/flowplayer.min.js'></script>";
    14631474        return;
    14641475    }
     
    15061517    'autoplay' => get_option('secure_html5_video_player_default_autoplay'),
    15071518    'loop' => get_option('secure_html5_video_player_default_loop'),
     1519    'controls' => get_option('secure_html5_video_player_default_controls'),
    15081520    'youtube' => '',
    15091521    'vimeo' => ''
     
    17401752            $loop_attribute = "";
    17411753        }
     1754   
     1755        if ($controls != 'no' && $controls != 'false') {
     1756            $controls_attribute = 'controls="controls"';
     1757        }
     1758        else {
     1759            $controls_attribute = "";
     1760        }
    17421761       
    17431762        $video_tag_skin = '';
     
    17451764            $video_tag_skin = $secure_html5_video_player_skin . '-css';
    17461765        }
    1747         $video_tag .= "<div class='video-js-box sh5vp-video-box {$video_tag_skin}'>\n";
     1766        $video_tag .= "<div class='video-js-box sh5vp-video-box {$video_tag_skin}' >\n";
    17481767       
    17491768        if ($secure_html5_video_player_is_ios || $secure_html5_video_player_is_android) {
    17501769            // iOS and Android devices
    1751             $video_tag .= "<video class='video-js sh5vp-video' onClick='this.play();' width='{$width}' height='{$height}' {$poster_attribute} controls=\"controls\" {$preload_attribute} {$autoplay_attribute} {$loop_attribute} >\n";
     1770            $video_tag .= "<video class='video-js sh5vp-video' onClick='this.play();' width='{$width}' height='{$height}' {$poster_attribute} {$controls_attribute} {$preload_attribute} {$autoplay_attribute} {$loop_attribute} >\n";
    17521771            if ($mp4_source) {
    17531772                $video_tag .= "{$mp4_source}\n";
     
    17551774            $video_tag .= "</video>\n";
    17561775        }
    1757         else if (
    1758             ($secure_html5_video_player_is_firefox && $mp4 && !$ogg  && 'native' == $secure_html5_video_player_skin)
    1759             ||
    1760             (($secure_html5_video_player_is_explorer7 || $secure_html5_video_player_is_explorer8) && $mp4)
    1761         ) {
     1776        else if (($secure_html5_video_player_is_explorer7 || $secure_html5_video_player_is_explorer8) && $mp4) {
    17621777            // IE 7 or IE 8
    1763             $video_tag .= "<object id='{$object_tag_id}' class='vjs-flash-fallback' ";
    1764             $video_tag .= " width='{$width}' height='{$height}' type='application/x-shockwave-flash' data='{$plugin_dir}/flowplayer/flowplayer-3.2.7.swf'>\n";
    1765             $video_tag .= "<param name='movie' value='{$plugin_dir}/flowplayer/flowplayer-3.2.7.swf' />\n";
    1766             $video_tag .= "<param name='wmode' value='transparent' />\n";
    1767             $video_tag .= "<param name='allowfullscreen' value='true' />\n";
    1768             $video_tag .= "<param name='flashvars' value='config={\"playlist\":[ $flow_player_poster {\"url\": \"" . urlencode($mp4) . "\" $flow_player_autoplay $flow_player_preload }]}' />\n";
    1769             $video_tag .= "{$image_fallback}\n";
    1770             $video_tag .= "</object>\n";
    1771                    
     1778            $video_tag .= "<div class='flowplayer' data-swf='{$plugin_dir}/flowplayer/flowplayer.swf' data-ratio='" . (1.0 * $height / $width) . "'>";
     1779            $video_tag .= "<video width='{$width}' height='{$height}'  {$controls_attribute} {$preload_attribute} {$autoplay_attribute} {$loop_attribute} >\n";
     1780            if ($mp4_source) {
     1781                $video_tag .= "{$mp4_source}\n";
     1782            }
     1783            $video_tag .= "</video>\n";
     1784            $video_tag .= "</div>";                 
    17721785            if ('always' == $secure_html5_video_player_enable_download_fallback) {
    17731786                $video_tag .= "<p class='sh5vp-download-links'><label>Download Video:</label>\n";
     
    17861799        else {
    17871800            // everything else
    1788             $video_tag .= "<video class='video-js sh5vp-video' width='{$width}' height='{$height}' {$poster_attribute} controls=\"controls\" {$preload_attribute} {$autoplay_attribute} {$loop_attribute} >\n";
     1801            $video_tag .= "<video class='video-js sh5vp-video' width='{$width}' height='{$height}' {$poster_attribute} {$controls_attribute} {$preload_attribute} {$autoplay_attribute} {$loop_attribute} >\n";
     1802            if ($webm_source) {
     1803                $video_tag .= "{$webm_source}\n";
     1804            }
     1805            if ($ogg_source) {
     1806                $video_tag .= "{$ogg_source}\n";
     1807            }
    17891808            if ($mp4_source) {
    17901809                $video_tag .= "{$mp4_source}\n";
    17911810            }
    1792             if ($webm_source) {
    1793                 $video_tag .= "{$webm_source}\n";
    1794             }
    1795             if ($ogg_source) {
    1796                 $video_tag .= "{$ogg_source}\n";
    1797             }
    17981811            if ($count_file_exists == 0) {
    17991812                $video_tag .= "<!-- " . __('file not found', 'secure-html5-video-player') . ": {$secure_html5_video_player_video_dir}/{$file} -->\n";
    18001813            }
    1801        
    1802             if ('yes' == get_option('secure_html5_video_player_enable_flash_fallback') && $mp4) {
    1803                 //Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class.
    1804                 $video_tag .= "<object id='{$object_tag_id}' class='vjs-flash-fallback' ";
    1805                 $video_tag .= " width='{$width}' height='{$height}' type='application/x-shockwave-flash' data='{$plugin_dir}/flowplayer/flowplayer-3.2.7.swf'>\n";
    1806                 $video_tag .= "<param name='movie' value='{$plugin_dir}/flowplayer/flowplayer-3.2.7.swf' />\n";
    1807                 $video_tag .= "<param name='wmode' value='transparent' />\n";
    1808                 $video_tag .= "<param name='allowfullscreen' value='true' />\n";
    1809                 $video_tag .= "<param name='flashvars' value='config={\"playlist\":[ $flow_player_poster {\"url\": \"" . urlencode($mp4) . "\" $flow_player_autoplay $flow_player_preload }]}' />\n";
    1810                 $video_tag .= "{$image_fallback}\n";
    1811                 $video_tag .= "</object>\n";
    1812             }
    18131814            $video_tag .= "</video>\n";
    1814            
     1815                   
    18151816            //Download links provided for devices that can't play video in the browser.
    18161817            if ('no' != $secure_html5_video_player_enable_download_fallback) {
    18171818                $can_play_provided = secure_html5_video_player_can_play($mp4_link, $ogg_link, $webm_link);
    1818                 if ('native' == $secure_html5_video_player_skin) {
    1819                     if (! $can_play_provided || 'always' == $secure_html5_video_player_enable_download_fallback) {
    1820                         $video_tag .= "<p class='sh5vp-download-links'><label>Download Video:</label>\n";
    1821                         if ($mp4_link) {
    1822                             $video_tag .= "{$mp4_link}\n";
    1823                         }
    1824                         if ($webm_link) {
    1825                             $video_tag .= "{$webm_link}\n";
    1826                         }
    1827                         if ($ogg_link) {
    1828                             $video_tag .= "{$ogg_link}\n";
    1829                         }
    1830                         $video_tag .= "</p>\n";
    1831                     }
    1832                 }
    1833                 else {
    1834                     $video_tag .= "<p class='vjs-no-video'><label>Download Video:</label>\n";
     1819                if (! $can_play_provided || 'always' == $secure_html5_video_player_enable_download_fallback) {
     1820                    $video_tag .= "<p class='sh5vp-download-links'><label>Download Video:</label>\n";
    18351821                    if ($mp4_link) {
    18361822                        $video_tag .= "{$mp4_link}\n";
     
    18651851        }   
    18661852    }
    1867    
    18681853    return $video_tag;
    18691854}
     
    20652050
    20662051
    2067 
    20682052if ( !function_exists('secure_html5_video_player_can_play') ):
    20692053function secure_html5_video_player_can_play($has_mp4, $has_ogg, $has_webm) {
    20702054    global $secure_html5_video_player_is_chrome;
    20712055    global $secure_html5_video_player_is_firefox;
    2072    
    20732056    $can_play_mp4 = TRUE;
    20742057    $can_play_ogg = FALSE;
     
    20812064        $can_play_mp4 = FALSE;
    20822065        $can_play_ogg = TRUE;
     2066        $can_play_webm = TRUE;
    20832067    }
    20842068    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.