File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -2110,7 +2110,11 @@ Logic Interface CSS
21102110 cursor : pointer;
21112111
21122112 pointer-events : all;
2113+ }
21132114
2115+ .analytics-video-toggle .analytics-video-toggle-loading {
2116+ color : # 777 ;
2117+ cursor : progress;
21142118}
21152119
21162120.analytics-export-link-container {
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ class VideoPlayer extends Followable {
180180 // this.phone.add(this.debugBox);
181181
182182 this . rvl = null ;
183- fetch ( urls . rvl ) . then ( res => {
183+ this . rvlLoadPromise = fetch ( urls . rvl ) . then ( res => {
184184 return res . arrayBuffer ( ) ;
185185 } ) . then ( buf => {
186186 this . rvl = new RVLParser ( buf ) ;
Original file line number Diff line number Diff line change @@ -791,10 +791,20 @@ export class MotionStudy {
791791
792792 createVideoPlayerShowHideButton ( ) {
793793 this . videoPlayerShowHideButton = document . createElement ( 'div' ) ;
794- this . videoPlayerShowHideButton . classList . add ( 'analytics-video-toggle' ) ;
794+ this . videoPlayerShowHideButton . classList . add ( 'analytics-video-toggle' , 'analytics-video-toggle-loading' ) ;
795795 this . videoPlayerShowHideButton . classList . add ( 'analytics-button-container' ) ;
796- this . videoPlayerShowHideButton . textContent = 'Show Spatial Video' ;
796+ this . videoPlayerShowHideButton . textContent = 'Loading Spatial Video' ;
797+
798+ this . videoPlayer . rvlLoadPromise . then ( ( ) => {
799+ this . videoPlayerShowHideButton . textContent = 'Show Spatial Video' ;
800+ this . videoPlayerShowHideButton . classList . remove ( 'analytics-video-toggle-loading' ) ;
801+ } ) ;
802+
797803 this . videoPlayerShowHideButton . addEventListener ( 'pointerup' , ( ) => {
804+ if ( this . videoPlayerShowHideButton . classList . contains ( 'analytics-video-toggle-loading' ) ) {
805+ return ;
806+ }
807+
798808 if ( this . videoPlayer . isShown ( ) ) {
799809 this . humanPoseAnalyzer . setDepthTestEnabled ( true ) ;
800810 this . videoPlayer . hide ( ) ;
@@ -811,6 +821,9 @@ export class MotionStudy {
811821 if ( ! this . videoPlayerShowHideButton || ! this . videoPlayer ) {
812822 return ;
813823 }
824+ if ( this . videoPlayerShowHideButton . classList . contains ( 'analytics-video-toggle-loading' ) ) {
825+ return ;
826+ }
814827
815828 if ( this . videoPlayer . isShown ( ) ) {
816829 this . videoPlayerShowHideButton . textContent = 'Hide Spatial Video' ;
You can’t perform that action at this time.
0 commit comments