| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: VdoCipher |
| 4 | 4 | * Plugin URI: https://www.vdocipher.com |
| 5 | 5 | * Description: Secured video hosting for WordPress |
| 6 | - * Version: 1.29 | |
| 6 | + * Version: 1.28 | |
| 7 | 7 | * Author: VdoCipher |
| 8 | 8 | * Author URI: https://www.vdocipher.com |
| 9 | 9 | * License: GPL2 |
| 10 | 10 | */ |
| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | "this server.</p>\r\n</body></html>"); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | if (!defined('VDOCIPHER_PLUGIN_VERSION')) { |
| 20 | - define('VDOCIPHER_PLUGIN_VERSION', '1.29'); | |
| 20 | + define('VDOCIPHER_PLUGIN_VERSION', '1.28'); | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | if (!defined('VDOCIPHER_PLAYER_VERSION')) { |
| 24 | 24 | define('VDOCIPHER_PLAYER_VERSION', 'v2'); |
| @@ -110,13 +110,8 @@ | ||
| 110 | 110 | 'height' => get_option('vdo_default_height'), |
| 111 | 111 | 'id' => 'id', |
| 112 | 112 | 'no_annotate'=> false, |
| 113 | 113 | 'vdo_theme'=> false, |
| 114 | - 'autoplay'=> false, | |
| 115 | - 'loop'=> false, | |
| 116 | - 'controls'=> 'on', | |
| 117 | - 'cc_language'=> false, | |
| 118 | - 'litemode'=> false, | |
| 119 | 114 | ), |
| 120 | 115 | $atts |
| 121 | 116 | ); |
| 122 | 117 | $width = $vdo_args['width']; |
| @@ -249,31 +244,12 @@ | ||
| 249 | 244 | END; |
| 250 | 245 | } |
| 251 | 246 | } else if ($vdo_embed_version_str === 'v2') { |
| 252 | 247 | $uniq = 'u' . rand(); |
| 253 | - $url = "https://player.vdocipher.com/v2/?otp=$OTP&playbackInfo=$playbackInfo"; | |
| 254 | - if (strlen($vdo_player_theme) === 16) { | |
| 255 | - $url .= "&player=$vdo_player_theme"; | |
| 256 | - } | |
| 257 | - if ($vdo_args['autoplay']) { | |
| 258 | - $url .= "&autoplay=true"; | |
| 259 | - } | |
| 260 | - if ($vdo_args['loop']) { | |
| 261 | - $url .= "&loop=true"; | |
| 262 | - } | |
| 263 | - if (in_array($vdo_args['controls'], ['off', 'native'])) { | |
| 264 | - $url .= "&controls=" . $vdo_args['controls']; | |
| 265 | - } | |
| 266 | - if ($vdo_args['cc_language']) { | |
| 267 | - $url .= "&ccLanguage=" . $vdo_args['cc_language']; | |
| 268 | - } | |
| 269 | - if ($vdo_args['litemode'] === 'true') { | |
| 270 | - $url .= "&litemode=true"; | |
| 271 | - } | |
| 272 | 248 | $output = <<<END |
| 273 | 249 | <script src="https://player.vdocipher.com/v2/api.js"></script> |
| 274 | 250 | <iframe |
| 275 | - src="$url" | |
| 251 | + src="https://player.vdocipher.com/v2/?otp=$OTP&playbackInfo=$playbackInfo" | |
| 276 | 252 | id="$uniq" |
| 277 | 253 | style="height:$height;width:$width;max-width:100%;border:0;display: block;" |
| 278 | 254 | allow="encrypted-media" |
| 279 | 255 | allowfullscreen |
| @@ -281,27 +257,20 @@ | ||
| 281 | 257 | <script> |
| 282 | 258 | (function() { |
| 283 | 259 | const iframe = document.querySelector('#$uniq'); |
| 284 | 260 | const player = VdoPlayer.getInstance(iframe); |
| 285 | - const isAutoHeight = () => iframe.style.height === 'auto' && iframe.style.width.endsWith('px'); | |
| 286 | - const setAspectRatio = (ratio) => { | |
| 261 | + player.video.addEventListener('loadstart', async () => { | |
| 262 | + const aspectRatio = (await player.api.getMetaData()).aspectRatio; | |
| 263 | + if (iframe.style.height === 'auto' && iframe.style.width.endsWith('px')) { | |
| 287 | 264 | iframe.style.maxHeight = '100vh'; |
| 288 | 265 | if (CSS.supports('aspect-ratio', 1)) { |
| 289 | - iframe.style.aspectRatio = ratio; | |
| 266 | + iframe.style.aspectRatio = aspectRatio; | |
| 290 | 267 | } else { |
| 291 | 268 | const offsetWidth = iframe.offsetWidth; |
| 292 | - iframe.style.height = Math.round(offsetWidth / ratio) + 'px'; | |
| 269 | + iframe.style.height = Math.round(offsetWidth / aspectRatio) + 'px'; | |
| 293 | 270 | } |
| 294 | - } | |
| 295 | - if (isAutoHeight()) { | |
| 296 | - if (iframe.src.includes('litemode')) { | |
| 297 | - setAspectRatio(16/9); | |
| 298 | 271 | } |
| 299 | - player.video.addEventListener('loadstart', async () => { | |
| 300 | - const aspectRatio = (await player.api.getMetaData()).aspectRatio; | |
| 301 | - setAspectRatio(aspectRatio); | |
| 302 | - }); | |
| 303 | - } | |
| 272 | + }); | |
| 304 | 273 | })(); |
| 305 | 274 | </script> |
| 306 | 275 | END; |
| 307 | 276 | if ($speedOptions !== false && preg_match($speedPattern, $speedOptions)) { |