Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #72 from pchen66/dev
Browse files Browse the repository at this point in the history
r6
  • Loading branch information
pchen66 authored Jun 2, 2017
2 parents 205b0fa + 3582004 commit 157b63d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 20 deletions.
32 changes: 27 additions & 5 deletions build/panolens.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions build/panolens.min.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,8 @@
viewer.enableControl( PANOLENS.Controls.DEVICEORIENTATION );
viewer.enableEffect( PANOLENS.Modes.CARDBOARD );

/*viewer.enableControl( PANOLENS.Controls.ORBIT );
viewer.enableEffect( PANOLENS.Modes.NORMAL );
viewer.enableControl( PANOLENS.Controls.DEVICEORIENTATION );
viewer.enableEffect( PANOLENS.Modes.CARDBOARD );
viewer.enableControl( PANOLENS.Controls.ORBIT );
viewer.enableEffect( PANOLENS.Modes.NORMAL );*/
viewer.enableEffect( PANOLENS.Modes.NORMAL );

</script>

Expand Down
32 changes: 27 additions & 5 deletions src/panorama/VideoPanorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@
this.videoElement.setAttribute( "webkit-playsinline", "" );
}

this.videoElement.src = src;
this.videoElement.load();

this.videoElement.onloadeddata = function(){
var onloadeddata = function(){

scope.setVideoTexture( scope.videoElement );

Expand Down Expand Up @@ -122,9 +119,34 @@
}

}

};

/**
* Ready state of the audio/video element
* 0 = HAVE_NOTHING - no information whether or not the audio/video is ready
* 1 = HAVE_METADATA - metadata for the audio/video is ready
* 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond
* 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available
* 4 = HAVE_ENOUGH_DATA - enough data available to start playing
*/
if ( this.videoElement.readyState > 2 ) {

onloadeddata();

} else {

if ( !this.videoElement.querySelectorAll('source').length || !this.videoElement.src ) {

this.videoElement.src = src;

}

this.videoElement.load();
}

this.videoElement.onloadeddata = onloadeddata;


this.videoElement.ontimeupdate = function ( event ) {

/**
Expand Down

0 comments on commit 157b63d

Please sign in to comment.