video bugfix
This commit is contained in:
parent
18febc6b0f
commit
8aa59cb9b8
1 changed files with 14 additions and 1 deletions
|
|
@ -1,10 +1,23 @@
|
||||||
|
|
||||||
let loadVideo = (mimetype) => function(url,opts){
|
let loadVideo = (mimetype) => function(url,opts){
|
||||||
let {mesh,src,camera} = opts
|
let {mesh,src,camera} = opts
|
||||||
const THREE = xrf.THREE
|
const THREE = xrf.THREE
|
||||||
let URL = xrfragment.URI.toAbsolute( xrf.navigator.URI, url )
|
let URL = xrfragment.URI.toAbsolute( xrf.navigator.URI, url )
|
||||||
let frag = URL.XRF
|
let frag = URL.XRF
|
||||||
|
|
||||||
|
// patch VideoTexture so it doesn't upload videoframes when paused
|
||||||
|
// https://github.com/mrdoob/three.js/pull/28575
|
||||||
|
THREE.VideoTexture.prototype.update = function(){
|
||||||
|
const video = this.image;
|
||||||
|
const hasVideoFrameCallback = 'requestVideoFrameCallback' in video;
|
||||||
|
|
||||||
|
if ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA && (!video.paused || !this.firstFrame) ){
|
||||||
|
console.log("updating..")
|
||||||
|
this.needsUpdate = true;
|
||||||
|
this.firstFrame = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
mesh.media = mesh.media || {}
|
mesh.media = mesh.media || {}
|
||||||
|
|
||||||
let video = mesh.media.video = document.createElement('video')
|
let video = mesh.media.video = document.createElement('video')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue