| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
$bppiv_block = call_user_func( function() use ( $get_value, $bppiv_meta, $bppiv_width, $bppiv_height ) { |
| 7 |
return [ |
| 8 |
"blockName" => "panorama/video", |
| 9 |
"attrs" => [ |
| 10 |
"videoUrl" => $get_value('bppiv_video_src', false, 0, 'url'), |
| 11 |
"options" => [ |
| 12 |
"autoplay" => $get_value('bppiv_auto_play', true), |
| 13 |
"loop" => $get_value('bppiv_video_loop', true, true), |
| 14 |
"muted" => $get_value('bppiv_video_mute', true), |
| 15 |
"controlBar" => $get_value('control_show_hide_video', true, true), |
| 16 |
"fullscreen" => $get_value('video_fullscreen_ctrl', true, true), |
| 17 |
"setting" => $get_value('video_setting_ctrl', true, true), |
| 18 |
"video" => $get_value('video_video_range_ctrl', true, true), |
| 19 |
"initialView" => $get_value('initial_view_video', true), |
| 20 |
"initialPosition" => [ |
| 21 |
"x" => (float)$get_value('initial_view_video_property', false, 0, 'top'), |
| 22 |
"y" => (float)$get_value('initial_view_video_property', false, 0, 'right'), |
| 23 |
"z" => (float)$get_value('initial_view_video_property', false, 0, 'bottom') |
| 24 |
] |
| 25 |
], |
| 26 |
"layout" => [ |
| 27 |
"alignSl" => [ |
| 28 |
"desktop" =>$bppiv_meta['bppiv_alignment'] ?? "center", |
| 29 |
"tablet" => $bppiv_meta['bppiv_alignment'] ?? "center", |
| 30 |
"mobile" => $bppiv_meta['bppiv_alignment'] ?? "center" |
| 31 |
], |
| 32 |
"width" => [ |
| 33 |
"desktop" => $bppiv_width, |
| 34 |
"tablet" => $bppiv_width, |
| 35 |
"mobile" => $bppiv_width |
| 36 |
], |
| 37 |
"height" => [ |
| 38 |
"desktop" => $bppiv_height, |
| 39 |
"tablet" => $bppiv_height, |
| 40 |
"mobile" => $bppiv_height |
| 41 |
] |
| 42 |
] |
| 43 |
], |
| 44 |
"innerBlocks" => [], |
| 45 |
"innerHTML" => "", |
| 46 |
"innerContent" => [] |
| 47 |
]; |
| 48 |
} ); |