Changeset 535930
- Timestamp:
- 04/25/2012 02:51:10 AM (14 years ago)
- Location:
- hana-flv-player/trunk
- Files:
-
- 2 edited
-
hana-flv-player.php (modified) (13 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hana-flv-player/trunk/hana-flv-player.php
r534959 r535930 4 4 Plugin URI: http://wpmarketing.org/plugins/hana-flv-player/ 5 5 Description: 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. 16 Version: 2.8.2 7 7 Author: HanaDaddy 8 8 Author URI: http://neox.net … … 16 16 17 17 var $plugin_folder ='hana-flv-player'; 18 var $version="2.8. 1";18 var $version="2.8.2"; 19 19 var $user_attr ; 20 20 var $update_result=''; … … 73 73 function bind_hooks() { 74 74 // 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 75 79 add_filter('wp_head',array(&$this,'print_head_javascript')); 76 80 add_filter('the_content', array(&$this,'hana_flv_return') , 1); … … 88 92 89 93 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'> 98 var g_hasFlash = false; 99 try { 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 92 110 } 93 111 … … 249 267 $description="*Video:".htmlspecialchars($flv_attr['description']); 250 268 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 251 273 if ($player == '3' ) { 252 274 // flv player maxi … … 290 312 <param name='movie' value='".$this->plugin_url."/".$this->player_base[$player]."/template_maxi/player_flv_maxi.swf' /> 291 313 <param name='allowFullScreen' value='true' /> 292 <param name='wmode' value='transparent' >314 <param name='wmode' value='transparent' /> 293 315 <param name='FlashVars' value='flv=".$flv_attr['video']."&width=".$flv_attr['width']."&height=".$flv_attr['height']."&autoplay=".$flv_attr['autoplay']."&autoload=".$flv_attr['autoload'].$splashImage."&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> 295 317 </object></hana-ampersand>"; 296 318 … … 331 353 // $flv_attr['more_2'] = $flv_attr['more_2'] . ','; 332 354 //} 333 355 334 356 335 357 //initialScale : Scale or fit 336 358 //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'; 338 360 $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> 340 362 <script type='text/javascript'> 363 if (!g_hasFlash){ 364 jQuery('#$flow_id').css( 'padding', '5px' ); 365 jQuery('#$flow_id .inactive_message').html('$inactive_message'); 366 }else{ 341 367 flashembed2('$flow_id', 342 368 { src:'".$this->plugin_url."/".$this->player_base[$player]."/FlowPlayerDark.swf', wmode: 'transparent', width: ".$flv_attr['width'].", height: ".$flv_attr['height']." }, 343 369 { 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'] . " 345 371 $playList 346 372 }} 347 373 ); 374 } 348 375 </script></hana-ampersand>"; 349 376 … … 374 401 } 375 402 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>"; 377 404 // $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>"; 378 405 if ( $this->user_attr['flow3key'] != "") { … … 439 466 // adding background color => canvas: { backgroundColor: '#000000', backgroundGradient: 'none',}, 440 467 $output .=" 441 <script type='text/javascript'> 442 468 <script type='text/javascript'> 469 if (!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{ 443 473 flowplayer('$flow3_id', { src: '$player', wmode: 'transparent' }, { 444 474 $flow3key … … 455 485 456 486 $plugin_text 457 }); 458 </script></hana-ampersand> 459 "; 487 }); 488 } 489 </script></hana-ampersand>"; 490 460 491 }else 461 492 if ($player == '5' ) { 462 493 // mediaelement 463 494 //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 465 498 if ($this->player_used[$player] == 0 ) { 466 499 $output = "<hana-ampersand> 467 500 <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>469 501 <script type='text/javascript' src='".$this->plugin_url."/".$this->player_base[$player]."/build/mediaelement-and-player.min.js'></script> 470 502 <link rel='stylesheet' href='".$this->plugin_url."/".$this->player_base[$player]."/build/mediaelementplayer.css' /> … … 502 534 $preload="preload='none'"; 503 535 } 536 else 537 $preload="preload='true'"; 538 504 539 505 540 $autoplay=''; … … 567 602 <div $div_attr_string> 568 603 <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'); 604 if (!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 } 570 609 </script> 571 610 <noscript> … … 575 614 <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'> 576 615 <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> 578 617 </object> 579 618 </noscript> -
hana-flv-player/trunk/readme.txt
r534959 r535930 5 5 Requires at least: 2.0 6 6 Tested up to: 3.3.2 7 Stable tag: 2.8. 17 Stable tag: 2.8.2 8 8 9 9 Easily embed the Flash Video in your Wordpress featuring Flowplayer(version 2 and 3), OS FLV player, FLV Player Maxi, and MediaElement.js. … … 65 65 * Additional played time information is availabe for "Pause" and "Stop" 66 66 67 = More Attributes (more_2, more_3) Sample Generator: =67 = More Attributes (more_2, more_3) Sample Generator: = 68 68 69 69 By 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. … … 127 127 = How about iPod, iPad, and iPhone support? = 128 128 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.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. 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+. 130 130 131 131 == Screenshots == … … 140 140 141 141 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 142 147 = v2.8.1 (4/22/2012): = 143 148
Note: See TracChangeset
for help on using the changeset viewer.