I have an application using Away3D and therefore have been outputting as webgl for html5.
Unfortunately we also need to incorporate some video, not good at the best of times under openfl.
I tried the normal html5 video process, including testing the openfl samples, but that only seems to work if output as canvas, when outputting to WebGL it errors…
Error: WebGL warning: texParameter: No texture is bound to this target
So I have now been trying a VideoTexture on a 3D Plane in Away3D, which does work, but the performance isn’t great…
vt = new VideoTexture("assets/video/video.mp4", 1024, 1024, false, true); var tm:TextureMaterial = new TextureMaterial(vt); var planeGeom:PlaneGeometry = new PlaneGeometry(1280, 720, 1, 1, false);//same ratio as flv var planeMesh:Mesh = new Mesh(planeGeom, tm); scene.addChild(planeMesh); vt.autoUpdate = true; vt.player.play();
I have this placed in a View3D scene with a camera, is there a better way that might improve performance, maybe rendering the video as a background of the view?
At the moment I am performing a view render onEnterFrame, which maybe part of the issue between video frame rate and html5 60fps framerate…
stage3DProxy.clear(); view.render(); stage3DProxy.present();
However from what I can see the ability to dispatch an event on the next frame being ready via Event.TEXTURE_READY…
Is a flash event that doesn’t seem to exist for html5, so feedback seems to be limited to the vt.player state, which are a bit limited.
Hopefully I’m missing something obvious, but any clue would be appreciated, or a better working WebGL video process would be even better.