PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.1.3
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.1.3
9.1.3 9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 All 222 releases
← All changes | src/Frontend/Shortcode.php +16 -1 9.0.09.1.3 View file →
@@ -39,9 +39,9 @@
39 39 if ( $tour_type === 'street-view' && ! isset( $postdata['streetviewdata'] ) ) {
40 40 return $this->render_streetview( $postdata, $parsed );
41 41 }
42 42
43 - if ( $tour_type === 'video' && ! isset( $postdata['vidid'] ) ) {
43 + if ( $tour_type === 'video' ) {
44 44 return $this->render_video( $postdata, $parsed, $id );
45 45 }
46 46 }
47 47
@@ -49,8 +49,11 @@
49 49 return $this->legacy->wpvr_shortcode( $atts );
50 50 }
51 51
52 52 private function render_streetview( array $postdata, array $atts ) {
53 + if ( function_exists( 'wpvr_enqueue_frontend_scripts' ) ) {
54 + wpvr_enqueue_frontend_scripts( 'streetview' );
55 + }
53 56 $width = ! empty( $atts['width'] ) ? esc_attr( $atts['width'] ) : '600px';
54 57 $height = ! empty( $atts['height'] ) ? esc_attr( $atts['height'] ) : '400px';
55 58 $url = esc_url( $postdata['streetviewurl'] ?? '' );
56 59
@@ -59,8 +62,12 @@
59 62 . '</div>';
60 63 }
61 64
62 65 private function render_video( array $postdata, array $atts, int $id ) {
66 + if ( function_exists( 'wpvr_enqueue_frontend_scripts' ) ) {
67 + wpvr_enqueue_frontend_scripts( 'video' );
68 + }
69 +
63 70 $width = ! empty( $atts['width'] ) ? esc_attr( $atts['width'] ) : '600px';
64 71 $height = ! empty( $atts['height'] ) ? esc_attr( $atts['height'] ) : '400px';
65 72 $radius = ! empty( $atts['radius'] ) ? esc_attr( $atts['radius'] ) : null;
66 73
@@ -66,8 +73,16 @@
66 73
67 74 // New UI stores video-autoplay / video-loop; legacy renderer expects autoplay / loop.
68 75 $postdata['autoplay'] = $postdata['video-autoplay'] ?? 'off';
69 76 $postdata['loop'] = $postdata['video-loop'] ?? 'off';
77 +
78 + $vidid = ! empty( $postdata['vidid'] ) ? $postdata['vidid'] : ( 'vid' . $id );
79 + $postdata['vidid'] = $vidid;
80 +
81 + if ( empty( $postdata['panoviddata'] ) && ! empty( $postdata['vidurl'] ) ) {
82 + $format = new \WPVR_Format();
83 + $postdata['panoviddata'] = $format->prepare_selfhost_video_meta_data( $postdata['vidurl'], $vidid, $postdata );
84 + }
70 85
71 86 return $this->legacy_video->render_video_shortcode( $postdata, $id, $width, $height, $radius );
72 87 }
73 88 }