Changeset 2047525
- Timestamp:
- 03/10/2019 10:59:40 AM (7 years ago)
- Location:
- embed-simplex-player/trunk
- Files:
-
- 2 added
- 2 edited
-
embed-simplex-player.php (modified) (8 diffs)
-
js (added)
-
js/script.js (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
embed-simplex-player/trunk/embed-simplex-player.php
r2047135 r2047525 2 2 /** 3 3 * @package embed-simplex-player 4 * @version 1.0. 24 * @version 1.0.3 5 5 */ 6 6 /* … … 8 8 Plugin URI: https://wordpress.org/plugins/embed-simplex-player/ 9 9 Description: Integrate the xtendx simplex player with a shortcode. Generates an embed code and displays the simplex player in a responsive iframe. 10 Version: 1.0. 210 Version: 1.0.3 11 11 Author: Reto Kuhn 12 12 Author URI: https://retokuhn.ch … … 40 40 'pid' => '', 41 41 'embed' => '1', 42 'width' => ' 1280',43 'height' => ' 720',42 'width' => '', 43 'height' => '', 44 44 'get' => '', 45 45 'style_wrapper' => '', 46 46 'style_iframe' => '', 47 47 'thumbnail' => '', 48 'style_thumbnail' => '', 48 49 ), $atts, $tag ); 49 50 … … 60 61 $width = sanitize_key( $atts['width'] ); 61 62 $height = sanitize_key( $atts['height'] ); 62 $ratio = ($height / $width) * 100;63 63 $get = $atts['get']; 64 64 if ( !empty($get) ) { … … 69 69 $style_iframe = sanitize_text_field( $atts['style_iframe'] ); 70 70 $thumbnail = sanitize_text_field( $atts['thumbnail'] ); 71 $style_thumbnail = sanitize_text_field( $atts['style_thumbnail'] ); 71 72 72 73 // create iframe url … … 76 77 77 78 // iframe 78 $iframe_code = '<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;' . $style_iframe . '" width="' . $width . '" height="' . $height . '"';79 $iframe_code = '<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;' . $style_iframe . '"'; 79 80 $iframe_code .= 'src="' . $iframe_url . '" '; 80 81 $iframe_code .= 'frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" scrolling="no">'; … … 82 83 83 84 // output start 84 $output = '<div style="position:relative;padding-bottom:' . $ratio . '%;height:0;overflow:hidden;margin:0;max-width:none;' . $style_wrapper . '">'; 85 if ( !empty($height) ) { 86 $style_size = "height:" . $height . "px;"; 87 if ( !empty($width) ) { 88 $style_size .= "width:" . $width . "px;"; 89 } 90 }else{ 91 $width = 1280; 92 $height = 720; 93 $ratio = ($height / $width) * 100; 94 $style_size = "padding-bottom:" . $ratio . "%;"; 95 } 96 97 $output = '<div style="position:relative;overflow:hidden;' . $style_size . $style_wrapper . '">'; 85 98 86 99 // thumbnail 87 100 if ($thumbnail == 1) { 88 101 $thumbnail_url = $url . 'content/' . $cid . '/' . $aid . '/' . $pid . '/simvid_1.jpg'; 89 $thumbnail_code = '<script>function loadIframe(el) { el.parentNode.innerHTML="'.addslashes($iframe_code).'"; }</script>'; 90 $thumbnail_code .= '<img src="'.$thumbnail_url.'" onclick="loadIframe(this);">'; 102 $thumbnail_code = '<img src="'.$thumbnail_url.'" data-iframe-code="'.str_replace('"', "'", $iframe_code).'" onclick="loadIframe(this);">'; 91 103 $output .= $thumbnail_code; 92 104 }else{ … … 104 116 } 105 117 118 function embed_simplex_player_script() { 119 wp_register_script('embed-simplex-player', plugins_url('embed-simplex-player/js/script.js')); 120 wp_enqueue_script('embed-simplex-player'); 121 } 122 add_action( 'wp_enqueue_scripts', 'embed_simplex_player_script' ); 123 106 124 function embed_simplex_player_init() { 107 125 add_shortcode('embed-simplex-player', 'embed_simplex_player'); -
embed-simplex-player/trunk/readme.txt
r2047135 r2047525 3 3 Tags: xtendx, simplex, player, embed 4 4 Requires at least: 4.0 5 Tested up to: 5. 1.05 Tested up to: 5.2.0 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 65 65 = 1.0.2 = 66 66 * Additional parameter "thumbnail" loads video iframe after a click on the thumbnail image. 67 = 1.0.3 = 68 * Fixed issues with parameters "thumbnail", "width", "height".
Note: See TracChangeset
for help on using the changeset viewer.