video bugfix
This commit is contained in:
parent
18febc6b0f
commit
8aa59cb9b8
|
@ -1,10 +1,23 @@
|
|||
|
||||
let loadVideo = (mimetype) => function(url,opts){
|
||||
let {mesh,src,camera} = opts
|
||||
const THREE = xrf.THREE
|
||||
let URL = xrfragment.URI.toAbsolute( xrf.navigator.URI, url )
|
||||
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 || {}
|
||||
|
||||
let video = mesh.media.video = document.createElement('video')
|
||||
|
|
Loading…
Reference in New Issue