Plugin Directory

Changeset 535930


Ignore:
Timestamp:
04/25/2012 02:51:10 AM (14 years ago)
Author:
nurungji
Message:
 
Location:
hana-flv-player/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • hana-flv-player/trunk/hana-flv-player.php

    r534959 r535930  
    44Plugin URI: http://wpmarketing.org/plugins/hana-flv-player/
    55Description: The best way to embed Flash Player and Flash movie in your Wordpress Blog. Includes GPL Flowplayer, OS FLV player, and MediaElement.js. Usage: <code>[hana-flv-player video='/source_video.flv' /]</code>
    6 Version: 2.8.1
     6Version: 2.8.2
    77Author: HanaDaddy
    88Author URI: http://neox.net
     
    1616
    1717    var $plugin_folder ='hana-flv-player';
    18     var $version="2.8.1";
     18    var $version="2.8.2";
    1919    var $user_attr ;
    2020    var $update_result='';
     
    7373    function bind_hooks() {
    7474        // third arg should be large enough . If executed early in the filter chain, so we do not see <br />
     75        if (!is_admin()) {
     76            wp_enqueue_script("jquery"); //make sure we load jquery;
     77        }
     78       
    7579        add_filter('wp_head',array(&$this,'print_head_javascript'));
    7680        add_filter('the_content', array(&$this,'hana_flv_return') , 1);
     
    8892
    8993    function print_head_javascript(){
    90        
    91         echo "<script type='text/javascript'>function check_apple_device(){ if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) { return true; }else return false; }</script>";
     94        //echo "<script type='text/javascript'>function hana_check_apple_device(){ if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) { return true; }else return true; }</script>";
     95
     96        echo "
     97<script type='text/javascript'>
     98var g_hasFlash = false;
     99try {
     100  var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
     101  if(fo) g_hasFlash = true;
     102}catch(e){
     103  if(navigator.mimeTypes ['application/x-shockwave-flash'] != undefined) g_hasFlash = true;
     104}
     105//g_hasFlash = false;
     106</script>
     107
     108";
     109       
    92110    }
    93111   
     
    249267            $description="*Video:".htmlspecialchars($flv_attr['description']);
    250268       
     269       
     270        $inactive_message="Sorry, your browser does not support Flash Video Player";
     271        $inactive_style="display:block;width:".$flv_attr['width']."px;height:".$flv_attr['height']."px;background-color:#555555;color:#ffffff;padding:0";
     272       
    251273        if ($player == '3' ) {
    252274        // flv player maxi
     
    290312    <param name='movie' value='".$this->plugin_url."/".$this->player_base[$player]."/template_maxi/player_flv_maxi.swf' />
    291313    <param name='allowFullScreen' value='true' />
    292     <param name='wmode' value='transparent'>
     314    <param name='wmode' value='transparent' />
    293315    <param name='FlashVars' value='flv=".$flv_attr['video']."&amp;width=".$flv_attr['width']."&amp;height=".$flv_attr['height']."&amp;autoplay=".$flv_attr['autoplay']."&amp;autoload=".$flv_attr['autoload'].$splashImage."&amp;loop=".$flv_attr['loop'].$onclick.$onclicktarget.$default_controls. $flv_attr['more_3'] ."' />
    294                 <p>$description</p>
     316    <span style='$inactive_style;padding:5px;'><span style='display:block'>$inactive_message</span> $description</span>
    295317</object></hana-ampersand>";
    296318
     
    331353                //  $flv_attr['more_2'] = $flv_attr['more_2'] . ',';
    332354            //}
    333                
     355           
    334356             
    335357            //initialScale : Scale or fit
    336358            //For Flowplayer 2, let's leave initialScale as Scale due to a problem showing incorrect scale of first image
    337             // if ($autoheight) $scale='fit'; else $scale='scale';
     359            if ($autoheight) $scale='fit'; else $scale='scale';
    338360            $output .="<hana-ampersand>
    339             <div $div_attr_string><div id='$flow_id'>$description</div></div>
     361            <div $div_attr_string><div id='$flow_id' style='$inactive_style'><div class='inactive_message'></div>$description</div></div>
    340362<script type='text/javascript'>
     363if (!g_hasFlash){
     364    jQuery('#$flow_id').css( 'padding', '5px' );
     365    jQuery('#$flow_id .inactive_message').html('$inactive_message');
     366}else{
    341367    flashembed2('$flow_id',
    342368      { src:'".$this->plugin_url."/".$this->player_base[$player]."/FlowPlayerDark.swf', wmode: 'transparent', width: ".$flv_attr['width'].",  height: ".$flv_attr['height']." },
    343369      { config: { $videoFile autoPlay: ".$flv_attr['autoplay']." ,loop: ".$flv_attr['loop'].", autoRewind: ".$flv_attr['autorewind'].", autoBuffering: ".$flv_attr['autoload'].",
    344             $splashImage initialScale: 'scale' " . $flv_attr['more_2'] . "
     370            $splashImage initialScale: '$scale' " . $flv_attr['more_2'] . "
    345371            $playList                       
    346372        }}
    347373    );
     374}
    348375</script></hana-ampersand>";
    349376
     
    374401            }
    375402               
    376             $output.="<hana-ampersand><div $div_attr_string><div id='$flow3_id' style='display:block;width:".$flv_attr['width']."px;height:". $flv_attr['height']."px;' title=\"$description\">$splashImage</div></div>";
     403            $output.="<hana-ampersand><div $div_attr_string><div id='$flow3_id' style='$inactive_style' title=\"$description\">$splashImage</div></div>";
    377404//          $output.="<hana-ampersand><div $div_attr_string><a href='".$flv_attr['video']."' id='$flow3_id' style='display:block;width:".$flv_attr['width']."px;height:". $flv_attr['height']."px;'>$splashImage</a></div>";
    378405            if ( $this->user_attr['flow3key'] != "") {
     
    439466            // adding background color  => canvas: { backgroundColor: '#000000', backgroundGradient: 'none',},
    440467            $output .="
    441             <script  type='text/javascript'>
    442              
     468<script  type='text/javascript'>
     469if (!g_hasFlash){
     470    jQuery('#$flow3_id').css( 'padding', '5px' );
     471    jQuery('#$flow3_id').html(\"<span class='inactive_message' style='display:block'>$inactive_message</span> ".str_replace('"','\"',$description). "\");
     472}else{         
    443473        flowplayer('$flow3_id', { src: '$player', wmode: 'transparent' }, {
    444474        $flow3key
     
    455485           
    456486            $plugin_text
    457         });
    458             </script></hana-ampersand>
    459              ";
     487        });
     488}
     489</script></hana-ampersand>";
     490           
    460491        }else
    461492        if ($player == '5' ) { 
    462493        // mediaelement
    463494            //currently  clickurl="http://localhost/wp" is not supported
    464            
     495
     496            //              <script type='text/javascript' src='".$this->plugin_url."/".$this->player_base[$player]."/build/jquery.js'></script>
     497           
    465498            if ($this->player_used[$player] == 0 ) {
    466499                $output = "<hana-ampersand>
    467500                <style>.mejs-inner img { max-width:100%; max-height:100%; margin:0 ; padding:0 }</style>
    468                 <script type='text/javascript' src='".$this->plugin_url."/".$this->player_base[$player]."/build/jquery.js'></script>
    469501                <script type='text/javascript' src='".$this->plugin_url."/".$this->player_base[$player]."/build/mediaelement-and-player.min.js'></script>
    470502                <link rel='stylesheet' href='".$this->plugin_url."/".$this->player_base[$player]."/build/mediaelementplayer.css' />
     
    502534                $preload="preload='none'";             
    503535            }
     536            else
     537                $preload="preload='true'";             
     538               
    504539           
    505540            $autoplay='';
     
    567602<div $div_attr_string>
    568603<script language='javascript'>
    569  AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '".$flv_attr['width']."', 'height', '".$flv_attr['height']."', 'src',  '".$this->plugin_url."/".$this->player_base[$player]."/' + ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'player8' : 'player'), 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'id', 'flvPlayer', 'allowFullScreen', 'true', 'movie', '".$this->plugin_url."/".$this->player_base[$player]."/' + ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'player8' : 'player'), 'FlashVars', 'movie=".$flv_attr['video']."&bgcolor=0x333333&fgcolor=0x999999&volume=&autoload=".$flv_attr['autoload']."&autoplay=".$flv_attr['autoplay']."&autorewind=".$flv_attr['autorewind']."&loop=".$flv_attr['loop']."&clickurl=".$flv_attr['clickurl']."&clicktarget=$linkwindows','wmode','transparent');
     604if (!g_hasFlash){
     605    document.write(\"<span style='$inactive_style;padding:5px;'><span style='display:block'>$inactive_message</span> $description</span>\");
     606}else {   
     607    AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '".$flv_attr['width']."', 'height', '".$flv_attr['height']."', 'src',  '".$this->plugin_url."/".$this->player_base[$player]."/' + ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'player8' : 'player'), 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'id', 'flvPlayer', 'allowFullScreen', 'true', 'movie', '".$this->plugin_url."/".$this->player_base[$player]."/' + ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'player8' : 'player'), 'FlashVars', 'movie=".$flv_attr['video']."&bgcolor=0x333333&fgcolor=0x999999&volume=&autoload=".$flv_attr['autoload']."&autoplay=".$flv_attr['autoplay']."&autorewind=".$flv_attr['autorewind']."&loop=".$flv_attr['loop']."&clickurl=".$flv_attr['clickurl']."&clicktarget=$linkwindows','wmode','transparent');
     608}
    570609</script>
    571610<noscript>
     
    575614  <param name='movie' value='".$this->plugin_url."/".$this->player_base[$player]."/player.swf?movie=".$flv_attr['video']."&bgcolor=0x333333&fgcolor=0x999999&volume=&autoload=".$flv_attr['autoload']."&autoplay=".$flv_attr['autoplay']."&autorewind=".$flv_attr['autorewind']."&loop=".$flv_attr['loop']."&clickurl=".$flv_attr['clickurl']."&clicktarget=$linkwindows'>
    576615  <embed src='".$this->plugin_url."/".$this->player_base[$player]."/player.swf?movie=".$flv_attr['video']."&bgcolor=0x333333&fgcolor=0x999999&volume=&autoload=".$flv_attr['autoload']."&autoplay=".$flv_attr['autoplay']."&autorewind=".$flv_attr['autorewind']."&loop=".$flv_attr['loop']."&clickurl=".$flv_attr['clickurl']."&clicktarget=$linkwindows' width='".$flv_attr['width']."' height='".$flv_attr['height']."' allowFullScreen='true' type='application/x-shockwave-flash'>
    577   <p>$description</p>
     616  <span style='$inactive_style;padding:5px;'><span style='display:block'>$inactive_message</span> $description</span>
    578617 </object>
    579618</noscript>
  • hana-flv-player/trunk/readme.txt

    r534959 r535930  
    55Requires at least: 2.0
    66Tested up to: 3.3.2
    7 Stable tag: 2.8.1
     7Stable tag: 2.8.2
    88
    99Easily embed the Flash Video in your Wordpress featuring Flowplayer(version 2 and 3), OS FLV player, FLV Player Maxi, and MediaElement.js.
     
    6565*   Additional played time information is availabe for "Pause" and "Stop"
    6666
    67 = More Attributes (more_2, more_3) Sample Generator:=
     67= More Attributes (more_2, more_3) Sample Generator: =
    6868
    6969By using 'more_2', 'more_3', and 'more_4' attributes, you can use advanced features of the each players. There are tons of other options for the customization. You can use most of the options through these attributes. You can start testing by using the javascript generated provided in the settings menu. It is mainly focused on the interface design option. After selecting the options you want, you can click the 'Generate' button to generate the sample usage in the output textarea.
     
    127127= How about iPod, iPad, and iPhone support? =
    128128
    129 Flash is not supported under iPod, iPhone, and iPad. So the flash FLV players (Flowplayer, OS FLV player, and FLV Player Maxi) will not work with Apple devices. So I have added MediaElement.js HTML5 player to support Apple devices. Even if you are using one of the flash players, when Hana FLV player plugin detects Apple device, it will fallback to MediaElement.js automatically. However, remember that Apple browser does not support FLV videos. So to be compatible 100% with Apple devices, you must encode video as h.264 (mp4) since it is supported by both Apple browser and flash players.
     129Flash is not supported under iPod, iPhone, and iPad. So the flash FLV players (Flowplayer, OS FLV player, and FLV Player Maxi) will not work with Apple devices. So I have added MediaElement.js HTML5 player to support Apple devices. Also, remember that Apple browser does not support FLV videos. So to be compatible 100% with Apple devices, you must encode video as h.264 (mp4) since it is supported by both Apple browser and flash players version 9+.
    130130
    131131== Screenshots ==
     
    140140
    141141
     142= v2.8.2 (4/24/2012): =
     143
     144* If Flash video player is used and Apple device is used to view the website, gray square box shows up to indicate the Flash is not supported.
     145* Minor fixes for MediaElement.js implemenation
     146
    142147= v2.8.1 (4/22/2012): =
    143148
Note: See TracChangeset for help on using the changeset viewer.