videoDOM. srcObject = canvas. captureStream(); The videoplayer can't be used on iOS16. Who can help?
-
-
Hi,
iOS and html5-video is a topic by its own...
I don't know why captureStream don't work, but there is an easier solution for using a canvas without the need for videos.
Instead of using a video, the canvas can be added 'videoDOM' element to a krpano plugin element.
Then krpano then thinks this is a video-element and updates its texture every time when its currentTime value changes.These settings would need to be done, they 'fake' a video-element:
Codeplugin.videoDOM = canvas; plugin.videowidth = canvas_width; plugin.videoheight = canvas_height; canvas.readyState = 4; canvas.videoWidth = canvas_width; canvas.videoHeight = canvas_height; canvas.currentTime = 1;
and every time the canvas changes or should be redrawn, modify the currentTime somehow:
Here a whole plugin source example:
https://krpano.com/viewsource.htm…awing/canvas.jsand here the example for trying - click the canvas and draw something:
https://krpano.com/krpano.html?xm…wing/canvas.xmlThe example xml:
https://krpano.com/viewsource.htm…wing/canvas.xmlBest regards,
Klaus -
Thanks, Klaus.
krpano is so flexible and powerful. -
tx as well !
thats a neat technique :) -
Hi Klaus, support transparent background?
-
Hi,
in version 1.20 transparent backgrounds are not possible in this case, there the internal texture for videos is always a RGB one.
But in version 1.21 RGBA textures are used for videos (mainly for better performance in Firefox), then transparent canvas elements will work automatically here.
Best regards,
Klaus
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!