WP VR – 360 Panorama and virtual tour creator for WordPress - Version 4.1.0

Version Description

  • 360 video autoplay and loop
  • Mouse scroll support added

=

Download this release

Release Info

Developer rextheme
Plugin Icon 128x128 WP VR – 360 Panorama and virtual tour creator for WordPress
Version 4.1.0
Comparing to
See all releases

Code changes from version 4.0.0 to 4.1.0

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://rextheme.com/wp-vr-360-panorama-and-virtual-tour-creator-fo
4
  Tags: virtual tour, real estate tour, panorama, panorama viewer, virtual tour, 360 panorama, interactive tour
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
- Stable tag: 4.0.0
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -112,7 +112,9 @@ For more control over creating a virtual tour, learn about the [Premium version]
112
  * Google street view embed
113
  * Company logo
114
  * Partial Panorama
115
- * WP User Role based Add/Edit feature
 
 
116
  * Personalized support (e-mail or forum)
117
 
118
  [Instructions to upgrade to pro](https://rextheme.com/docs/wp-vr/how-to-upgrade-to-pro/)
@@ -327,5 +329,9 @@ Simply add "/plugins/wpvr" to exclusion field (or use the location where you sto
327
  = 4.0.0 =
328
  * User role support added
329
 
 
 
 
 
330
  == Upgrade Notice ==
331
  Please do update the WP VR to the latest version. Each update makes it sure your plugin is supporting all tour features.  
4
  Tags: virtual tour, real estate tour, panorama, panorama viewer, virtual tour, 360 panorama, interactive tour
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
+ Stable tag: 4.1.0
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
112
  * Google street view embed
113
  * Company logo
114
  * Partial Panorama
115
+ * User role support
116
+ * Mouse scroll switch
117
+ * 360 video autoplay and loop switch
118
  * Personalized support (e-mail or forum)
119
 
120
  [Instructions to upgrade to pro](https://rextheme.com/docs/wp-vr/how-to-upgrade-to-pro/)
329
  = 4.0.0 =
330
  * User role support added
331
 
332
+ = 4.1.0 =
333
+ * 360 video autoplay and loop
334
+ * Mouse scroll support added
335
+
336
  == Upgrade Notice ==
337
  Please do update the WP VR to the latest version. Each update makes it sure your plugin is supporting all tour features.  
admin/class-wpvr-ajax.php CHANGED
@@ -38,6 +38,14 @@ class Wpvr_Ajax {
38
  $compass = false;
39
  }
40
 
 
 
 
 
 
 
 
 
41
  $autoload = sanitize_text_field($_POST['autoload']);
42
  if ($autoload == 'on') {
43
  $autoload = true;
@@ -467,7 +475,7 @@ class Wpvr_Ajax {
467
  $pano_id_array = array();
468
  $pano_id_array = array("panoid"=>$panoid);
469
  $pano_response = array();
470
- $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,"compass"=>$compass,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
471
 
472
  if ($rotation == 'off') {
473
  unset($pano_response['autoRotate']);
@@ -501,25 +509,57 @@ class Wpvr_Ajax {
501
  $randid = rand(1000, 1000000);
502
  $vidid = 'vid'.$randid;
503
  $videourl = sanitize_url($_POST['videourl']);
 
 
504
 
505
  $vidtype = '';
506
  if (strpos($videourl, 'youtube') > 0) {
507
  $vidtype = 'youtube';
508
  $explodeid = '';
509
  $explodeid = explode("=",$videourl);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
510
  $foundid = '';
511
- $foundid = $explodeid[1];
512
  $html = '';
513
- $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
514
 
515
  } elseif (strpos($videourl, 'youtu.be') > 0) {
516
  $vidtype = 'youtube';
517
  $explodeid = '';
518
  $explodeid = explode("/",$videourl);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
  $foundid = '';
520
- $foundid = $explodeid[3];
521
  $html = '';
522
- $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
523
 
524
  }
525
  elseif (strpos($videourl, 'vimeo') > 0) {
@@ -527,32 +567,44 @@ class Wpvr_Ajax {
527
  $explodeid = '';
528
  $explodeid = explode("/",$videourl);
529
  $foundid = '';
530
- $foundid = $explodeid[3];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
  $html = '';
532
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="600" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
533
 
534
  } else {
535
  $vidtype = 'selfhost';
536
- $vidautoplay = '';
537
- $vidautoplay = sanitize_text_field($_POST['vidautoplay']);
538
- if ($vidautoplay == 'on') {
539
- $vidautoplay = 'autoplay';
540
  }
541
  else {
542
- $vidautoplay = '';
543
  }
544
 
545
- $vidcontrol = '';
546
- $vidcontrol = sanitize_text_field($_POST['vidcontrol']);
547
- if ($vidcontrol == 'on') {
548
- $vidcontrol = 'controls';
549
  }
550
  else {
551
- $vidcontrol = '';
552
  }
553
 
554
  $html = '';
555
- $html .= '<video id="'.$vidid.'" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="none" style="width:100%;height:400px;" poster="" >';
556
  $html .= '<source src="'.$videourl.'" type="video/mp4"/>';
557
  $html .= '<p class="vjs-no-js">';
558
  $html .= 'To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com html5-video-support/" target="_blank">supports HTML5 video</a>';
@@ -589,16 +641,34 @@ class Wpvr_Ajax {
589
  $pnovideo = $_POST['panovideo'];
590
  if ($pnovideo == "on") {
591
 
592
-
593
  $vidid = 'vid'.$postid;
594
  $videourl = sanitize_url($_POST['videourl']);
 
 
 
 
595
  $vidtype = '';
596
  if (strpos($videourl, 'youtube') > 0) {
597
  $vidtype = 'youtube';
598
  $explodeid = '';
599
  $explodeid = explode("=",$videourl);
600
  $foundid = '';
601
- $foundid = $explodeid[1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  $html = '';
603
  $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
604
 
@@ -607,7 +677,22 @@ class Wpvr_Ajax {
607
  $explodeid = '';
608
  $explodeid = explode("/",$videourl);
609
  $foundid = '';
610
- $foundid = $explodeid[3];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
611
  $html = '';
612
  $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
613
 
@@ -618,7 +703,22 @@ class Wpvr_Ajax {
618
  $explodeid = '';
619
  $explodeid = explode("/",$videourl);
620
  $foundid = '';
621
- $foundid = $explodeid[3];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  $html = '';
623
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="600" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
624
 
@@ -626,24 +726,23 @@ class Wpvr_Ajax {
626
  $vidtype = 'selfhost';
627
  $vidautoplay = '';
628
  $vidautoplay = sanitize_text_field($_POST['vidautoplay']);
629
- if ($vidautoplay == 'on') {
630
- $vidautoplay = 'autoplay';
 
631
  }
632
  else {
633
- $vidautoplay = '';
634
  }
635
 
636
- $vidcontrol = '';
637
- $vidcontrol = sanitize_text_field($_POST['vidcontrol']);
638
- if ($vidcontrol == 'on') {
639
- $vidcontrol = 'controls';
640
  }
641
  else {
642
- $vidcontrol = '';
643
  }
644
 
645
  $html = '';
646
- $html .= '<video id="'.$vidid.'" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="none" style="width:100%;height:100%;" poster="" >';
647
  $html .= '<source src="'.$videourl.'" type="video/mp4"/>';
648
  $html .= '<p class="vjs-no-js">';
649
  $html .= 'To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com html5-video-support/" target="_blank">supports HTML5 video</a>';
@@ -651,8 +750,10 @@ class Wpvr_Ajax {
651
  $html .= '</video>';
652
  }
653
 
 
 
654
  $videoarray = array();
655
- $videoarray = array(__( "panoid" )=>$panoid,__( "panoviddata" )=>$html,__( "vidid" )=>$vidid,__( "vidurl" )=>$videourl,__( "vidautoplay" )=>$vidautoplay,__( "vidcontrol" )=>$vidcontrol,__( "vidtype" )=>$vidtype);
656
  update_post_meta( $postid, 'panodata', $videoarray );
657
  die();
658
  }
@@ -696,6 +797,14 @@ class Wpvr_Ajax {
696
  $compass = false;
697
  }
698
 
 
 
 
 
 
 
 
 
699
  $autoload = sanitize_text_field($_POST['autoload']);
700
  if ($autoload == 'on') {
701
  $autoload = true;
@@ -997,7 +1106,7 @@ class Wpvr_Ajax {
997
  }
998
 
999
  $pano_array = array();
1000
- $pano_array = array(__( "panoid" )=>$panoid,__( "autoLoad" )=>$autoload,__( "showControls" )=>$control,__( "cpLogoSwitch" )=>$cpLogoSwitch,__( "cpLogoImg" )=>$cpLogoImg,__( "cpLogoContent" )=>$cpLogoContent,__( "vrgallery" )=>$vrgallery,__( "customcontrol" )=>$custom_control,__( "gyro" )=>$gyro,__( "compass" )=>$compass,__( "autoRotate" )=>$autorotation,__( "autoRotateInactivityDelay" )=>$autorotationinactivedelay,__( "autoRotateStopDelay" )=>$autorotationstopdelay,__( "preview" )=>$preview,__( "defaultscene" )=>$default_scene,__( "scenefadeduration" )=>$scene_fade_duration,__( "panodata" )=>$panodata);
1001
 
1002
  if ($rotation == 'off') {
1003
  unset($pano_array['autoRotate']);
38
  $compass = false;
39
  }
40
 
41
+ $mouseZoom = sanitize_text_field($_POST['mouseZoom']);
42
+ if ($mouseZoom == 'on') {
43
+ $mouseZoom = true;
44
+ }
45
+ else {
46
+ $mouseZoom = false;
47
+ }
48
+
49
  $autoload = sanitize_text_field($_POST['autoload']);
50
  if ($autoload == 'on') {
51
  $autoload = true;
475
  $pano_id_array = array();
476
  $pano_id_array = array("panoid"=>$panoid);
477
  $pano_response = array();
478
+ $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,"compass"=>$compass,"mouseZoom"=>$mouseZoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
479
 
480
  if ($rotation == 'off') {
481
  unset($pano_response['autoRotate']);
509
  $randid = rand(1000, 1000000);
510
  $vidid = 'vid'.$randid;
511
  $videourl = sanitize_url($_POST['videourl']);
512
+ $autoplay = sanitize_text_field($_POST['autoplay']);
513
+ $loop = sanitize_text_field($_POST['loop']);
514
 
515
  $vidtype = '';
516
  if (strpos($videourl, 'youtube') > 0) {
517
  $vidtype = 'youtube';
518
  $explodeid = '';
519
  $explodeid = explode("=",$videourl);
520
+
521
+ if ($autoplay == 'on') {
522
+ $autoplay = '&autoplay=1';
523
+ }
524
+ else {
525
+ $autoplay = '';
526
+ }
527
+
528
+ if ($loop == 'on') {
529
+ $loop = '&loop=1';
530
+ }
531
+ else {
532
+ $loop = '';
533
+ }
534
+
535
  $foundid = '';
536
+ $foundid = $explodeid[1].'?'.$autoplay.$loop;
537
  $html = '';
538
+ $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
539
 
540
  } elseif (strpos($videourl, 'youtu.be') > 0) {
541
  $vidtype = 'youtube';
542
  $explodeid = '';
543
  $explodeid = explode("/",$videourl);
544
+
545
+ if ($autoplay == 'on') {
546
+ $autoplay = '&autoplay=1';
547
+ }
548
+ else {
549
+ $autoplay = '';
550
+ }
551
+
552
+ if ($loop == 'on') {
553
+ $loop = '&loop=1';
554
+ }
555
+ else {
556
+ $loop = '';
557
+ }
558
+
559
  $foundid = '';
560
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
561
  $html = '';
562
+ $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
563
 
564
  }
565
  elseif (strpos($videourl, 'vimeo') > 0) {
567
  $explodeid = '';
568
  $explodeid = explode("/",$videourl);
569
  $foundid = '';
570
+
571
+ if ($autoplay == 'on') {
572
+ $autoplay = '&autoplay=1&muted=1';
573
+ }
574
+ else {
575
+ $autoplay = '';
576
+ }
577
+
578
+ if ($loop == 'on') {
579
+ $loop = '&loop=1';
580
+ }
581
+ else {
582
+ $loop = '';
583
+ }
584
+
585
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
586
  $html = '';
587
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="600" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
588
 
589
  } else {
590
  $vidtype = 'selfhost';
591
+
592
+ if ($autoplay == 'on') {
593
+ $autoplay = 'autoplay';
 
594
  }
595
  else {
596
+ $autoplay = '';
597
  }
598
 
599
+ if ($loop == 'on') {
600
+ $loop = 'loop';
 
 
601
  }
602
  else {
603
+ $loop = '';
604
  }
605
 
606
  $html = '';
607
+ $html .= '<video id="'.$vidid.'" class="video-js vjs-default-skin vjs-big-play-centered" '.$autoplay.' '.$loop.' controls preload="none" style="width:100%;height:400px;" poster="" >';
608
  $html .= '<source src="'.$videourl.'" type="video/mp4"/>';
609
  $html .= '<p class="vjs-no-js">';
610
  $html .= 'To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com html5-video-support/" target="_blank">supports HTML5 video</a>';
641
  $pnovideo = $_POST['panovideo'];
642
  if ($pnovideo == "on") {
643
 
 
644
  $vidid = 'vid'.$postid;
645
  $videourl = sanitize_url($_POST['videourl']);
646
+ $autoplay = sanitize_text_field($_POST['autoplay']);
647
+ $vidautoplay = sanitize_text_field($_POST['autoplay']);
648
+ $loop = sanitize_text_field($_POST['loop']);
649
+ $vidloop = sanitize_text_field($_POST['loop']);
650
  $vidtype = '';
651
  if (strpos($videourl, 'youtube') > 0) {
652
  $vidtype = 'youtube';
653
  $explodeid = '';
654
  $explodeid = explode("=",$videourl);
655
  $foundid = '';
656
+
657
+ if ($autoplay == 'on') {
658
+ $autoplay = '&autoplay=1';
659
+ }
660
+ else {
661
+ $autoplay = '';
662
+ }
663
+
664
+ if ($loop == 'on') {
665
+ $loop = '&loop=1';
666
+ }
667
+ else {
668
+ $loop = '';
669
+ }
670
+
671
+ $foundid = $explodeid[1].'?'.$autoplay.$loop;
672
  $html = '';
673
  $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
674
 
677
  $explodeid = '';
678
  $explodeid = explode("/",$videourl);
679
  $foundid = '';
680
+
681
+ if ($autoplay == 'on') {
682
+ $autoplay = '&autoplay=1';
683
+ }
684
+ else {
685
+ $autoplay = '';
686
+ }
687
+
688
+ if ($loop == 'on') {
689
+ $loop = '&loop=1';
690
+ }
691
+ else {
692
+ $loop = '';
693
+ }
694
+
695
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
696
  $html = '';
697
  $html .= '<iframe width="600" height="400" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
698
 
703
  $explodeid = '';
704
  $explodeid = explode("/",$videourl);
705
  $foundid = '';
706
+
707
+ if ($autoplay == 'on') {
708
+ $autoplay = '&autoplay=1&muted=1';
709
+ }
710
+ else {
711
+ $autoplay = '';
712
+ }
713
+
714
+ if ($loop == 'on') {
715
+ $loop = '&loop=1';
716
+ }
717
+ else {
718
+ $loop = '';
719
+ }
720
+
721
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
722
  $html = '';
723
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="600" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
724
 
726
  $vidtype = 'selfhost';
727
  $vidautoplay = '';
728
  $vidautoplay = sanitize_text_field($_POST['vidautoplay']);
729
+
730
+ if ($autoplay == 'on') {
731
+ $autoplay = 'autoplay muted';
732
  }
733
  else {
734
+ $autoplay = '';
735
  }
736
 
737
+ if ($loop == 'on') {
738
+ $loop = 'loop';
 
 
739
  }
740
  else {
741
+ $loop = '';
742
  }
743
 
744
  $html = '';
745
+ $html .= '<video id="'.$vidid.'" class="video-js vjs-default-skin vjs-big-play-centered" '.$autoplay.' '.$loop.' controls preload="auto" style="width:100%;height:100%;" poster="" >';
746
  $html .= '<source src="'.$videourl.'" type="video/mp4"/>';
747
  $html .= '<p class="vjs-no-js">';
748
  $html .= 'To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com html5-video-support/" target="_blank">supports HTML5 video</a>';
750
  $html .= '</video>';
751
  }
752
 
753
+
754
+
755
  $videoarray = array();
756
+ $videoarray = array(__( "panoid" )=>$panoid,__( "panoviddata" )=>$html,__( "vidid" )=>$vidid,__( "vidurl" )=>$videourl,__( "autoplay" )=>$vidautoplay,__( "loop" )=>$vidloop,__( "vidtype" )=>$vidtype);
757
  update_post_meta( $postid, 'panodata', $videoarray );
758
  die();
759
  }
797
  $compass = false;
798
  }
799
 
800
+ $mouseZoom = sanitize_text_field($_POST['mouseZoom']);
801
+ if ($mouseZoom == 'on') {
802
+ $mouseZoom = true;
803
+ }
804
+ else {
805
+ $mouseZoom = false;
806
+ }
807
+
808
  $autoload = sanitize_text_field($_POST['autoload']);
809
  if ($autoload == 'on') {
810
  $autoload = true;
1106
  }
1107
 
1108
  $pano_array = array();
1109
+ $pano_array = array(__( "panoid" )=>$panoid,__( "autoLoad" )=>$autoload,__( "showControls" )=>$control,__( "cpLogoSwitch" )=>$cpLogoSwitch,__( "cpLogoImg" )=>$cpLogoImg,__( "cpLogoContent" )=>$cpLogoContent,__( "vrgallery" )=>$vrgallery,__( "customcontrol" )=>$custom_control,__( "gyro" )=>$gyro,__( "compass" )=>$compass,__( "mouseZoom" )=>$mouseZoom,__( "autoRotate" )=>$autorotation,__( "autoRotateInactivityDelay" )=>$autorotationinactivedelay,__( "autoRotateStopDelay" )=>$autorotationstopdelay,__( "preview" )=>$preview,__( "defaultscene" )=>$default_scene,__( "scenefadeduration" )=>$scene_fade_duration,__( "panodata" )=>$panodata);
1110
 
1111
  if ($rotation == 'off') {
1112
  unset($pano_array['autoRotate']);
admin/partials/wpvr-meta-box-builder-display.php CHANGED
@@ -38,10 +38,11 @@ if (isset($postdata['vidid'])) {
38
  if ($postdata['vidtype'] == 'selfhost') {
39
  ?>
40
  <script>
 
41
  videojs(<?php echo $postdata['vidid']; ?>, {
42
- plugins: {
43
- pannellum: {}
44
- }
45
  });
46
  </script>
47
  <?php
@@ -100,6 +101,10 @@ $compass = false;
100
  if (isset($postdata['compass'])) {
101
  $compass = $postdata['compass'];
102
  }
 
 
 
 
103
  $autoload = false;
104
  if (isset($postdata['autoLoad'])) {
105
  $autoload = $postdata['autoLoad'];
@@ -355,7 +360,7 @@ if (isset($postdata['panodata'])) {
355
  $pano_id_array = array();
356
  $pano_id_array = array("panoid"=>$panoid);
357
  $pano_response = array();
358
- $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,'compass'=>$compass,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
359
 
360
  if (empty($autorotation)) {
361
  unset($pano_response['autoRotate']);
38
  if ($postdata['vidtype'] == 'selfhost') {
39
  ?>
40
  <script>
41
+
42
  videojs(<?php echo $postdata['vidid']; ?>, {
43
+ plugins: {
44
+ pannellum: {}
45
+ }
46
  });
47
  </script>
48
  <?php
101
  if (isset($postdata['compass'])) {
102
  $compass = $postdata['compass'];
103
  }
104
+ $mouseZoom = true;
105
+ if (isset($postdata['mouseZoom'])) {
106
+ $mouseZoom = $postdata['mouseZoom'];
107
+ }
108
  $autoload = false;
109
  if (isset($postdata['autoLoad'])) {
110
  $autoload = $postdata['autoLoad'];
360
  $pano_id_array = array();
361
  $pano_id_array = array("panoid"=>$panoid);
362
  $pano_response = array();
363
+ $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,'compass'=>$compass,'mouseZoom'=>$mouseZoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
364
 
365
  if (empty($autorotation)) {
366
  unset($pano_response['autoRotate']);
admin/partials/wpvr_documentation.php CHANGED
@@ -165,6 +165,8 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
165
  <div class="item"><?php _e('Custom control buttons','wpvr'); ?></div>
166
  <div class="item"><?php _e('Google street view embed','wpvr'); ?></div>
167
  <div class="item"><?php _e('Company logo','wpvr'); ?></div>
 
 
168
  <div class="item"><?php _e('Personalized support on both support forum and our support e-mail.','wpvr'); ?></div>
169
  </div>
170
  <a href="https://rextheme.com/wpvr/" target="_blank" class="waves-effect waves-light btn wpvr-btn"><?php _e('Get Premium Version','wpvr'); ?></a>
165
  <div class="item"><?php _e('Custom control buttons','wpvr'); ?></div>
166
  <div class="item"><?php _e('Google street view embed','wpvr'); ?></div>
167
  <div class="item"><?php _e('Company logo','wpvr'); ?></div>
168
+ <div class="item"><?php _e('360 video autoplay and loop switch','wpvr'); ?></div>
169
+ <div class="item"><?php _e('Mouse scroll switch','wpvr'); ?></div>
170
  <div class="item"><?php _e('Personalized support on both support forum and our support e-mail.','wpvr'); ?></div>
171
  </div>
172
  <a href="https://rextheme.com/wpvr/" target="_blank" class="waves-effect waves-light btn wpvr-btn"><?php _e('Get Premium Version','wpvr'); ?></a>
public/class-wpvr-public.php CHANGED
@@ -171,12 +171,35 @@ class Wpvr_Public {
171
  }
172
 
173
  $videourl = $postdata['vidurl'];
 
 
 
 
 
 
 
 
174
 
175
  if (strpos($videourl, 'youtube') > 0) {
176
  $explodeid = '';
177
  $explodeid = explode("=",$videourl);
178
  $foundid = '';
179
- $foundid = $explodeid[1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  $html = '';
181
  $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
182
  $html .= '<iframe width="'.trim($width,'px').'" height="'.trim($height,'px').'" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
@@ -187,7 +210,20 @@ class Wpvr_Public {
187
  $explodeid = '';
188
  $explodeid = explode("/",$videourl);
189
  $foundid = '';
190
- $foundid = $explodeid[3];
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  $html = '';
192
  $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
193
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.trim($width,'px').'" height="'.trim($height,'px').'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
@@ -195,14 +231,17 @@ class Wpvr_Public {
195
 
196
  } else {
197
  $html = '';
198
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto;">';
199
  $html .= '<div style="width:100%; height:100%; ">'.$postdata['panoviddata'].'</div>';
200
  $html .= '<script>';
201
- $html .= 'videojs('.$postdata['vidid'].', {';
202
  $html .= 'plugins: {';
203
  $html .= 'pannellum: {}';
204
  $html .= '}';
205
  $html .= '});';
 
 
 
206
  $html .= '</script>';
207
  $html .= '</div>';
208
  }
@@ -239,6 +278,11 @@ class Wpvr_Public {
239
  $compass = $postdata['compass'];
240
  }
241
 
 
 
 
 
 
242
  $autoload = false;
243
 
244
  if (isset($postdata['autoLoad'])) {
@@ -505,7 +549,7 @@ class Wpvr_Public {
505
  $pano_id_array = array();
506
  $pano_id_array = array("panoid"=>$panoid);
507
  $pano_response = array();
508
- $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,"orientationSupport"=>'false',"compass"=>$compass,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
509
 
510
  if (empty($autorotation)) {
511
  unset($pano_response['autoRotate']);
171
  }
172
 
173
  $videourl = $postdata['vidurl'];
174
+ $autoplay = 'off';
175
+ if (isset($postdata['autoplay'])) {
176
+ $autoplay = $postdata['autoplay'];
177
+ }
178
+ $loop = 'off';
179
+ if (isset($postdata['loop'])) {
180
+ $loop = $postdata['loop'];
181
+ }
182
 
183
  if (strpos($videourl, 'youtube') > 0) {
184
  $explodeid = '';
185
  $explodeid = explode("=",$videourl);
186
  $foundid = '';
187
+
188
+ if ($autoplay == 'on') {
189
+ $autoplay = '&autoplay=1';
190
+ }
191
+ else {
192
+ $autoplay = '';
193
+ }
194
+
195
+ if ($loop == 'on') {
196
+ $loop = '&loop=1';
197
+ }
198
+ else {
199
+ $loop = '';
200
+ }
201
+
202
+ $foundid = $explodeid[1].'?'.$autoplay.$loop;
203
  $html = '';
204
  $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
205
  $html .= '<iframe width="'.trim($width,'px').'" height="'.trim($height,'px').'" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
210
  $explodeid = '';
211
  $explodeid = explode("/",$videourl);
212
  $foundid = '';
213
+ if ($autoplay == 'on') {
214
+ $autoplay = '&autoplay=1&muted=1';
215
+ }
216
+ else {
217
+ $autoplay = '';
218
+ }
219
+
220
+ if ($loop == 'on') {
221
+ $loop = '&loop=1';
222
+ }
223
+ else {
224
+ $loop = '';
225
+ }
226
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
227
  $html = '';
228
  $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
229
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.trim($width,'px').'" height="'.trim($height,'px').'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
231
 
232
  } else {
233
  $html = '';
234
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto;">';
235
  $html .= '<div style="width:100%; height:100%; ">'.$postdata['panoviddata'].'</div>';
236
  $html .= '<script>';
237
+ $html .= 'var player = videojs('.$postdata['vidid'].', {';
238
  $html .= 'plugins: {';
239
  $html .= 'pannellum: {}';
240
  $html .= '}';
241
  $html .= '});';
242
+ $html .= '
243
+ videojs('.$postdata['vidid'].').play();
244
+ ';
245
  $html .= '</script>';
246
  $html .= '</div>';
247
  }
278
  $compass = $postdata['compass'];
279
  }
280
 
281
+ $mouseZoom = true;
282
+ if (isset($postdata['mouseZoom'])) {
283
+ $mouseZoom = $postdata['mouseZoom'];
284
+ }
285
+
286
  $autoload = false;
287
 
288
  if (isset($postdata['autoLoad'])) {
549
  $pano_id_array = array();
550
  $pano_id_array = array("panoid"=>$panoid);
551
  $pano_response = array();
552
+ $pano_response = array("autoLoad"=>$autoload,"showControls"=>$control,"orientationSupport"=>'false',"compass"=>$compass,"mouseZoom"=>$mouseZoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,"default"=>$default_data,"scenes"=>$scene_data);
553
 
554
  if (empty($autorotation)) {
555
  unset($pano_response['autoRotate']);
wpvr.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: WP VR
17
  * Plugin URI: https://rextheme.com/wpvr/
18
  * Description: WP VR - 360 Panorama and virtual tour creator for WordPress is a customized panaroma & virtual builder tool for WordPress Website.
19
- * Version: 4.0.0
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+
@@ -202,11 +202,36 @@ function wpvr_block_render( $attributes ) {
202
  }
203
  $videourl = $postdata['vidurl'];
204
 
 
 
 
 
 
 
 
 
 
 
205
  if (strpos($videourl, 'youtube') > 0) {
206
  $explodeid = '';
207
  $explodeid = explode("=",$videourl);
208
  $foundid = '';
209
- $foundid = $explodeid[1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  $html = '';
211
  $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
212
  $html .= '<iframe width="'.$width.'" height="'.$height.'" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
@@ -216,7 +241,22 @@ function wpvr_block_render( $attributes ) {
216
  $explodeid = '';
217
  $explodeid = explode("/",$videourl);
218
  $foundid = '';
219
- $foundid = $explodeid[3];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  $html = '';
221
  $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
222
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.$width.'" height="'.$height.'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
@@ -266,6 +306,11 @@ function wpvr_block_render( $attributes ) {
266
  $compass = $postdata['compass'];
267
  }
268
 
 
 
 
 
 
269
  $autoload = false;
270
 
271
  if (isset($postdata['autoLoad'])) {
@@ -533,7 +578,7 @@ function wpvr_block_render( $attributes ) {
533
  $pano_id_array = array();
534
  $pano_id_array = array('panoid'=>$panoid);
535
  $pano_response = array();
536
- $pano_response = array('autoLoad'=>$autoload,'showControls'=>$control,'compass'=>$compass,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,'default'=>$default_data,'scenes'=>$scene_data);
537
  if (empty($autorotation)) {
538
  unset($pano_response['autoRotate']);
539
  unset($pano_response['autoRotateInactivityDelay']);
16
  * Plugin Name: WP VR
17
  * Plugin URI: https://rextheme.com/wpvr/
18
  * Description: WP VR - 360 Panorama and virtual tour creator for WordPress is a customized panaroma & virtual builder tool for WordPress Website.
19
+ * Version: 4.1.0
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+
202
  }
203
  $videourl = $postdata['vidurl'];
204
 
205
+ $videourl = $postdata['vidurl'];
206
+ $autoplay = 'off';
207
+ if (isset($postdata['autoplay'])) {
208
+ $autoplay = $postdata['autoplay'];
209
+ }
210
+ $loop = 'off';
211
+ if (isset($postdata['loop'])) {
212
+ $loop = $postdata['loop'];
213
+ }
214
+
215
  if (strpos($videourl, 'youtube') > 0) {
216
  $explodeid = '';
217
  $explodeid = explode("=",$videourl);
218
  $foundid = '';
219
+
220
+ if ($autoplay == 'on') {
221
+ $autoplay = '&autoplay=1';
222
+ }
223
+ else {
224
+ $autoplay = '';
225
+ }
226
+
227
+ if ($loop == 'on') {
228
+ $loop = '&loop=1';
229
+ }
230
+ else {
231
+ $loop = '';
232
+ }
233
+
234
+ $foundid = $explodeid[1].'?'.$autoplay.$loop;
235
  $html = '';
236
  $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
237
  $html .= '<iframe width="'.$width.'" height="'.$height.'" src="https://www.youtube.com/embed/'.$foundid.'" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
241
  $explodeid = '';
242
  $explodeid = explode("/",$videourl);
243
  $foundid = '';
244
+
245
+ if ($autoplay == 'on') {
246
+ $autoplay = '&autoplay=1&muted=1';
247
+ }
248
+ else {
249
+ $autoplay = '';
250
+ }
251
+
252
+ if ($loop == 'on') {
253
+ $loop = '&loop=1';
254
+ }
255
+ else {
256
+ $loop = '';
257
+ }
258
+
259
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
260
  $html = '';
261
  $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
262
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.$width.'" height="'.$height.'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
306
  $compass = $postdata['compass'];
307
  }
308
 
309
+ $mouseZoom = true;
310
+ if (isset($postdata['mouseZoom'])) {
311
+ $mouseZoom = $postdata['mouseZoom'];
312
+ }
313
+
314
  $autoload = false;
315
 
316
  if (isset($postdata['autoLoad'])) {
578
  $pano_id_array = array();
579
  $pano_id_array = array('panoid'=>$panoid);
580
  $pano_response = array();
581
+ $pano_response = array('autoLoad'=>$autoload,'showControls'=>$control,'compass'=>$compass,'mouseZoom'=>$mouseZoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,'default'=>$default_data,'scenes'=>$scene_data);
582
  if (empty($autorotation)) {
583
  unset($pano_response['autoRotate']);
584
  unset($pano_response['autoRotateInactivityDelay']);