Changeset 3197684
- Timestamp:
- 11/26/2024 08:31:27 PM (16 months ago)
- Location:
- hls-player
- Files:
-
- 4 edited
- 1 copied
-
tags/1.0.11 (copied) (copied from hls-player/trunk)
-
tags/1.0.11/Readme.txt (modified) (1 diff)
-
tags/1.0.11/hls-player.php (modified) (8 diffs)
-
trunk/Readme.txt (modified) (1 diff)
-
trunk/hls-player.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hls-player/tags/1.0.11/Readme.txt
r3167577 r3197684 4 4 Donate link: https://donate.stripe.com/5kA7w2bRl3KN7qU3cd 5 5 Requires at least: 6.4 6 Tested up to: 6. 66 Tested up to: 6.7 7 7 Requires PHP: 8.1 8 Stable tag: 1.0.1 08 Stable tag: 1.0.11 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0 -
hls-player/tags/1.0.11/hls-player.php
r3167577 r3197684 4 4 * Plugin URI: https://github.com/root-sector/wordpress-plugin-hls-player-free 5 5 * Description: HLS Player is a simple, lightweight HTTP Live Streaming player for WordPress. Leveraging video.js, the leading open-source HTML5 player, it enables effortless embedding of both responsive and fixed-width .m3u8 or .mpd HLS videos into posts and pages. 6 * Version: 1.0.1 06 * Version: 1.0.11 7 7 * Requires at least: 6.4 8 8 * Requires PHP: 8.1 … … 17 17 } 18 18 19 define('HLS_PLAYER_VERSION', '1.0.1 0');19 define('HLS_PLAYER_VERSION', '1.0.11'); 20 20 21 21 class HLSPlayer … … 52 52 return; 53 53 } 54 // Define shortcode attributes with defaults 55 $default_atts = array( 54 55 // Define allowed shortcode attributes with defaults 56 $allowed_atts = array( 56 57 'url' => '', 57 'class' => ' ',58 'class' => 'video-js vjs-fluid', 58 59 'width' => '', 59 60 'height' => '', … … 65 66 'poster' => '', 66 67 'captions' => '', 68 'protected' => 'false', 69 'withcredentials' => 'false', 70 'kinesis_video_stream' => 'false', 71 'cloudfront_signed_cookies' => 'false', 67 72 'videojs_custom_options_json' => '{}', 68 73 ); 69 74 70 // Parse shortcode attributes 71 $atts = shortcode_atts($default_atts, $atts, 'videojs_hls'); 75 // Only use attributes that are explicitly defined in allowed_atts 76 $filtered_atts = is_array($atts) ? array_intersect_key($atts, $allowed_atts) : array(); 77 78 // Parse shortcode attributes with our filtered attributes 79 $atts = shortcode_atts($allowed_atts, $filtered_atts, 'videojs_hls'); 72 80 73 81 // Generate a unique id for the video element … … 75 83 76 84 // Generate video tag attributes 77 $class = !empty($atts['class']) ? $atts['class']: 'video-js vjs-fluid';85 $class = !empty($atts['class']) ? esc_attr($atts['class']) : 'video-js vjs-fluid'; 78 86 $controls = $atts['controls'] == 'false' ? '' : ' controls'; 79 87 $preload = $atts['preload'] == 'metadata' ? ' preload="metadata"' : ($atts['preload'] == 'none' ? ' preload="none"' : ' preload="auto"'); … … 81 89 $loop = $atts['loop'] == 'true' ? ' loop' : ''; 82 90 $muted = $atts['muted'] == 'true' ? ' muted' : ''; 83 $poster = !empty($atts['poster']) ? ' poster="' . $atts['poster']. '"' : '';91 $poster = !empty($atts['poster']) ? ' poster="' . esc_url($atts['poster']) . '"' : ''; 84 92 85 93 $type = ''; // Initialize with empty type … … 125 133 } 126 134 127 $video_html = ' 128 <div style="position: relative;"> 129 <video id="' . $video_id . '" class="' . $class . '" ' . $controls . $preload . $autoplay . $loop . $muted . $poster . ' width="' . $atts['width'] . '" height="' . $atts['height'] . '"> 130 </video> 131 </div>'; 135 $video_html = sprintf( 136 '<div style="position: relative;"><video id="%s" class="%s"%s%s%s%s%s%s%s%s></video></div>', 137 esc_attr($video_id), 138 $class, 139 $controls, 140 $preload, 141 $autoplay, 142 $loop, 143 $muted, 144 $poster, 145 !empty($atts['width']) ? ' width="' . esc_attr($atts['width']) . '"' : '', 146 !empty($atts['height']) ? ' height="' . esc_attr($atts['height']) . '"' : '' 147 ); 132 148 133 149 $script_data = array( … … 140 156 141 157 $encoded_data = base64_encode(json_encode($script_data)); 142 $inline_script = "var hlsPlayerData_{$video_id} = ' {$encoded_data}';";158 $inline_script = "var hlsPlayerData_{$video_id} = '" . esc_js($encoded_data) . "';"; 143 159 144 160 // Enqueue the main script and add the inline script -
hls-player/trunk/Readme.txt
r3167577 r3197684 4 4 Donate link: https://donate.stripe.com/5kA7w2bRl3KN7qU3cd 5 5 Requires at least: 6.4 6 Tested up to: 6. 66 Tested up to: 6.7 7 7 Requires PHP: 8.1 8 Stable tag: 1.0.1 08 Stable tag: 1.0.11 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0 -
hls-player/trunk/hls-player.php
r3167577 r3197684 4 4 * Plugin URI: https://github.com/root-sector/wordpress-plugin-hls-player-free 5 5 * Description: HLS Player is a simple, lightweight HTTP Live Streaming player for WordPress. Leveraging video.js, the leading open-source HTML5 player, it enables effortless embedding of both responsive and fixed-width .m3u8 or .mpd HLS videos into posts and pages. 6 * Version: 1.0.1 06 * Version: 1.0.11 7 7 * Requires at least: 6.4 8 8 * Requires PHP: 8.1 … … 17 17 } 18 18 19 define('HLS_PLAYER_VERSION', '1.0.1 0');19 define('HLS_PLAYER_VERSION', '1.0.11'); 20 20 21 21 class HLSPlayer … … 52 52 return; 53 53 } 54 // Define shortcode attributes with defaults 55 $default_atts = array( 54 55 // Define allowed shortcode attributes with defaults 56 $allowed_atts = array( 56 57 'url' => '', 57 'class' => ' ',58 'class' => 'video-js vjs-fluid', 58 59 'width' => '', 59 60 'height' => '', … … 65 66 'poster' => '', 66 67 'captions' => '', 68 'protected' => 'false', 69 'withcredentials' => 'false', 70 'kinesis_video_stream' => 'false', 71 'cloudfront_signed_cookies' => 'false', 67 72 'videojs_custom_options_json' => '{}', 68 73 ); 69 74 70 // Parse shortcode attributes 71 $atts = shortcode_atts($default_atts, $atts, 'videojs_hls'); 75 // Only use attributes that are explicitly defined in allowed_atts 76 $filtered_atts = is_array($atts) ? array_intersect_key($atts, $allowed_atts) : array(); 77 78 // Parse shortcode attributes with our filtered attributes 79 $atts = shortcode_atts($allowed_atts, $filtered_atts, 'videojs_hls'); 72 80 73 81 // Generate a unique id for the video element … … 75 83 76 84 // Generate video tag attributes 77 $class = !empty($atts['class']) ? $atts['class']: 'video-js vjs-fluid';85 $class = !empty($atts['class']) ? esc_attr($atts['class']) : 'video-js vjs-fluid'; 78 86 $controls = $atts['controls'] == 'false' ? '' : ' controls'; 79 87 $preload = $atts['preload'] == 'metadata' ? ' preload="metadata"' : ($atts['preload'] == 'none' ? ' preload="none"' : ' preload="auto"'); … … 81 89 $loop = $atts['loop'] == 'true' ? ' loop' : ''; 82 90 $muted = $atts['muted'] == 'true' ? ' muted' : ''; 83 $poster = !empty($atts['poster']) ? ' poster="' . $atts['poster']. '"' : '';91 $poster = !empty($atts['poster']) ? ' poster="' . esc_url($atts['poster']) . '"' : ''; 84 92 85 93 $type = ''; // Initialize with empty type … … 125 133 } 126 134 127 $video_html = ' 128 <div style="position: relative;"> 129 <video id="' . $video_id . '" class="' . $class . '" ' . $controls . $preload . $autoplay . $loop . $muted . $poster . ' width="' . $atts['width'] . '" height="' . $atts['height'] . '"> 130 </video> 131 </div>'; 135 $video_html = sprintf( 136 '<div style="position: relative;"><video id="%s" class="%s"%s%s%s%s%s%s%s%s></video></div>', 137 esc_attr($video_id), 138 $class, 139 $controls, 140 $preload, 141 $autoplay, 142 $loop, 143 $muted, 144 $poster, 145 !empty($atts['width']) ? ' width="' . esc_attr($atts['width']) . '"' : '', 146 !empty($atts['height']) ? ' height="' . esc_attr($atts['height']) . '"' : '' 147 ); 132 148 133 149 $script_data = array( … … 140 156 141 157 $encoded_data = base64_encode(json_encode($script_data)); 142 $inline_script = "var hlsPlayerData_{$video_id} = ' {$encoded_data}';";158 $inline_script = "var hlsPlayerData_{$video_id} = '" . esc_js($encoded_data) . "';"; 143 159 144 160 // Enqueue the main script and add the inline script
Note: See TracChangeset
for help on using the changeset viewer.